[llvm] r185670 - Initialize object file info before output streamer

Nico Rieck nico.rieck at gmail.com
Thu Jul 4 14:37:26 PDT 2013


Author: nrieck
Date: Thu Jul  4 16:37:26 2013
New Revision: 185670

URL: http://llvm.org/viewvc/llvm-project?rev=185670&view=rev
Log:
Initialize object file info before output streamer

r179494 switched to using the object file info to retrieve the default text
section for some MC streamers. It is possible that initializing an MC
streamer can request sections before the object file info is initialized
when the AutoInitSections flag is set on the streamer.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=185670&r1=185669&r2=185670&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Thu Jul  4 16:37:26 2013
@@ -155,8 +155,6 @@ void AsmPrinter::getAnalysisUsage(Analys
 }
 
 bool AsmPrinter::doInitialization(Module &M) {
-  OutStreamer.InitStreamer();
-
   MMI = getAnalysisIfAvailable<MachineModuleInfo>();
   MMI->AnalyzeModule(M);
 
@@ -164,6 +162,8 @@ bool AsmPrinter::doInitialization(Module
   const_cast<TargetLoweringObjectFile&>(getObjFileLowering())
     .Initialize(OutContext, TM);
 
+  OutStreamer.InitStreamer();
+
   Mang = new Mangler(OutContext, &TM);
 
   // Allow the target to emit any magic that it wants at the start of the file.





More information about the llvm-commits mailing list