diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2018-05-18 18:26:45 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2018-05-18 18:26:45 +0000 |
commit | f7b81db7157cf424db8da07351df9528a032567e (patch) | |
tree | 443c4df3a91c22974850b90cb853b2045a239a8c /llvm/lib/CodeGen/LLVMTargetMachine.cpp | |
parent | e5ed563cc57f69b3f6a5bd242d8ff029dee3f271 (diff) | |
download | llvm-f7b81db7157cf424db8da07351df9528a032567e.zip llvm-f7b81db7157cf424db8da07351df9528a032567e.tar.gz llvm-f7b81db7157cf424db8da07351df9528a032567e.tar.bz2 |
MC: Change the streamer ctors to take an object writer instead of a stream. NFCI.
The idea is that a client that wants split dwarf would create a
specific kind of object writer that creates two files, and use it to
create the streamer.
Part of PR37466.
Differential Revision: https://reviews.llvm.org/D47050
llvm-svn: 332749
Diffstat (limited to 'llvm/lib/CodeGen/LLVMTargetMachine.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LLVMTargetMachine.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/LLVMTargetMachine.cpp b/llvm/lib/CodeGen/LLVMTargetMachine.cpp index ee726c6..27b1d96 100644 --- a/llvm/lib/CodeGen/LLVMTargetMachine.cpp +++ b/llvm/lib/CodeGen/LLVMTargetMachine.cpp @@ -23,6 +23,7 @@ #include "llvm/MC/MCCodeEmitter.h" #include "llvm/MC/MCContext.h" #include "llvm/MC/MCInstrInfo.h" +#include "llvm/MC/MCObjectWriter.h" #include "llvm/MC/MCStreamer.h" #include "llvm/MC/MCSubtargetInfo.h" #include "llvm/Support/CommandLine.h" @@ -166,8 +167,9 @@ bool LLVMTargetMachine::addAsmPrinter(PassManagerBase &PM, Triple T(getTargetTriple().str()); AsmStreamer.reset(getTarget().createMCObjectStreamer( - T, Context, std::unique_ptr<MCAsmBackend>(MAB), Out, - std::unique_ptr<MCCodeEmitter>(MCE), STI, Options.MCOptions.MCRelaxAll, + T, Context, std::unique_ptr<MCAsmBackend>(MAB), + MAB->createObjectWriter(Out), std::unique_ptr<MCCodeEmitter>(MCE), STI, + Options.MCOptions.MCRelaxAll, Options.MCOptions.MCIncrementalLinkerCompatible, /*DWARFMustBeAtTheEnd*/ true)); break; @@ -241,7 +243,7 @@ bool LLVMTargetMachine::addPassesToEmitMC(PassManagerBase &PM, MCContext *&Ctx, const Triple &T = getTargetTriple(); std::unique_ptr<MCStreamer> AsmStreamer(getTarget().createMCObjectStreamer( - T, *Ctx, std::unique_ptr<MCAsmBackend>(MAB), Out, + T, *Ctx, std::unique_ptr<MCAsmBackend>(MAB), MAB->createObjectWriter(Out), std::unique_ptr<MCCodeEmitter>(MCE), STI, Options.MCOptions.MCRelaxAll, Options.MCOptions.MCIncrementalLinkerCompatible, /*DWARFMustBeAtTheEnd*/ true)); |