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.

llvm-svn: 142521
This commit is contained in:
David Greene 2011-10-19 13:04:26 +00:00
parent 232bd6017c
commit b8a7c9d0bf
1 changed files with 4 additions and 0 deletions

View File

@ -1330,6 +1330,10 @@ Init *TGParser::ParseValue(Record *CurRec, RecTy *ItemType, IDParseMode Mode) {
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();