diff options
author | Lang Hames <lhames@gmail.com> | 2015-04-24 19:11:51 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2015-04-24 19:11:51 +0000 |
commit | 9ff69c8f4de60cfe4d832247a720b936183c08e5 (patch) | |
tree | 187affe30650a751b2e08d5a95b16963d819ef13 /llvm/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp | |
parent | b597408da49548c0a971d548132eb80b01ce58b0 (diff) | |
download | bcm5719-llvm-9ff69c8f4de60cfe4d832247a720b936183c08e5.tar.gz bcm5719-llvm-9ff69c8f4de60cfe4d832247a720b936183c08e5.zip |
[AsmPrinter] Make AsmPrinter's OutStreamer member a unique_ptr.
AsmPrinter owns the OutStreamer, so an owning pointer makes sense here. Using a
reference for this is crufty.
llvm-svn: 235752
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp index 76d6a065815..c49e7a1b799 100644 --- a/llvm/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp @@ -62,16 +62,16 @@ static void EmitCamlGlobal(const Module &M, AsmPrinter &AP, const char *Id) { MCSymbol *Sym = AP.OutContext.GetOrCreateSymbol(TmpStr); - AP.OutStreamer.EmitSymbolAttribute(Sym, MCSA_Global); - AP.OutStreamer.EmitLabel(Sym); + AP.OutStreamer->EmitSymbolAttribute(Sym, MCSA_Global); + AP.OutStreamer->EmitLabel(Sym); } void OcamlGCMetadataPrinter::beginAssembly(Module &M, GCModuleInfo &Info, AsmPrinter &AP) { - AP.OutStreamer.SwitchSection(AP.getObjFileLowering().getTextSection()); + AP.OutStreamer->SwitchSection(AP.getObjFileLowering().getTextSection()); EmitCamlGlobal(M, AP, "code_begin"); - AP.OutStreamer.SwitchSection(AP.getObjFileLowering().getDataSection()); + AP.OutStreamer->SwitchSection(AP.getObjFileLowering().getDataSection()); EmitCamlGlobal(M, AP, "data_begin"); } @@ -95,16 +95,16 @@ void OcamlGCMetadataPrinter::finishAssembly(Module &M, GCModuleInfo &Info, AsmPrinter &AP) { unsigned IntPtrSize = AP.TM.getDataLayout()->getPointerSize(); - AP.OutStreamer.SwitchSection(AP.getObjFileLowering().getTextSection()); + AP.OutStreamer->SwitchSection(AP.getObjFileLowering().getTextSection()); EmitCamlGlobal(M, AP, "code_end"); - AP.OutStreamer.SwitchSection(AP.getObjFileLowering().getDataSection()); + AP.OutStreamer->SwitchSection(AP.getObjFileLowering().getDataSection()); EmitCamlGlobal(M, AP, "data_end"); // FIXME: Why does ocaml emit this?? - AP.OutStreamer.EmitIntValue(0, IntPtrSize); + AP.OutStreamer->EmitIntValue(0, IntPtrSize); - AP.OutStreamer.SwitchSection(AP.getObjFileLowering().getDataSection()); + AP.OutStreamer->SwitchSection(AP.getObjFileLowering().getDataSection()); EmitCamlGlobal(M, AP, "frametable"); int NumDescriptors = 0; @@ -146,9 +146,9 @@ void OcamlGCMetadataPrinter::finishAssembly(Module &M, GCModuleInfo &Info, Twine(uintptr_t(&FI)) + ")"); } - AP.OutStreamer.AddComment("live roots for " + - Twine(FI.getFunction().getName())); - AP.OutStreamer.AddBlankLine(); + AP.OutStreamer->AddComment("live roots for " + + Twine(FI.getFunction().getName())); + AP.OutStreamer->AddBlankLine(); for (GCFunctionInfo::iterator J = FI.begin(), JE = FI.end(); J != JE; ++J) { size_t LiveCount = FI.live_size(J); @@ -160,7 +160,7 @@ void OcamlGCMetadataPrinter::finishAssembly(Module &M, GCModuleInfo &Info, Twine(LiveCount) + " >= 65536."); } - AP.OutStreamer.EmitSymbolValue(J->Label, IntPtrSize); + AP.OutStreamer->EmitSymbolValue(J->Label, IntPtrSize); AP.EmitInt16(FrameSize); AP.EmitInt16(LiveCount); |