Skip to content

Commit 37ee996

Browse files
committed
Changes for LLVM 3.5
1 parent d7d0ebb commit 37ee996

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

gen/passes/GarbageCollect2Stack.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,11 @@ namespace {
397397
#endif
398398
AU.addRequired<DominatorTree>();
399399

400+
#if LDC_LLVM_VER >= 305
401+
AU.addPreserved<CallGraphWrapperPass>();
402+
#else
400403
AU.addPreserved<CallGraph>();
404+
#endif
401405
}
402406
};
403407
char GarbageCollect2Stack::ID = 0;
@@ -460,7 +464,11 @@ bool GarbageCollect2Stack::runOnFunction(Function &F) {
460464
TargetData& TD = getAnalysis<TargetData>();
461465
#endif
462466
DominatorTree& DT = getAnalysis<DominatorTree>();
467+
#if LDC_LLVM_VER >= 305
468+
CallGraph* CG = &getAnalysisIfAvailable<CallGraphWrapperPass>()->getCallGraph();
469+
#else
463470
CallGraph* CG = getAnalysisIfAvailable<CallGraph>();
471+
#endif
464472
CallGraphNode* CGNode = CG ? (*CG)[&F] : NULL;
465473

466474
Analysis A = { TD, *M, CG, CGNode };

0 commit comments

Comments
 (0)