When in non-raw mode and edis fails to parse the tokens of the instruction, output

the raw disassembly so that the opcode aligns with the edis'ed disassembly.

llvm-svn: 131773
This commit is contained in:
Johnny Chen 2011-05-21 00:44:42 +00:00
parent 54254008ba
commit e7faaa6688
1 changed files with 10 additions and 1 deletions

View File

@ -369,7 +369,16 @@ InstructionLLVM::Dump
if (EDGetInstString(&str, m_inst)) // 0 on success
return;
s->Write(str, strlen(str) - 1);
if (raw)
s->Write(str, strlen(str) - 1);
else
{
// EDis fails to parse the tokens of this inst. Need to align this
// raw disassembly with the rest of output.
llvm::StringRef raw_disasm(str);
StripSpaces(raw_disasm);
s->PutCString(raw_disasm.str().c_str());
}
}
}