summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCMachOStreamer.cpp
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2017-10-11 23:34:47 +0000
committerLang Hames <lhames@gmail.com>2017-10-11 23:34:47 +0000
commit2241ffa43cee14361757e9dbdee01161030d1656 (patch)
tree5c45b1e1a054f4ed236085ece5cc97200b5dc230 /llvm/lib/MC/MCMachOStreamer.cpp
parent337462b36512cc001891a98fb98fa5693651722f (diff)
downloadbcm5719-llvm-2241ffa43cee14361757e9dbdee01161030d1656.tar.gz
bcm5719-llvm-2241ffa43cee14361757e9dbdee01161030d1656.zip
[MC] Have MCObjectStreamer take its MCAsmBackend argument via unique_ptr.
MCObjectStreamer owns its MCCodeEmitter -- this fixes the types to reflect that, and allows us to remove the last instance of MCObjectStreamer's weird "holding ownership via someone else's reference" trick. llvm-svn: 315531
Diffstat (limited to 'llvm/lib/MC/MCMachOStreamer.cpp')
-rw-r--r--llvm/lib/MC/MCMachOStreamer.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/MC/MCMachOStreamer.cpp b/llvm/lib/MC/MCMachOStreamer.cpp
index 293b87d4177..a5c1b13df7c 100644
--- a/llvm/lib/MC/MCMachOStreamer.cpp
+++ b/llvm/lib/MC/MCMachOStreamer.cpp
@@ -63,9 +63,9 @@ private:
public:
MCMachOStreamer(MCContext &Context, std::unique_ptr<MCAsmBackend> MAB,
- raw_pwrite_stream &OS, MCCodeEmitter *Emitter,
+ raw_pwrite_stream &OS, std::unique_ptr<MCCodeEmitter> Emitter,
bool DWARFMustBeAtTheEnd, bool label)
- : MCObjectStreamer(Context, std::move(MAB), OS, Emitter),
+ : MCObjectStreamer(Context, std::move(MAB), OS, std::move(Emitter)),
LabelSections(label), DWARFMustBeAtTheEnd(DWARFMustBeAtTheEnd),
CreatedADWARFSection(false) {}
@@ -487,11 +487,13 @@ void MCMachOStreamer::FinishImpl() {
MCStreamer *llvm::createMachOStreamer(MCContext &Context,
std::unique_ptr<MCAsmBackend> &&MAB,
- raw_pwrite_stream &OS, MCCodeEmitter *CE,
+ raw_pwrite_stream &OS,
+ std::unique_ptr<MCCodeEmitter> &&CE,
bool RelaxAll, bool DWARFMustBeAtTheEnd,
bool LabelSections) {
- MCMachOStreamer *S = new MCMachOStreamer(Context, std::move(MAB), OS, CE,
- DWARFMustBeAtTheEnd, LabelSections);
+ MCMachOStreamer *S =
+ new MCMachOStreamer(Context, std::move(MAB), OS, std::move(CE),
+ DWARFMustBeAtTheEnd, LabelSections);
const Triple &TT = Context.getObjectFileInfo()->getTargetTriple();
if (TT.isOSDarwin()) {
unsigned Major, Minor, Update;
OpenPOWER on IntegriCloud