[llvm-commits] CVS: llvm/utils/TableGen/CodeEmitterGen.cpp
Misha Brukman
brukman at cs.uiuc.edu
Tue Aug 10 11:31:12 PDT 2004
Changes in directory llvm/utils/TableGen:
CodeEmitterGen.cpp updated: 1.34 -> 1.35
---
Log message:
Use the target name instead of hard-coding SparcV9.
---
Diffs of the changes: (+3 -3)
Index: llvm/utils/TableGen/CodeEmitterGen.cpp
diff -u llvm/utils/TableGen/CodeEmitterGen.cpp:1.34 llvm/utils/TableGen/CodeEmitterGen.cpp:1.35
--- llvm/utils/TableGen/CodeEmitterGen.cpp:1.34 Tue Aug 10 10:05:18 2004
+++ llvm/utils/TableGen/CodeEmitterGen.cpp Tue Aug 10 13:31:01 2004
@@ -20,15 +20,15 @@
using namespace llvm;
void CodeEmitterGen::run(std::ostream &o) {
+ CodeGenTarget Target;
std::vector<Record*> Insts = Records.getAllDerivedDefinitions("Instruction");
EmitSourceFileHeader("Machine Code Emitter", o);
- std::string Namespace = "V9::";
- std::string ClassName = "SparcV9CodeEmitter::";
+ std::string Namespace = Insts[0]->getValueAsString("Namespace") + "::";
//const std::string &Namespace = Inst->getValue("Namespace")->getName();
- o << "unsigned " << ClassName
+ o << "unsigned " << Target.getName() << "CodeEmitter::"
<< "getBinaryCodeForInstr(MachineInstr &MI) {\n"
<< " unsigned Value = 0;\n"
<< " DEBUG(std::cerr << MI);\n"
More information about the llvm-commits
mailing list