diff --git a/gen/passes/GarbageCollect2Stack.cpp b/gen/passes/GarbageCollect2Stack.cpp index 901f1dc2..f498ffa2 100644 --- a/gen/passes/GarbageCollect2Stack.cpp +++ b/gen/passes/GarbageCollect2Stack.cpp @@ -397,7 +397,11 @@ namespace { #endif AU.addRequired(); +#if LDC_LLVM_VER >= 305 + AU.addPreserved(); +#else AU.addPreserved(); +#endif } }; char GarbageCollect2Stack::ID = 0; @@ -460,7 +464,11 @@ bool GarbageCollect2Stack::runOnFunction(Function &F) { TargetData& TD = getAnalysis(); #endif DominatorTree& DT = getAnalysis(); +#if LDC_LLVM_VER >= 305 + CallGraph* CG = &getAnalysisIfAvailable()->getCallGraph(); +#else CallGraph* CG = getAnalysisIfAvailable(); +#endif CallGraphNode* CGNode = CG ? (*CG)[&F] : NULL; Analysis A = { TD, *M, CG, CGNode };