diff options
author | Pete Cooper <peter_cooper@apple.com> | 2014-07-31 01:44:00 +0000 |
---|---|---|
committer | Pete Cooper <peter_cooper@apple.com> | 2014-07-31 01:44:00 +0000 |
commit | 4cc54cbb9031faa4cee0863d882c2b99c1bb89da (patch) | |
tree | 81f7a1ae5293b69935edac7570c917e1f4432dd8 /llvm/lib/TableGen/TGParser.cpp | |
parent | 040c6a6708a63ab1473919d6224cf6f1c8180815 (diff) | |
download | bcm5719-llvm-4cc54cbb9031faa4cee0863d882c2b99c1bb89da.tar.gz bcm5719-llvm-4cc54cbb9031faa4cee0863d882c2b99c1bb89da.zip |
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
Diffstat (limited to 'llvm/lib/TableGen/TGParser.cpp')
-rw-r--r-- | llvm/lib/TableGen/TGParser.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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<unsigned>(), 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; |