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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137059 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer
2011-08-08 18:56:44 +00:00
parent c13464f3c1
commit 41ab14b725
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;