[llvm-commits] [llvm] r117890 - /llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp

Chris Lattner sabre at nondot.org
Sun Oct 31 19:09:21 PDT 2010


Author: lattner
Date: Sun Oct 31 21:09:21 2010
New Revision: 117890

URL: http://llvm.org/viewvc/llvm-project?rev=117890&view=rev
Log:
all predicates on an MnemonicAlias must be AssemblerPredicates.

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

Modified: llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp?rev=117890&r1=117889&r2=117890&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp Sun Oct 31 21:09:21 2010
@@ -1466,13 +1466,17 @@
   std::string Result;
   unsigned NumFeatures = 0;
   for (unsigned i = 0, e = ReqFeatures.size(); i != e; ++i) {
-    if (SubtargetFeatureInfo *F = Info.getSubtargetFeature(ReqFeatures[i])) {
-      if (NumFeatures)
-        Result += '|';
+    SubtargetFeatureInfo *F = Info.getSubtargetFeature(ReqFeatures[i]);
     
-      Result += F->getEnumName();
-      ++NumFeatures;
-    }
+    if (F == 0)
+      throw TGError(R->getLoc(), "Predicate '" + ReqFeatures[i]->getName() +
+                    "' is not marked as an AssemblerPredicate!");
+    
+    if (NumFeatures)
+      Result += '|';
+  
+    Result += F->getEnumName();
+    ++NumFeatures;
   }
   
   if (NumFeatures > 1)





More information about the llvm-commits mailing list