Fix the LLVM 3.4 build.

The disable-simplify-libcalls is gone.
This commit is contained in:
kai 2013-06-21 23:44:42 +02:00
parent d0ef732cbd
commit 609b362410

View file

@ -80,10 +80,12 @@ disableSimplifyDruntimeCalls("disable-simplify-drtcalls",
cl::desc("Disable simplification of druntime calls"),
cl::ZeroOrMore);
#if LDC_LLVM_VER < 304
static cl::opt<bool>
disableSimplifyLibCalls("disable-simplify-libcalls",
cl::desc("Disable simplification of well-known C runtime calls"),
cl::ZeroOrMore);
#endif
static cl::opt<bool>
disableGCToStack("disable-gc2stack",
@ -179,7 +181,9 @@ static void addOptimizationPasses(PassManagerBase &mpm, FunctionPassManager &fpm
} else {
builder.Inliner = createAlwaysInlinerPass();
}
#if LDC_LLVM_VER < 304
builder.DisableSimplifyLibCalls = disableSimplifyLibCalls;
#endif
builder.DisableUnitAtATime = !unitAtATime;
builder.DisableUnrollLoops = optLevel == 0;
/* builder.Vectorize is set in ctor from command line switch */
@ -211,9 +215,11 @@ bool ldc_optimize_module(llvm::Module* m)
// Add an appropriate TargetLibraryInfo pass for the module's triple.
TargetLibraryInfo *tli = new TargetLibraryInfo(Triple(m->getTargetTriple()));
#if LDC_LLVM_VER < 304
// The -disable-simplify-libcalls flag actually disables all builtin optzns.
if (disableSimplifyLibCalls)
tli->disableAllFunctions();
#endif
mpm.add(tli);
// Add an appropriate TargetData instance for this module.