mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-03-05 03:43:13 +01:00
Merge branch 'master' into merge-2.064
This commit is contained in:
@@ -638,6 +638,21 @@ static void registerPredefinedVersions() {
|
||||
|
||||
registerPredefinedTargetVersions();
|
||||
|
||||
#if LDC_LLVM_VER >= 303
|
||||
// Pass sanitizer arguments to linker. Requires clang.
|
||||
if (opts::sanitize == opts::AddressSanitizer) {
|
||||
VersionCondition::addPredefinedGlobalIdent("LDC_AddressSanitizer");
|
||||
}
|
||||
|
||||
if (opts::sanitize == opts::MemorySanitizer) {
|
||||
VersionCondition::addPredefinedGlobalIdent("LDC_MemorySanitizer");
|
||||
}
|
||||
|
||||
if (opts::sanitize == opts::ThreadSanitizer) {
|
||||
VersionCondition::addPredefinedGlobalIdent("LDC_ThreadSanitizer");
|
||||
}
|
||||
#endif
|
||||
|
||||
// Expose LLVM version to runtime
|
||||
#define STR(x) #x
|
||||
#define XSTR(x) STR(x)
|
||||
|
||||
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user