[PATCH] Initialize object file info before output streamer

Nico Rieck nico.rieck at gmail.com
Mon Apr 15 14:03:22 PDT 2013


r179494 switched to using the object file info to retrieve the default text section for some MC streamers. When outputting an object file and the MCPureStreamer is used, this text section is requested before the object file info is initialized due to the enabled AutoInitSections flag of the streamer.

http://llvm-reviews.chandlerc.com/D674

Files:
  lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Index: lib/CodeGen/AsmPrinter/AsmPrinter.cpp
===================================================================
--- lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -150,15 +150,15 @@
 }
 
 bool AsmPrinter::doInitialization(Module &M) {
-  OutStreamer.InitStreamer();
-
   MMI = getAnalysisIfAvailable<MachineModuleInfo>();
   MMI->AnalyzeModule(M);
 
   // Initialize TargetLoweringObjectFile.
   const_cast<TargetLoweringObjectFile&>(getObjFileLowering())
     .Initialize(OutContext, TM);
 
+  OutStreamer.InitStreamer();
+
   Mang = new Mangler(OutContext, *TM.getDataLayout());
 
   // Allow the target to emit any magic that it wants at the start of the file.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D674.1.patch
Type: text/x-patch
Size: 701 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130415/500e91a0/attachment.bin>


More information about the llvm-commits mailing list