summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LLVMTargetMachine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/LLVMTargetMachine.cpp')
-rw-r--r--llvm/lib/CodeGen/LLVMTargetMachine.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/LLVMTargetMachine.cpp b/llvm/lib/CodeGen/LLVMTargetMachine.cpp
index 1d10a6c9afd..886ae7e94ad 100644
--- a/llvm/lib/CodeGen/LLVMTargetMachine.cpp
+++ b/llvm/lib/CodeGen/LLVMTargetMachine.cpp
@@ -201,6 +201,15 @@ bool LLVMTargetMachine::addPassesToEmitFile(PassManagerBase &PM,
return true;
if (!TargetPassConfig::willCompleteCodeGenPipeline()) {
+ if (this->getTargetTriple().isOSAIX()) {
+ // On AIX, we might manifest MCSymbols during SDAG lowering. For MIR
+ // testing to be meaningful, we need to ensure that the symbols created
+ // are MCSymbolXCOFF variants, which requires that
+ // the TargetLoweringObjectFile instance has been initialized.
+ MCContext &Ctx = MMI->getContext();
+ const_cast<TargetLoweringObjectFile &>(*this->getObjFileLowering())
+ .Initialize(Ctx, *this);
+ }
PM.add(createPrintMIRPass(Out));
} else if (addAsmPrinter(PM, Out, DwoOut, FileType, MMI->getContext()))
return true;
OpenPOWER on IntegriCloud