From 025c5de9bac36e98340944e29fa316e53002e354 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Thu, 27 Dec 2012 06:32:52 +0000 Subject: Update tablegen parser to allow defm names to start with #NAME. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171140 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/TableGen/TGParser.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/TableGen/TGParser.cpp b/lib/TableGen/TGParser.cpp index 17f0abc974..e5875ad795 100644 --- a/lib/TableGen/TGParser.cpp +++ b/lib/TableGen/TGParser.cpp @@ -2406,7 +2406,11 @@ bool TGParser::ParseDefm(MultiClass *CurMultiClass) { Init *DefmPrefix = 0; - if (Lex.Lex() == tgtok::Id) { // eat the defm. + Lex.Lex(); // eat the defm. + + // Note that tgtok::paste is here to allow starting with #NAME. + if (Lex.getCode() == tgtok::Id || + Lex.getCode() == tgtok::paste) { DefmPrefix = ParseObjectName(CurMultiClass); } -- cgit v1.2.3