[llvm-commits] [llvm] r117894 - in /llvm/trunk/utils/TableGen: AsmMatcherEmitter.cpp CodeGenInstruction.cpp CodeGenInstruction.h

Chris Lattner sabre at nondot.org
Sun Oct 31 21:05:41 PDT 2010


Author: lattner
Date: Sun Oct 31 23:05:41 2010
New Revision: 117894

URL: http://llvm.org/viewvc/llvm-project?rev=117894&view=rev
Log:
define a new CodeGenInstAlias.  It has an asmstring and operand list for now,
todo: the result field.

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

Modified: llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp?rev=117894&r1=117893&r2=117894&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp Sun Oct 31 23:05:41 2010
@@ -946,6 +946,15 @@
     Instructions.push_back(II.take());
   }
   
+  // Parse all of the InstAlias definitions.
+  std::vector<Record*> AllInstAliases =
+    Records.getAllDerivedDefinitions("InstAlias");
+  for (unsigned i = 0, e = AllInstAliases.size(); i != e; ++i) {
+    CodeGenInstAlias *Alias = new CodeGenInstAlias(AllInstAliases[i]);
+
+    
+    (void)Alias;
+  }
 
   // Build info for the register classes.
   BuildRegisterClasses(SingletonRegisters);

Modified: llvm/trunk/utils/TableGen/CodeGenInstruction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenInstruction.cpp?rev=117894&r1=117893&r2=117894&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/CodeGenInstruction.cpp (original)
+++ llvm/trunk/utils/TableGen/CodeGenInstruction.cpp Sun Oct 31 23:05:41 2010
@@ -382,3 +382,13 @@
   return Res;
 }
 
+
+//===----------------------------------------------------------------------===//
+/// CodeGenInstAlias Implementation
+//===----------------------------------------------------------------------===//
+
+CodeGenInstAlias::CodeGenInstAlias(Record *R) : TheDef(R), Operands(R) {
+  AsmString = R->getValueAsString("AsmString");
+
+  
+}

Modified: llvm/trunk/utils/TableGen/CodeGenInstruction.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenInstruction.h?rev=117894&r1=117893&r2=117894&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/CodeGenInstruction.h (original)
+++ llvm/trunk/utils/TableGen/CodeGenInstruction.h Sun Oct 31 23:05:41 2010
@@ -235,6 +235,23 @@
     static std::string FlattenAsmStringVariants(StringRef AsmString,
                                                 unsigned Variant);
   };
-  }
+  
+  
+  /// CodeGenInstAlias - This represents an InstAlias definition.
+  class CodeGenInstAlias {
+  public:
+    Record *TheDef;            // The actual record defining this InstAlias.
+    
+    /// AsmString - The format string used to emit a .s file for the
+    /// instruction.
+    std::string AsmString;
+    
+    /// Operands - This is information about the (ins) and (outs) list specified
+    /// to the alias.
+    CGIOperandList Operands;
+    
+    CodeGenInstAlias(Record *R);
+  };    
+}
 
 #endif





More information about the llvm-commits mailing list