Follow up of the introduction of MCSymbolizer.

- Ressurect old MCDisassemble API to soften transition.
- Extend MCTargetDesc to set target specific symbolizer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182688 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Quentin Colombet
2013-05-24 22:51:52 +00:00
parent fce7b6b5d9
commit de7cbbfcce
8 changed files with 116 additions and 19 deletions

View File

@@ -212,12 +212,13 @@ static MCInstPrinter *createARMMCInstPrinter(const Target &T,
return 0;
}
static MCRelocationInfo *createMCRelocationInfo(StringRef TT, MCContext &Ctx) {
static MCRelocationInfo *createARMMCRelocationInfo(StringRef TT,
MCContext &Ctx) {
Triple TheTriple(TT);
if (TheTriple.isEnvironmentMachO())
return createARMMachORelocationInfo(Ctx);
// Default to the stock relocation info.
return llvm::createMCRelocationInfo(Ctx);
return llvm::createMCRelocationInfo(TT, Ctx);
}
namespace {
@@ -307,7 +308,7 @@ extern "C" void LLVMInitializeARMTargetMC() {
// Register the MC relocation info.
TargetRegistry::RegisterMCRelocationInfo(TheARMTarget,
createMCRelocationInfo);
createARMMCRelocationInfo);
TargetRegistry::RegisterMCRelocationInfo(TheThumbTarget,
createMCRelocationInfo);
createARMMCRelocationInfo);
}

View File

@@ -384,14 +384,15 @@ static MCInstPrinter *createX86MCInstPrinter(const Target &T,
return 0;
}
static MCRelocationInfo *createMCRelocationInfo(StringRef TT, MCContext &Ctx) {
static MCRelocationInfo *createX86MCRelocationInfo(StringRef TT,
MCContext &Ctx) {
Triple TheTriple(TT);
if (TheTriple.isEnvironmentMachO() && TheTriple.getArch() == Triple::x86_64)
return createX86_64MachORelocationInfo(Ctx);
else if (TheTriple.isOSBinFormatELF())
return createX86_64ELFRelocationInfo(Ctx);
// Default to the stock relocation info.
return llvm::createMCRelocationInfo(Ctx);
return llvm::createMCRelocationInfo(TT, Ctx);
}
static MCInstrAnalysis *createX86MCInstrAnalysis(const MCInstrInfo *Info) {
@@ -454,7 +455,7 @@ extern "C" void LLVMInitializeX86TargetMC() {
// Register the MC relocation info.
TargetRegistry::RegisterMCRelocationInfo(TheX86_32Target,
createMCRelocationInfo);
createX86MCRelocationInfo);
TargetRegistry::RegisterMCRelocationInfo(TheX86_64Target,
createMCRelocationInfo);
createX86MCRelocationInfo);
}