[llvm-commits] [llvm] r171140 - /llvm/trunk/lib/TableGen/TGParser.cpp

Craig Topper craig.topper at gmail.com
Wed Dec 26 22:32:52 PST 2012


Author: ctopper
Date: Thu Dec 27 00:32:52 2012
New Revision: 171140

URL: http://llvm.org/viewvc/llvm-project?rev=171140&view=rev
Log:
Update tablegen parser to allow defm names to start with #NAME.

Modified:
    llvm/trunk/lib/TableGen/TGParser.cpp

Modified: llvm/trunk/lib/TableGen/TGParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/TableGen/TGParser.cpp?rev=171140&r1=171139&r2=171140&view=diff
==============================================================================
--- llvm/trunk/lib/TableGen/TGParser.cpp (original)
+++ llvm/trunk/lib/TableGen/TGParser.cpp Thu Dec 27 00:32:52 2012
@@ -2406,7 +2406,11 @@
 
   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);
   }
 





More information about the llvm-commits mailing list