From 4cc54cbb9031faa4cee0863d882c2b99c1bb89da Mon Sep 17 00:00:00 2001 From: Pete Cooper Date: Thu, 31 Jul 2014 01:44:00 +0000 Subject: Don't fail tablegen immediately after failing to set a value. Instead allow the variable to be declared, but don't attach an initializer. This allows more than a single error to be emitted before we exit. Test case to follow soon in another patch. llvm-svn: 214375 --- llvm/lib/TableGen/TGParser.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'llvm/lib/TableGen') diff --git a/llvm/lib/TableGen/TGParser.cpp b/llvm/lib/TableGen/TGParser.cpp index 54932487e8d..a9de4eac9d3 100644 --- a/llvm/lib/TableGen/TGParser.cpp +++ b/llvm/lib/TableGen/TGParser.cpp @@ -1734,7 +1734,10 @@ Init *TGParser::ParseDeclaration(Record *CurRec, Init *Val = ParseValue(CurRec, Type); if (!Val || SetValue(CurRec, ValLoc, DeclName, std::vector(), Val)) - return nullptr; + // Return the name, even if an error is thrown. This is so that we can + // continue to make some progress, even without the value having been + // initialized. + return DeclName; } return DeclName; -- cgit v1.2.3