OSDN Git Service

Better error message.
authorMikhail Glushenkov <foldr@codedgers.com>
Sun, 7 Dec 2008 16:45:12 +0000 (16:45 +0000)
committerMikhail Glushenkov <foldr@codedgers.com>
Sun, 7 Dec 2008 16:45:12 +0000 (16:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60664 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/LLVMCConfigurationEmitter.cpp

index fa423f4..eda45c7 100644 (file)
@@ -584,7 +584,12 @@ private:
 
   void onActions (const DagInit* d) {
     checkNumberOfArguments(d, 1);
-    toolDesc_.Actions = d->getArg(0);
+    Init* Case = d->getArg(0);
+    if (typeid(*Case) != typeid(DagInit) ||
+        static_cast<DagInit*>(Case)->getOperator()->getAsString() != "case")
+      throw
+        std::string("The argument to (actions) should be a 'case' construct!");
+    toolDesc_.Actions = Case;
   }
 
   void onCmdLine (const DagInit* d) {