Tidy up a bit.
authorJim Grosbach <grosbach@apple.com>
Thu, 3 Feb 2011 23:26:36 +0000 (23:26 +0000)
committerJim Grosbach <grosbach@apple.com>
Thu, 3 Feb 2011 23:26:36 +0000 (23:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124832 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/CodeEmitterGen.cpp

index 511d83deb1e20e8236ecbf0b78b0864bdd76bfde..957dd19da1c24f790192baef1fd584d6beacf3fa 100644 (file)
@@ -206,7 +206,6 @@ void CodeEmitterGen::run(raw_ostream &o) {
   if (Target.isLittleEndianEncoding()) reverseBits(Insts);
 
   EmitSourceFileHeader("Machine Code Emitter", o);
-  std::string Namespace = Insts[0]->getValueAsString("Namespace") + "::";
 
   const std::vector<const CodeGenInstruction*> &NumberedInstructions =
     Target.getInstructionsByEnumValue();
@@ -254,7 +253,8 @@ void CodeEmitterGen::run(raw_ostream &o) {
     Record *R = *IC;
     if (R->getValueAsString("Namespace") == "TargetOpcode")
       continue;
-    const std::string &InstName = R->getName();
+    const std::string &InstName = R->getValueAsString("Namespace") + "::"
+      + R->getName();
     std::string Case = getInstructionCase(R, Target);
 
     CaseMap[Case].push_back(InstName);
@@ -275,7 +275,7 @@ void CodeEmitterGen::run(raw_ostream &o) {
 
     for (int i = 0, N = InstList.size(); i < N; i++) {
       if (i) o << "\n";
-      o << "    case " << Namespace << InstList[i]  << ":";
+      o << "    case " << InstList[i]  << ":";
     }
     o << " {\n";
     o << Case;