summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-03-16 18:41:18 +0000
committerChris Lattner <sabre@nondot.org>2009-03-16 18:41:18 +0000
commit7afae71519b5da548bc16dde9d7ae3ce3baa9b21 (patch)
treead2b45c4b6802f0ddd29dab3ac27c22199169577
parentf257b619059e05906c4d93f3dc134857f818f44c (diff)
downloadclang-7afae71519b5da548bc16dde9d7ae3ce3baa9b21.tar.gz
clang-7afae71519b5da548bc16dde9d7ae3ce3baa9b21.tar.bz2
clang-7afae71519b5da548bc16dde9d7ae3ce3baa9b21.tar.xz
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
-rw-r--r--Driver/clang.cpp7
1 files 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<std::string>
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);
}