Fixed a nasty layering violation in the edis source
[oota-llvm.git] / utils / TableGen / AsmWriterEmitter.cpp
index 9378343cec78843c5ab575faea7012f43ca92f26..1e95467a3b2cf8eb90983ed0f233de82420b2b8a 100644 (file)
@@ -248,16 +248,16 @@ void AsmWriterEmitter::EmitPrintInstruction(raw_ostream &O) {
   "/// printInstruction - This method is automatically generated by tablegen\n"
   "/// from the instruction set description.\n"
     "void " << Target.getName() << ClassName
-            << "::printInstruction(const MachineInstr *MI) {\n";
+            << "::printInstruction(const MachineInstr *MI, raw_ostream &O) {\n";
 
   std::vector<AsmWriterInst> Instructions;
 
   for (CodeGenTarget::inst_iterator I = Target.inst_begin(),
          E = Target.inst_end(); I != E; ++I)
-    if (!I->second.AsmString.empty() &&
-        I->second.TheDef->getName() != "PHI")
+    if (!(*I)->AsmString.empty() &&
+        (*I)->TheDef->getName() != "PHI")
       Instructions.push_back(
-        AsmWriterInst(I->second
+        AsmWriterInst(**I
                       AsmWriter->getValueAsInt("Variant"),
                       AsmWriter->getValueAsInt("FirstOperandColumn"),
                       AsmWriter->getValueAsInt("OperandSpacing")));