diff options
author | Nirav Dave <niravd@google.com> | 2018-04-27 15:45:54 +0000 |
---|---|---|
committer | Nirav Dave <niravd@google.com> | 2018-04-27 15:45:54 +0000 |
commit | 1b5533c9e848940570638f34d05106f1642dec2f (patch) | |
tree | 188d65c7e28b67a9bb3a68bfeea4005e136c4c38 /llvm/lib/CodeGen/LLVMTargetMachine.cpp | |
parent | 8728e097dfbec3630a1dd907431c0f14274a1ae8 (diff) | |
download | llvm-1b5533c9e848940570638f34d05106f1642dec2f.zip llvm-1b5533c9e848940570638f34d05106f1642dec2f.tar.gz llvm-1b5533c9e848940570638f34d05106f1642dec2f.tar.bz2 |
[MC] Modify MCAsmStreamer to always build MCAssembler. NFCI.
llvm-svn: 331048
Diffstat (limited to 'llvm/lib/CodeGen/LLVMTargetMachine.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LLVMTargetMachine.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/LLVMTargetMachine.cpp b/llvm/lib/CodeGen/LLVMTargetMachine.cpp index 6781b07..ee726c6 100644 --- a/llvm/lib/CodeGen/LLVMTargetMachine.cpp +++ b/llvm/lib/CodeGen/LLVMTargetMachine.cpp @@ -138,17 +138,17 @@ bool LLVMTargetMachine::addAsmPrinter(PassManagerBase &PM, getTargetTriple(), MAI.getAssemblerDialect(), MAI, MII, MRI); // Create a code emitter if asked to show the encoding. - MCCodeEmitter *MCE = nullptr; + std::unique_ptr<MCCodeEmitter> MCE; if (Options.MCOptions.ShowMCEncoding) - MCE = getTarget().createMCCodeEmitter(MII, MRI, Context); + MCE.reset(getTarget().createMCCodeEmitter(MII, MRI, Context)); - MCAsmBackend *MAB = - getTarget().createMCAsmBackend(STI, MRI, Options.MCOptions); + std::unique_ptr<MCAsmBackend> MAB( + getTarget().createMCAsmBackend(STI, MRI, Options.MCOptions)); auto FOut = llvm::make_unique<formatted_raw_ostream>(Out); MCStreamer *S = getTarget().createAsmStreamer( Context, std::move(FOut), Options.MCOptions.AsmVerbose, - Options.MCOptions.MCUseDwarfDirectory, InstPrinter, MCE, MAB, - Options.MCOptions.ShowMCInst); + Options.MCOptions.MCUseDwarfDirectory, InstPrinter, std::move(MCE), + std::move(MAB), Options.MCOptions.ShowMCInst); AsmStreamer.reset(S); break; } |