From 609b362410b23a9947631069cf43b288724dcee6 Mon Sep 17 00:00:00 2001 From: kai Date: Fri, 21 Jun 2013 23:44:42 +0200 Subject: [PATCH] Fix the LLVM 3.4 build. The disable-simplify-libcalls is gone. --- gen/optimizer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gen/optimizer.cpp b/gen/optimizer.cpp index 76b53569..b0eef1d7 100644 --- a/gen/optimizer.cpp +++ b/gen/optimizer.cpp @@ -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 disableSimplifyLibCalls("disable-simplify-libcalls", cl::desc("Disable simplification of well-known C runtime calls"), cl::ZeroOrMore); +#endif static cl::opt 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.