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

Daniel Dunbar daniel at zuster.org
Sun Aug 9 01:19:03 PDT 2009


Author: ddunbar
Date: Sun Aug  9 03:19:00 2009
New Revision: 78532

URL: http://llvm.org/viewvc/llvm-project?rev=78532&view=rev
Log:
llvm-mc/AsmParser: Add hack to ignore Int_* and *_Int instructions for now, to
make it easier to see interesting ambiguities.
 - Also, check that user doesn't try to redefine the super class. This is a wart
   in the current design, in that assembler match classes aren't explicitly
   declared somewhere (so there isn't a unique place to declare the super
   class). This should probably be fixed.

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=78532&r1=78531&r2=78532&view=diff

==============================================================================
--- llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp Sun Aug  9 03:19:00 2009
@@ -225,6 +225,12 @@
   if (Name == "PHI")
     return false;
 
+  // Ignore "Int_*" and "*_Int" instructions, which are internal aliases.
+  //
+  // FIXME: This is a total hack.
+  if (StringRef(Name).startswith("Int_") || StringRef(Name).endswith("_Int"))
+    return false;
+
   // Ignore instructions with no .s string.
   //
   // FIXME: What are these?
@@ -571,6 +577,7 @@
     Entry = new ClassInfo();
     if (ClassName == "Reg") {
       Entry->Kind = ClassInfo::Register;
+      Entry->SuperClassKind = SuperClass;
     } else {
       Entry->Kind = getUserClassKind(ClassName);
       Entry->SuperClassKind = SuperClass;
@@ -581,6 +588,10 @@
     Entry->PredicateMethod = "is" + ClassName;
     Entry->RenderMethod = "add" + ClassName + "Operands";
     Classes.push_back(Entry);
+  } else {
+    // Verify the super class matches.
+    assert(SuperClass == Entry->SuperClassKind &&
+           "Cannot redefine super class kind!");
   }
   
   return Entry;





More information about the llvm-commits mailing list