[llvm-branch-commits] [llvm-branch] r119228 - in /llvm/branches/Apple/whitney/utils/TableGen: AsmMatcherEmitter.cpp CodeGenInstruction.cpp CodeGenInstruction.h
Daniel Dunbar
daniel at zuster.org
Mon Nov 15 13:44:42 PST 2010
Author: ddunbar
Date: Mon Nov 15 15:44:42 2010
New Revision: 119228
URL: http://llvm.org/viewvc/llvm-project?rev=119228&view=rev
Log:
Merge r117894:
--
Author: Chris Lattner <clattner at apple.com>
Date: Mon Nov 1 04:05:41 2010 +0000
define a new CodeGenInstAlias. It has an asmstring and operand list for now,
todo: the result field.
Modified:
llvm/branches/Apple/whitney/utils/TableGen/AsmMatcherEmitter.cpp
llvm/branches/Apple/whitney/utils/TableGen/CodeGenInstruction.cpp
llvm/branches/Apple/whitney/utils/TableGen/CodeGenInstruction.h
Modified: llvm/branches/Apple/whitney/utils/TableGen/AsmMatcherEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/utils/TableGen/AsmMatcherEmitter.cpp?rev=119228&r1=119227&r2=119228&view=diff
==============================================================================
--- llvm/branches/Apple/whitney/utils/TableGen/AsmMatcherEmitter.cpp (original)
+++ llvm/branches/Apple/whitney/utils/TableGen/AsmMatcherEmitter.cpp Mon Nov 15 15:44:42 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/branches/Apple/whitney/utils/TableGen/CodeGenInstruction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/utils/TableGen/CodeGenInstruction.cpp?rev=119228&r1=119227&r2=119228&view=diff
==============================================================================
--- llvm/branches/Apple/whitney/utils/TableGen/CodeGenInstruction.cpp (original)
+++ llvm/branches/Apple/whitney/utils/TableGen/CodeGenInstruction.cpp Mon Nov 15 15:44:42 2010
@@ -382,3 +382,13 @@
return Res;
}
+
+//===----------------------------------------------------------------------===//
+/// CodeGenInstAlias Implementation
+//===----------------------------------------------------------------------===//
+
+CodeGenInstAlias::CodeGenInstAlias(Record *R) : TheDef(R), Operands(R) {
+ AsmString = R->getValueAsString("AsmString");
+
+
+}
Modified: llvm/branches/Apple/whitney/utils/TableGen/CodeGenInstruction.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/utils/TableGen/CodeGenInstruction.h?rev=119228&r1=119227&r2=119228&view=diff
==============================================================================
--- llvm/branches/Apple/whitney/utils/TableGen/CodeGenInstruction.h (original)
+++ llvm/branches/Apple/whitney/utils/TableGen/CodeGenInstruction.h Mon Nov 15 15:44:42 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-branch-commits
mailing list