Rename const char *Triple argument to TT to avoid shadowing llvm::Triple.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233615 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Christopher 2015-03-30 22:31:14 +00:00
parent 8225e356af
commit 910e36d7bc

View File

@ -33,22 +33,22 @@ using namespace llvm;
// disassembler context. If not, it returns NULL. // disassembler context. If not, it returns NULL.
// //
LLVMDisasmContextRef LLVMDisasmContextRef
LLVMCreateDisasmCPUFeatures(const char *Triple, const char *CPU, LLVMCreateDisasmCPUFeatures(const char *TT, const char *CPU,
const char *Features, void *DisInfo, int TagType, const char *Features, void *DisInfo, int TagType,
LLVMOpInfoCallback GetOpInfo, LLVMOpInfoCallback GetOpInfo,
LLVMSymbolLookupCallback SymbolLookUp) { LLVMSymbolLookupCallback SymbolLookUp) {
// Get the target. // Get the target.
std::string Error; std::string Error;
const Target *TheTarget = TargetRegistry::lookupTarget(Triple, Error); const Target *TheTarget = TargetRegistry::lookupTarget(TT, Error);
if (!TheTarget) if (!TheTarget)
return nullptr; return nullptr;
const MCRegisterInfo *MRI = TheTarget->createMCRegInfo(Triple); const MCRegisterInfo *MRI = TheTarget->createMCRegInfo(TT);
if (!MRI) if (!MRI)
return nullptr; return nullptr;
// Get the assembler info needed to setup the MCContext. // Get the assembler info needed to setup the MCContext.
const MCAsmInfo *MAI = TheTarget->createMCAsmInfo(*MRI, Triple); const MCAsmInfo *MAI = TheTarget->createMCAsmInfo(*MRI, TT);
if (!MAI) if (!MAI)
return nullptr; return nullptr;
@ -56,8 +56,8 @@ LLVMCreateDisasmCPUFeatures(const char *Triple, const char *CPU,
if (!MII) if (!MII)
return nullptr; return nullptr;
const MCSubtargetInfo *STI = TheTarget->createMCSubtargetInfo(Triple, CPU, const MCSubtargetInfo *STI =
Features); TheTarget->createMCSubtargetInfo(TT, CPU, Features);
if (!STI) if (!STI)
return nullptr; return nullptr;
@ -72,12 +72,12 @@ LLVMCreateDisasmCPUFeatures(const char *Triple, const char *CPU,
return nullptr; return nullptr;
std::unique_ptr<MCRelocationInfo> RelInfo( std::unique_ptr<MCRelocationInfo> RelInfo(
TheTarget->createMCRelocationInfo(Triple, *Ctx)); TheTarget->createMCRelocationInfo(TT, *Ctx));
if (!RelInfo) if (!RelInfo)
return nullptr; return nullptr;
std::unique_ptr<MCSymbolizer> Symbolizer(TheTarget->createMCSymbolizer( std::unique_ptr<MCSymbolizer> Symbolizer(TheTarget->createMCSymbolizer(
Triple, GetOpInfo, SymbolLookUp, DisInfo, Ctx, std::move(RelInfo))); TT, GetOpInfo, SymbolLookUp, DisInfo, Ctx, std::move(RelInfo)));
DisAsm->setSymbolizer(std::move(Symbolizer)); DisAsm->setSymbolizer(std::move(Symbolizer));
// Set up the instruction printer. // Set up the instruction printer.
@ -87,10 +87,9 @@ LLVMCreateDisasmCPUFeatures(const char *Triple, const char *CPU,
if (!IP) if (!IP)
return nullptr; return nullptr;
LLVMDisasmContext *DC = new LLVMDisasmContext(Triple, DisInfo, TagType, LLVMDisasmContext *DC =
GetOpInfo, SymbolLookUp, new LLVMDisasmContext(TT, DisInfo, TagType, GetOpInfo, SymbolLookUp,
TheTarget, MAI, MRI, TheTarget, MAI, MRI, STI, MII, Ctx, DisAsm, IP);
STI, MII, Ctx, DisAsm, IP);
if (!DC) if (!DC)
return nullptr; return nullptr;
@ -98,19 +97,19 @@ LLVMCreateDisasmCPUFeatures(const char *Triple, const char *CPU,
return DC; return DC;
} }
LLVMDisasmContextRef LLVMCreateDisasmCPU(const char *Triple, const char *CPU, LLVMDisasmContextRef
void *DisInfo, int TagType, LLVMCreateDisasmCPU(const char *TT, const char *CPU, void *DisInfo, int TagType,
LLVMOpInfoCallback GetOpInfo, LLVMOpInfoCallback GetOpInfo,
LLVMSymbolLookupCallback SymbolLookUp){ LLVMSymbolLookupCallback SymbolLookUp) {
return LLVMCreateDisasmCPUFeatures(Triple, CPU, "", DisInfo, TagType, return LLVMCreateDisasmCPUFeatures(TT, CPU, "", DisInfo, TagType, GetOpInfo,
GetOpInfo, SymbolLookUp); SymbolLookUp);
} }
LLVMDisasmContextRef LLVMCreateDisasm(const char *Triple, void *DisInfo, LLVMDisasmContextRef LLVMCreateDisasm(const char *TT, void *DisInfo,
int TagType, LLVMOpInfoCallback GetOpInfo, int TagType, LLVMOpInfoCallback GetOpInfo,
LLVMSymbolLookupCallback SymbolLookUp) { LLVMSymbolLookupCallback SymbolLookUp) {
return LLVMCreateDisasmCPUFeatures(Triple, "", "", DisInfo, TagType, return LLVMCreateDisasmCPUFeatures(TT, "", "", DisInfo, TagType, GetOpInfo,
GetOpInfo, SymbolLookUp); SymbolLookUp);
} }
// //