[cfe-commits] r86696 - /cfe/trunk/tools/clang-cc/clang-cc.cpp
Daniel Dunbar
daniel at zuster.org
Tue Nov 10 10:47:35 PST 2009
Author: ddunbar
Date: Tue Nov 10 12:47:35 2009
New Revision: 86696
URL: http://llvm.org/viewvc/llvm-project?rev=86696&view=rev
Log:
Factor out parts of InitializeCompileOptions that depend on the LangOptions.
Modified:
cfe/trunk/tools/clang-cc/clang-cc.cpp
Modified: cfe/trunk/tools/clang-cc/clang-cc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-cc/clang-cc.cpp?rev=86696&r1=86695&r2=86696&view=diff
==============================================================================
--- cfe/trunk/tools/clang-cc/clang-cc.cpp (original)
+++ cfe/trunk/tools/clang-cc/clang-cc.cpp Tue Nov 10 12:47:35 2009
@@ -1299,7 +1299,6 @@
}
static void InitializeCompileOptions(CompileOptions &Opts,
- const LangOptions &LangOpts,
const llvm::StringMap<bool> &Features) {
using namespace codegenoptions;
Opts.OptimizeSize = OptSize;
@@ -1314,7 +1313,7 @@
: CompileOptions::OnlyAlwaysInlining;
Opts.UnrollLoops = (Opts.OptimizationLevel > 1 && !OptSize);
- Opts.SimplifyLibCalls = !LangOpts.NoBuiltin;
+ Opts.SimplifyLibCalls = 1;
#ifdef NDEBUG
Opts.VerifyModule = 0;
@@ -1331,7 +1330,7 @@
Opts.Features.push_back(Name);
}
- Opts.NoCommon = NoCommon | LangOpts.CPlusPlus;
+ Opts.NoCommon = NoCommon;
// Handle -ftime-report.
Opts.TimePasses = TimeReport;
@@ -1342,6 +1341,14 @@
Opts.MergeAllConstants = !NoMergeConstants;
}
+static void FinalizeCompileOptions(CompileOptions &Opts,
+ const LangOptions &Lang) {
+ if (Lang.NoBuiltin)
+ Opts.SimplifyLibCalls = 0;
+ if (Lang.CPlusPlus)
+ Opts.NoCommon = 1;
+}
+
//===----------------------------------------------------------------------===//
// Fix-It Options
//===----------------------------------------------------------------------===//
@@ -2157,6 +2164,10 @@
// Compute the feature set, which may effect the language.
ComputeFeatureMap(Target, Opts.getTargetFeatures());
+ // Initialize backend options, which may also be used to key some language
+ // options.
+ InitializeCompileOptions(Opts.getCompileOpts(), Opts.getTargetFeatures());
+
// Initialize language options.
LangOptions LangInfo;
@@ -2174,9 +2185,8 @@
// Initialize the other preprocessor options.
InitializePreprocessorOptions(Opts.getPreprocessorOpts());
- // Initialize backend options.
- InitializeCompileOptions(Opts.getCompileOpts(), Opts.getLangOpts(),
- Opts.getTargetFeatures());
+ // Finalize, some code generation options.
+ FinalizeCompileOptions(Opts.getCompileOpts(), Opts.getLangOpts());
}
int main(int argc, char **argv) {
More information about the cfe-commits
mailing list