summaryrefslogtreecommitdiff
path: root/support/tools/TableGen/InstrInfoEmitter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'support/tools/TableGen/InstrInfoEmitter.cpp')
-rw-r--r--support/tools/TableGen/InstrInfoEmitter.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/support/tools/TableGen/InstrInfoEmitter.cpp b/support/tools/TableGen/InstrInfoEmitter.cpp
index ad501dc426..c794cd0441 100644
--- a/support/tools/TableGen/InstrInfoEmitter.cpp
+++ b/support/tools/TableGen/InstrInfoEmitter.cpp
@@ -6,6 +6,7 @@
//===----------------------------------------------------------------------===//
#include "InstrInfoEmitter.h"
+#include "CodeGenWrappers.h"
#include "Record.h"
// runEnums - Print out enum values for all of the instructions.
@@ -23,9 +24,10 @@ void InstrInfoEmitter::runEnums(std::ostream &OS) {
OS << "namespace " << Namespace << " {\n";
OS << " enum {\n";
+ CodeGenTarget Target;
+
// We must emit the PHI opcode first...
- Record *Target = getTarget(Records);
- Record *InstrInfo = Target->getValueAsDef("InstructionSet");
+ Record *InstrInfo = Target.getInstructionSet();
Record *PHI = InstrInfo->getValueAsDef("PHIInst");
OS << " " << PHI->getName() << ", \t// 0 (fixed for all targets)\n";
@@ -55,9 +57,9 @@ void InstrInfoEmitter::printDefList(ListInit *LI, const std::string &Name,
// run - Emit the main instruction description records for the target...
void InstrInfoEmitter::run(std::ostream &OS) {
EmitSourceFileHeader("Target Instruction Descriptors", OS);
- Record *Target = getTarget(Records);
- const std::string &TargetName = Target->getName();
- Record *InstrInfo = Target->getValueAsDef("InstructionSet");
+ CodeGenTarget Target;
+ const std::string &TargetName = Target.getName();
+ Record *InstrInfo = Target.getInstructionSet();
Record *PHI = InstrInfo->getValueAsDef("PHIInst");
std::vector<Record*> Instructions =