diff options
author | Nico Rieck <nico.rieck@gmail.com> | 2013-07-04 21:37:26 +0000 |
---|---|---|
committer | Nico Rieck <nico.rieck@gmail.com> | 2013-07-04 21:37:26 +0000 |
commit | 25746ddd66651bdad159444d0331b7df4dc22842 (patch) | |
tree | b47effac33e3e7be70cef83968954b79b42b76f9 | |
parent | a6d343a688073664b3a80aa117e0d3cbecf28014 (diff) | |
download | external_llvm-25746ddd66651bdad159444d0331b7df4dc22842.tar.gz external_llvm-25746ddd66651bdad159444d0331b7df4dc22842.tar.bz2 external_llvm-25746ddd66651bdad159444d0331b7df4dc22842.zip |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185670 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index f9fe44196d..52e52b4162 100644 --- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -155,8 +155,6 @@ void AsmPrinter::getAnalysisUsage(AnalysisUsage &AU) const { } bool AsmPrinter::doInitialization(Module &M) { - OutStreamer.InitStreamer(); - MMI = getAnalysisIfAvailable<MachineModuleInfo>(); MMI->AnalyzeModule(M); @@ -164,6 +162,8 @@ bool AsmPrinter::doInitialization(Module &M) { 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. |