Skip to content

Commit

Permalink
Disable UPC lowering pass when generating llvm output. Fixes #6.
Browse files Browse the repository at this point in the history
  • Loading branch information
swatanabe committed Oct 16, 2014
1 parent 01e8799 commit c0660b8
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion lib/CodeGen/BackendUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,10 @@ void EmitAssemblyHelper::CreatePasses(TargetMachine *TM) {
addDataFlowSanitizerPass);
}

if (LangOpts.UPCGenIr) {
// This pass should be added iff optimizations are enabled
// OR we are not generating llvm output. The case where
// we are generating assembly/object code is handled elsewhere.
if (LangOpts.UPCGenIr && OptLevel != 0) {
PMBuilder.addExtension(PassManagerBuilder::EP_EarlyAsPossible,
addLowerUPCPointersPass);
}
Expand Down Expand Up @@ -547,6 +550,17 @@ bool EmitAssemblyHelper::AddEmitPasses(BackendAction Action,
CodeGenOpts.OptimizationLevel > 0)
PM->add(createObjCARCContractPass());

// Add LLVM UPC lowering pass unless we're generating LLVM output
if (LangOpts.UPCGenIr) {
switch(Action) {
case Backend_EmitLL:
case Backend_EmitBC:
break;
default:
PM->add(llvm::createLowerUPCPointersPass());
}
}

if (TM->addPassesToEmitFile(*PM, OS, CGFT,
/*DisableVerify=*/!CodeGenOpts.VerifyModule)) {
Diags.Report(diag::err_fe_unable_to_interface_with_target);
Expand Down

0 comments on commit c0660b8

Please sign in to comment.