Add MCInstrAnalysis class. This allows the targets to specify own versions of MCInstrDescs functions.

- Add overrides for ARM.
- Teach llvm-objdump to use this instead of plain MCInstrDesc.

llvm-svn: 137059
This commit is contained in:
Benjamin Kramer
2011-08-08 18:56:44 +00:00
parent 4c0423bc8f
commit c22d50e5c3
7 changed files with 176 additions and 31 deletions

View File

@@ -165,6 +165,8 @@ static void DisassembleInput(const StringRef &Filename) {
return;
}
const MCInstrInfo *InstrInfo = TheTarget->createMCInstrInfo();
OwningPtr<MCInstrAnalysis>
InstrAnalysis(TheTarget->createMCInstrAnalysis(InstrInfo));
outs() << '\n';
outs() << Filename
@@ -270,8 +272,8 @@ static void DisassembleInput(const StringRef &Filename) {
// Create CFG and use it for disassembly.
MCFunction f =
MCFunction::createFunctionFromMC(Symbols[si].second, DisAsm.get(),
memoryObject, Start, End, InstrInfo,
DebugOut);
memoryObject, Start, End,
InstrAnalysis.get(), DebugOut);
for (MCFunction::iterator fi = f.begin(), fe = f.end(); fi != fe; ++fi){
bool hasPreds = false;