summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
diff options
context:
space:
mode:
authorNico Rieck <nico.rieck@gmail.com>2013-07-04 21:37:26 +0000
committerNico Rieck <nico.rieck@gmail.com>2013-07-04 21:37:26 +0000
commit316c37407ebff91d29a997bf9fa795cbf71e850d (patch)
tree42ac5ae7717c470fa1640d98856140007a19da9e /llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
parent1558c5a6ee8a8238b4a97f88f3e95b23d88c0f4f (diff)
downloadbcm5719-llvm-316c37407ebff91d29a997bf9fa795cbf71e850d.tar.gz
bcm5719-llvm-316c37407ebff91d29a997bf9fa795cbf71e850d.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. llvm-svn: 185670
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index f9fe44196de..52e52b4162a 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/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.
OpenPOWER on IntegriCloud