From 7afae71519b5da548bc16dde9d7ae3ce3baa9b21 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 16 Mar 2009 18:41:18 +0000 Subject: [PATCH] simplify this code by reading the decision from LangOptions instead of recomputing the property from command line options. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67047 91177308-0d34-0410-b5e6-96231b3b80d8 --- Driver/clang.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Driver/clang.cpp b/Driver/clang.cpp index e94f0ed07c..48ae2216d4 100644 --- a/Driver/clang.cpp +++ b/Driver/clang.cpp @@ -1191,7 +1191,8 @@ static llvm::cl::opt TargetCPU("mcpu", llvm::cl::desc("Target a specific cpu type (-mcpu=help for details)")); -static void InitializeCompileOptions(CompileOptions &Opts) { +static void InitializeCompileOptions(CompileOptions &Opts, + const LangOptions &LangOpts) { Opts.OptimizeSize = OptSize; Opts.DebugInfo = GenerateDebugInfo; if (OptSize) { @@ -1205,7 +1206,7 @@ static void InitializeCompileOptions(CompileOptions &Opts) { // FIXME: There are llvm-gcc options to control these selectively. Opts.InlineFunctions = (Opts.OptimizationLevel > 1); Opts.UnrollLoops = (Opts.OptimizationLevel > 1 && !OptSize); - Opts.SimplifyLibCalls = !NoBuiltin && !Freestanding; + Opts.SimplifyLibCalls = !LangOpts.NoBuiltin; #ifdef NDEBUG Opts.VerifyModule = 0; @@ -1272,7 +1273,7 @@ static ASTConsumer *CreateASTConsumer(const std::string& InFile, Act = Backend_EmitBC; CompileOptions Opts; - InitializeCompileOptions(Opts); + InitializeCompileOptions(Opts, LangOpts); return CreateBackendConsumer(Act, Diag, LangOpts, Opts, InFile, OutputFile); } -- 2.40.0