summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-11-01 04:05:41 +0000
committerChris Lattner <sabre@nondot.org>2010-11-01 04:05:41 +0000
commit488c201bb713874da04c53c919e34231bf3852bf (patch)
tree29de11310f1278723fd68e18f3ec22faf751469d
parentd8adec70f321a22f996d772db16f0b6682efd98e (diff)
downloadbcm5719-llvm-488c201bb713874da04c53c919e34231bf3852bf.tar.gz
bcm5719-llvm-488c201bb713874da04c53c919e34231bf3852bf.zip
define a new CodeGenInstAlias. It has an asmstring and operand list for now,
todo: the result field. llvm-svn: 117894
-rw-r--r--llvm/utils/TableGen/AsmMatcherEmitter.cpp9
-rw-r--r--llvm/utils/TableGen/CodeGenInstruction.cpp10
-rw-r--r--llvm/utils/TableGen/CodeGenInstruction.h19
3 files changed, 37 insertions, 1 deletions
diff --git a/llvm/utils/TableGen/AsmMatcherEmitter.cpp b/llvm/utils/TableGen/AsmMatcherEmitter.cpp
index 254a719959f..d269749c9f1 100644
--- a/llvm/utils/TableGen/AsmMatcherEmitter.cpp
+++ b/llvm/utils/TableGen/AsmMatcherEmitter.cpp
@@ -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);
diff --git a/llvm/utils/TableGen/CodeGenInstruction.cpp b/llvm/utils/TableGen/CodeGenInstruction.cpp
index 5eceaeb015c..8a05374d8c4 100644
--- a/llvm/utils/TableGen/CodeGenInstruction.cpp
+++ b/llvm/utils/TableGen/CodeGenInstruction.cpp
@@ -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");
+
+
+}
diff --git a/llvm/utils/TableGen/CodeGenInstruction.h b/llvm/utils/TableGen/CodeGenInstruction.h
index 93bec14ff5f..f05a88fd022 100644
--- a/llvm/utils/TableGen/CodeGenInstruction.h
+++ b/llvm/utils/TableGen/CodeGenInstruction.h
@@ -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
OpenPOWER on IntegriCloud