[llvm] r212637 - Change an assert() to a diagnostic.

Jim Grosbach grosbach at apple.com
Wed Jul 9 11:55:49 PDT 2014


Author: grosbach
Date: Wed Jul  9 13:55:49 2014
New Revision: 212637

URL: http://llvm.org/viewvc/llvm-project?rev=212637&view=rev
Log:
Change an assert() to a diagnostic.

Modified:
    llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp

Modified: llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp?rev=212637&r1=212636&r2=212637&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp (original)
+++ llvm/trunk/utils/TableGen/CodeGenDAGPatterns.cpp Wed Jul  9 13:55:49 2014
@@ -2119,9 +2119,11 @@ InferAllTypes(const StringMap<SmallVecto
       // If we have input named node types, propagate their types to the named
       // values here.
       if (InNamedTypes) {
-        // FIXME: Should be error?
-        assert(InNamedTypes->count(I->getKey()) &&
-               "Named node in output pattern but not input pattern?");
+        if (!InNamedTypes->count(I->getKey())) {
+          error("Node '" + std::string(I->getKey()) +
+                "' in output pattern but not input pattern");
+          return true;
+        }
 
         const SmallVectorImpl<TreePatternNode*> &InNodes =
           InNamedTypes->find(I->getKey())->second;





More information about the llvm-commits mailing list