Don't fail tablegen immediately after failing to set a value.
[oota-llvm.git] / lib / TableGen / TGParser.cpp
index 54932487e8da9edf1fc4a1814f6db2ca4cdbefbe..a9de4eac9d32073dac4f354349bd98855bf3d5f8 100644 (file)
@@ -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;