[llvm-commits] CVS: llvm/utils/TableGen/CodeEmitterGen.cpp
Misha Brukman
brukman at cs.uiuc.edu
Tue Aug 10 13:55:08 PDT 2004
Changes in directory llvm/utils/TableGen:
CodeEmitterGen.cpp updated: 1.35 -> 1.36
---
Log message:
Deleted commented-out code as we now get namespace directly, add comments
---
Diffs of the changes: (+3 -2)
Index: llvm/utils/TableGen/CodeEmitterGen.cpp
diff -u llvm/utils/TableGen/CodeEmitterGen.cpp:1.35 llvm/utils/TableGen/CodeEmitterGen.cpp:1.36
--- llvm/utils/TableGen/CodeEmitterGen.cpp:1.35 Tue Aug 10 13:31:01 2004
+++ llvm/utils/TableGen/CodeEmitterGen.cpp Tue Aug 10 15:54:58 2004
@@ -24,15 +24,16 @@
std::vector<Record*> Insts = Records.getAllDerivedDefinitions("Instruction");
EmitSourceFileHeader("Machine Code Emitter", o);
-
std::string Namespace = Insts[0]->getValueAsString("Namespace") + "::";
- //const std::string &Namespace = Inst->getValue("Namespace")->getName();
+ // Emit function declaration
o << "unsigned " << Target.getName() << "CodeEmitter::"
<< "getBinaryCodeForInstr(MachineInstr &MI) {\n"
<< " unsigned Value = 0;\n"
<< " DEBUG(std::cerr << MI);\n"
<< " switch (MI.getOpcode()) {\n";
+
+ // Emit a case statement for each opcode
for (std::vector<Record*>::iterator I = Insts.begin(), E = Insts.end();
I != E; ++I) {
Record *R = *I;
More information about the llvm-commits
mailing list