diff options
Diffstat (limited to 'contrib/llvm/lib/TableGen/TGParser.cpp')
-rw-r--r-- | contrib/llvm/lib/TableGen/TGParser.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/contrib/llvm/lib/TableGen/TGParser.cpp b/contrib/llvm/lib/TableGen/TGParser.cpp index 86ad2a6..daac574 100644 --- a/contrib/llvm/lib/TableGen/TGParser.cpp +++ b/contrib/llvm/lib/TableGen/TGParser.cpp @@ -1271,10 +1271,11 @@ Init *TGParser::ParseSimpleValue(Record *CurRec, RecTy *ItemType, if (ItemType != 0) { ListRecTy *ListType = dyn_cast<ListRecTy>(ItemType); if (ListType == 0) { - std::stringstream s; - s << "Type mismatch for list, expected list type, got " - << ItemType->getAsString(); - TokError(s.str()); + std::string s; + raw_string_ostream ss(s); + ss << "Type mismatch for list, expected list type, got " + << ItemType->getAsString(); + TokError(ss.str()); return 0; } GivenListTy = ListType; @@ -2495,6 +2496,9 @@ bool TGParser::ParseDefm(MultiClass *CurMultiClass) { if (Lex.getCode() != tgtok::comma) break; Lex.Lex(); // eat ','. + if (Lex.getCode() != tgtok::Id) + return TokError("expected identifier"); + SubClassLoc = Lex.getLoc(); // A defm can inherit from regular classes (non-multiclass) as |