summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCDisassembler/Disassembler.h
diff options
context:
space:
mode:
authorScott Linder <scott@scottlinder.com>2019-06-26 16:13:17 +0000
committerScott Linder <scott@scottlinder.com>2019-06-26 16:13:17 +0000
commitc95046501dc2cb535a82c38a5c004a6eddd33e00 (patch)
treec0a99715c2e4daba678f37255490b66fc0bedb6c /llvm/lib/MC/MCDisassembler/Disassembler.h
parentc8232e4310751ffa9fe506c1f6c11cbaa02b4621 (diff)
downloadbcm5719-llvm-c95046501dc2cb535a82c38a5c004a6eddd33e00.tar.gz
bcm5719-llvm-c95046501dc2cb535a82c38a5c004a6eddd33e00.zip
Fix leaks in LLVMCreateDisasmCPUFeatures
Differential Revision: https://reviews.llvm.org/D63795 llvm-svn: 364444
Diffstat (limited to 'llvm/lib/MC/MCDisassembler/Disassembler.h')
-rw-r--r--llvm/lib/MC/MCDisassembler/Disassembler.h34
1 files changed, 16 insertions, 18 deletions
diff --git a/llvm/lib/MC/MCDisassembler/Disassembler.h b/llvm/lib/MC/MCDisassembler/Disassembler.h
index d3a2dbb6da5..e5aab53a761 100644
--- a/llvm/lib/MC/MCDisassembler/Disassembler.h
+++ b/llvm/lib/MC/MCDisassembler/Disassembler.h
@@ -82,24 +82,22 @@ public:
SmallString<128> CommentsToEmit;
raw_svector_ostream CommentStream;
- LLVMDisasmContext(std::string tripleName, void *disInfo, int tagType,
- LLVMOpInfoCallback getOpInfo,
- LLVMSymbolLookupCallback symbolLookUp,
- const Target *theTarget, const MCAsmInfo *mAI,
- const MCRegisterInfo *mRI, const MCSubtargetInfo *mSI,
- const MCInstrInfo *mII, llvm::MCContext *ctx,
- const MCDisassembler *disAsm, MCInstPrinter *iP)
- : TripleName(std::move(tripleName)), DisInfo(disInfo), TagType(tagType),
- GetOpInfo(getOpInfo), SymbolLookUp(symbolLookUp), TheTarget(theTarget),
- Options(0), CommentStream(CommentsToEmit) {
- MAI.reset(mAI);
- MRI.reset(mRI);
- MSI.reset(mSI);
- MII.reset(mII);
- Ctx.reset(ctx);
- DisAsm.reset(disAsm);
- IP.reset(iP);
- }
+ LLVMDisasmContext(std::string TripleName, void *DisInfo, int TagType,
+ LLVMOpInfoCallback GetOpInfo,
+ LLVMSymbolLookupCallback SymbolLookUp,
+ const Target *TheTarget,
+ std::unique_ptr<const MCAsmInfo> &&MAI,
+ std::unique_ptr<const MCRegisterInfo> &&MRI,
+ std::unique_ptr<const MCSubtargetInfo> &&MSI,
+ std::unique_ptr<const MCInstrInfo> &&MII,
+ std::unique_ptr<const llvm::MCContext> &&Ctx,
+ std::unique_ptr<const MCDisassembler> &&DisAsm,
+ std::unique_ptr<MCInstPrinter> &&IP)
+ : TripleName(std::move(TripleName)), DisInfo(DisInfo), TagType(TagType),
+ GetOpInfo(GetOpInfo), SymbolLookUp(SymbolLookUp), TheTarget(TheTarget),
+ MAI(std::move(MAI)), MRI(std::move(MRI)), MSI(std::move(MSI)),
+ MII(std::move(MII)), Ctx(std::move(Ctx)), DisAsm(std::move(DisAsm)),
+ IP(std::move(IP)), Options(0), CommentStream(CommentsToEmit) {}
const std::string &getTripleName() const { return TripleName; }
void *getDisInfo() const { return DisInfo; }
int getTagType() const { return TagType; }
OpenPOWER on IntegriCloud