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

David Greene greened at obbligato.org
Wed Oct 19 06:04:26 PDT 2011


Author: greened
Date: Wed Oct 19 08:04:26 2011
New Revision: 142521

URL: http://llvm.org/viewvc/llvm-project?rev=142521&view=rev
Log:
Don't Parse Object Body as a Name

Stop parsing a value if we are in name parsing mode and we see a left
brace.  A left brace indicates the start of an object body when we are
parsing a 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=142521&r1=142520&r2=142521&view=diff
==============================================================================
--- llvm/trunk/lib/TableGen/TGParser.cpp (original)
+++ llvm/trunk/lib/TableGen/TGParser.cpp Wed Oct 19 08:04:26 2011
@@ -1330,6 +1330,10 @@
     switch (Lex.getCode()) {
     default: return Result;
     case tgtok::l_brace: {
+      if (Mode == ParseNameMode)
+        // This is the beginning of the object body.
+        return Result;
+
       SMLoc CurlyLoc = Lex.getLoc();
       Lex.Lex(); // eat the '{'
       std::vector<unsigned> Ranges = ParseRangeList();





More information about the llvm-commits mailing list