Changes for LLVM 3.5

This commit is contained in:
Kai Nacke
2013-11-27 22:44:49 +01:00
parent d7d0ebb65c
commit 37ee9962fd

View File

@@ -397,7 +397,11 @@ namespace {
#endif
AU.addRequired<DominatorTree>();
#if LDC_LLVM_VER >= 305
AU.addPreserved<CallGraphWrapperPass>();
#else
AU.addPreserved<CallGraph>();
#endif
}
};
char GarbageCollect2Stack::ID = 0;
@@ -460,7 +464,11 @@ bool GarbageCollect2Stack::runOnFunction(Function &F) {
TargetData& TD = getAnalysis<TargetData>();
#endif
DominatorTree& DT = getAnalysis<DominatorTree>();
#if LDC_LLVM_VER >= 305
CallGraph* CG = &getAnalysisIfAvailable<CallGraphWrapperPass>()->getCallGraph();
#else
CallGraph* CG = getAnalysisIfAvailable<CallGraph>();
#endif
CallGraphNode* CGNode = CG ? (*CG)[&F] : NULL;
Analysis A = { TD, *M, CG, CGNode };