define a new CodeGenInstAlias. It has an asmstring and operand list for now,
authorChris Lattner <sabre@nondot.org>
Mon, 1 Nov 2010 04:05:41 +0000 (04:05 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 1 Nov 2010 04:05:41 +0000 (04:05 +0000)
todo: the result field.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117894 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/AsmMatcherEmitter.cpp
utils/TableGen/CodeGenInstruction.cpp
utils/TableGen/CodeGenInstruction.h

index 254a719959fae433280b6f8d2f8b9251a29d7e9e..d269749c9f1fe003c39f19cf565d01bee965dccf 100644 (file)
@@ -946,6 +946,15 @@ void AsmMatcherInfo::BuildInfo() {
     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);
index 5eceaeb015ccb8fd551bec0082dde0accbc22533..8a05374d8c455023ec8ed7104f4085a6c9c5390c 100644 (file)
@@ -382,3 +382,13 @@ FlattenAsmStringVariants(StringRef Cur, unsigned Variant) {
   return Res;
 }
 
+
+//===----------------------------------------------------------------------===//
+/// CodeGenInstAlias Implementation
+//===----------------------------------------------------------------------===//
+
+CodeGenInstAlias::CodeGenInstAlias(Record *R) : TheDef(R), Operands(R) {
+  AsmString = R->getValueAsString("AsmString");
+
+  
+}
index 93bec14ff5f696a24133a89c619fcbb898b7219e..f05a88fd022d2df48a2ce0292fc27342e943b02b 100644 (file)
@@ -235,6 +235,23 @@ namespace llvm {
     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