From ad346ad17058d9e1463ab1fe5bfa78444e5d3e9c Mon Sep 17 00:00:00 2001 From: Misha Brukman Date: Tue, 10 Aug 2004 20:54:58 +0000 Subject: [PATCH] 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 --- utils/TableGen/CodeEmitterGen.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/utils/TableGen/CodeEmitterGen.cpp b/utils/TableGen/CodeEmitterGen.cpp index b2c51381406..689465cbf80 100644 --- a/utils/TableGen/CodeEmitterGen.cpp +++ b/utils/TableGen/CodeEmitterGen.cpp @@ -24,15 +24,16 @@ void CodeEmitterGen::run(std::ostream &o) { std::vector 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::iterator I = Insts.begin(), E = Insts.end(); I != E; ++I) { Record *R = *I; -- 2.34.1