Deleted commented-out code as we now get namespace directly, add comments

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15627 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Misha Brukman 2004-08-10 20:54:58 +00:00
parent b64af918cb
commit ad346ad170

View File

@ -24,15 +24,16 @@ void CodeEmitterGen::run(std::ostream &o) {
std::vector<Record*> Insts = Records.getAllDerivedDefinitions("Instruction"); std::vector<Record*> Insts = Records.getAllDerivedDefinitions("Instruction");
EmitSourceFileHeader("Machine Code Emitter", o); EmitSourceFileHeader("Machine Code Emitter", o);
std::string Namespace = Insts[0]->getValueAsString("Namespace") + "::"; std::string Namespace = Insts[0]->getValueAsString("Namespace") + "::";
//const std::string &Namespace = Inst->getValue("Namespace")->getName(); // Emit function declaration
o << "unsigned " << Target.getName() << "CodeEmitter::" o << "unsigned " << Target.getName() << "CodeEmitter::"
<< "getBinaryCodeForInstr(MachineInstr &MI) {\n" << "getBinaryCodeForInstr(MachineInstr &MI) {\n"
<< " unsigned Value = 0;\n" << " unsigned Value = 0;\n"
<< " DEBUG(std::cerr << MI);\n" << " DEBUG(std::cerr << MI);\n"
<< " switch (MI.getOpcode()) {\n"; << " switch (MI.getOpcode()) {\n";
// Emit a case statement for each opcode
for (std::vector<Record*>::iterator I = Insts.begin(), E = Insts.end(); for (std::vector<Record*>::iterator I = Insts.begin(), E = Insts.end();
I != E; ++I) { I != E; ++I) {
Record *R = *I; Record *R = *I;