mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-04 21:31:03 +00:00
unique_ptrify the RelInfo parameter to TargetRegistry::createMCSymbolizer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226416 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e6e3b36975
commit
5f16ba708b
@ -62,9 +62,8 @@ namespace llvm {
|
|||||||
|
|
||||||
MCSymbolizer *createMCSymbolizer(StringRef TT, LLVMOpInfoCallback GetOpInfo,
|
MCSymbolizer *createMCSymbolizer(StringRef TT, LLVMOpInfoCallback GetOpInfo,
|
||||||
LLVMSymbolLookupCallback SymbolLookUp,
|
LLVMSymbolLookupCallback SymbolLookUp,
|
||||||
void *DisInfo,
|
void *DisInfo, MCContext *Ctx,
|
||||||
MCContext *Ctx,
|
std::unique_ptr<MCRelocationInfo> &&RelInfo);
|
||||||
MCRelocationInfo *RelInfo);
|
|
||||||
|
|
||||||
/// Target - Wrapper for Target specific information.
|
/// Target - Wrapper for Target specific information.
|
||||||
///
|
///
|
||||||
@ -142,12 +141,10 @@ namespace llvm {
|
|||||||
typedef MCStreamer *(*NullStreamerCtorTy)(MCContext &Ctx);
|
typedef MCStreamer *(*NullStreamerCtorTy)(MCContext &Ctx);
|
||||||
typedef MCRelocationInfo *(*MCRelocationInfoCtorTy)(StringRef TT,
|
typedef MCRelocationInfo *(*MCRelocationInfoCtorTy)(StringRef TT,
|
||||||
MCContext &Ctx);
|
MCContext &Ctx);
|
||||||
typedef MCSymbolizer *(*MCSymbolizerCtorTy)(StringRef TT,
|
typedef MCSymbolizer *(*MCSymbolizerCtorTy)(
|
||||||
LLVMOpInfoCallback GetOpInfo,
|
StringRef TT, LLVMOpInfoCallback GetOpInfo,
|
||||||
LLVMSymbolLookupCallback SymbolLookUp,
|
LLVMSymbolLookupCallback SymbolLookUp, void *DisInfo, MCContext *Ctx,
|
||||||
void *DisInfo,
|
std::unique_ptr<MCRelocationInfo> &&RelInfo);
|
||||||
MCContext *Ctx,
|
|
||||||
MCRelocationInfo *RelInfo);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/// Next - The next registered target in the linked list, maintained by the
|
/// Next - The next registered target in the linked list, maintained by the
|
||||||
@ -479,12 +476,12 @@ namespace llvm {
|
|||||||
/// \param RelInfo The relocation information for this target. Takes ownership.
|
/// \param RelInfo The relocation information for this target. Takes ownership.
|
||||||
MCSymbolizer *
|
MCSymbolizer *
|
||||||
createMCSymbolizer(StringRef TT, LLVMOpInfoCallback GetOpInfo,
|
createMCSymbolizer(StringRef TT, LLVMOpInfoCallback GetOpInfo,
|
||||||
LLVMSymbolLookupCallback SymbolLookUp,
|
LLVMSymbolLookupCallback SymbolLookUp, void *DisInfo,
|
||||||
void *DisInfo,
|
MCContext *Ctx,
|
||||||
MCContext *Ctx, MCRelocationInfo *RelInfo) const {
|
std::unique_ptr<MCRelocationInfo> &&RelInfo) const {
|
||||||
MCSymbolizerCtorTy Fn =
|
MCSymbolizerCtorTy Fn =
|
||||||
MCSymbolizerCtorFn ? MCSymbolizerCtorFn : llvm::createMCSymbolizer;
|
MCSymbolizerCtorFn ? MCSymbolizerCtorFn : llvm::createMCSymbolizer;
|
||||||
return Fn(TT, GetOpInfo, SymbolLookUp, DisInfo, Ctx, RelInfo);
|
return Fn(TT, GetOpInfo, SymbolLookUp, DisInfo, Ctx, std::move(RelInfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
@ -77,7 +77,7 @@ LLVMCreateDisasmCPUFeatures(const char *Triple, const char *CPU,
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
std::unique_ptr<MCSymbolizer> Symbolizer(TheTarget->createMCSymbolizer(
|
std::unique_ptr<MCSymbolizer> Symbolizer(TheTarget->createMCSymbolizer(
|
||||||
Triple, GetOpInfo, SymbolLookUp, DisInfo, Ctx, RelInfo.release()));
|
Triple, 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.
|
||||||
|
@ -186,13 +186,11 @@ void MCExternalSymbolizer::tryAddingPcLoadReferenceComment(raw_ostream &cStream,
|
|||||||
namespace llvm {
|
namespace llvm {
|
||||||
MCSymbolizer *createMCSymbolizer(StringRef TT, LLVMOpInfoCallback GetOpInfo,
|
MCSymbolizer *createMCSymbolizer(StringRef TT, LLVMOpInfoCallback GetOpInfo,
|
||||||
LLVMSymbolLookupCallback SymbolLookUp,
|
LLVMSymbolLookupCallback SymbolLookUp,
|
||||||
void *DisInfo,
|
void *DisInfo, MCContext *Ctx,
|
||||||
MCContext *Ctx,
|
std::unique_ptr<MCRelocationInfo> &&RelInfo) {
|
||||||
MCRelocationInfo *RelInfo) {
|
|
||||||
assert(Ctx && "No MCContext given for symbolic disassembly");
|
assert(Ctx && "No MCContext given for symbolic disassembly");
|
||||||
|
|
||||||
return new MCExternalSymbolizer(*Ctx,
|
return new MCExternalSymbolizer(*Ctx, std::move(RelInfo), GetOpInfo,
|
||||||
std::unique_ptr<MCRelocationInfo>(RelInfo),
|
SymbolLookUp, DisInfo);
|
||||||
GetOpInfo, SymbolLookUp, DisInfo);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -221,13 +221,11 @@ DecodeStatus AArch64Disassembler::getInstruction(MCInst &MI, uint64_t &Size,
|
|||||||
|
|
||||||
static MCSymbolizer *
|
static MCSymbolizer *
|
||||||
createAArch64ExternalSymbolizer(StringRef TT, LLVMOpInfoCallback GetOpInfo,
|
createAArch64ExternalSymbolizer(StringRef TT, LLVMOpInfoCallback GetOpInfo,
|
||||||
LLVMSymbolLookupCallback SymbolLookUp,
|
LLVMSymbolLookupCallback SymbolLookUp,
|
||||||
void *DisInfo, MCContext *Ctx,
|
void *DisInfo, MCContext *Ctx,
|
||||||
MCRelocationInfo *RelInfo) {
|
std::unique_ptr<MCRelocationInfo> &&RelInfo) {
|
||||||
return new llvm::AArch64ExternalSymbolizer(
|
return new llvm::AArch64ExternalSymbolizer(*Ctx, move(RelInfo), GetOpInfo,
|
||||||
*Ctx,
|
SymbolLookUp, DisInfo);
|
||||||
std::unique_ptr<MCRelocationInfo>(RelInfo),
|
|
||||||
GetOpInfo, SymbolLookUp, DisInfo);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" void LLVMInitializeAArch64Disassembler() {
|
extern "C" void LLVMInitializeAArch64Disassembler() {
|
||||||
|
@ -2172,7 +2172,7 @@ static void DisassembleMachO(StringRef Filename, MachOObjectFile *MachOOF) {
|
|||||||
if (RelInfo) {
|
if (RelInfo) {
|
||||||
Symbolizer.reset(TheTarget->createMCSymbolizer(
|
Symbolizer.reset(TheTarget->createMCSymbolizer(
|
||||||
TripleName, SymbolizerGetOpInfo, SymbolizerSymbolLookUp,
|
TripleName, SymbolizerGetOpInfo, SymbolizerSymbolLookUp,
|
||||||
&SymbolizerInfo, &Ctx, RelInfo.release()));
|
&SymbolizerInfo, &Ctx, std::move(RelInfo)));
|
||||||
DisAsm->setSymbolizer(std::move(Symbolizer));
|
DisAsm->setSymbolizer(std::move(Symbolizer));
|
||||||
}
|
}
|
||||||
int AsmPrinterVariant = AsmInfo->getAssemblerDialect();
|
int AsmPrinterVariant = AsmInfo->getAssemblerDialect();
|
||||||
@ -2220,7 +2220,7 @@ static void DisassembleMachO(StringRef Filename, MachOObjectFile *MachOOF) {
|
|||||||
if (ThumbRelInfo) {
|
if (ThumbRelInfo) {
|
||||||
ThumbSymbolizer.reset(ThumbTarget->createMCSymbolizer(
|
ThumbSymbolizer.reset(ThumbTarget->createMCSymbolizer(
|
||||||
ThumbTripleName, SymbolizerGetOpInfo, SymbolizerSymbolLookUp,
|
ThumbTripleName, SymbolizerGetOpInfo, SymbolizerSymbolLookUp,
|
||||||
&ThumbSymbolizerInfo, PtrThumbCtx, ThumbRelInfo.release()));
|
&ThumbSymbolizerInfo, PtrThumbCtx, std::move(ThumbRelInfo)));
|
||||||
ThumbDisAsm->setSymbolizer(std::move(ThumbSymbolizer));
|
ThumbDisAsm->setSymbolizer(std::move(ThumbSymbolizer));
|
||||||
}
|
}
|
||||||
int ThumbAsmPrinterVariant = ThumbAsmInfo->getAssemblerDialect();
|
int ThumbAsmPrinterVariant = ThumbAsmInfo->getAssemblerDialect();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user