aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-11-10 17:50:42 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-11-10 17:50:42 +0000
commitbc2ea3406bf29ade6ac2329181890c2f352c0700 (patch)
tree196668bdf8c65d22b432c993e903a6206d1a6b83
parent9af869510b89fb8d99fca68be18e32f91954da19 (diff)
clang-cc: Start sinking (CodeGen) options into namespaces to limit their scope.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86690 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--tools/clang-cc/clang-cc.cpp44
1 files changed, 25 insertions, 19 deletions
diff --git a/tools/clang-cc/clang-cc.cpp b/tools/clang-cc/clang-cc.cpp
index 861e20e47f..bd18165467 100644
--- a/tools/clang-cc/clang-cc.cpp
+++ b/tools/clang-cc/clang-cc.cpp
@@ -624,11 +624,6 @@ static llvm::cl::opt<bool>
DisableLLVMOptimizations("disable-llvm-optzns",
llvm::cl::desc("Don't run LLVM optimization passes"));
-static llvm::cl::opt<bool>
-NoCommon("fno-common",
- llvm::cl::desc("Compile common globals like normal definitions"),
- llvm::cl::ValueDisallowed);
-
static llvm::cl::opt<std::string>
MainFileName("main-file-name",
llvm::cl::desc("Main file name to use for debug info"));
@@ -641,10 +636,6 @@ static llvm::cl::opt<bool>
NoElideConstructors("fno-elide-constructors",
llvm::cl::desc("Disable C++ copy constructor elision"));
-static llvm::cl::opt<bool>
-NoMergeConstants("fno-merge-all-constants",
- llvm::cl::desc("Disallow merging of constants."));
-
static llvm::cl::opt<std::string>
TargetABI("target-abi",
llvm::cl::desc("Target a particular ABI type"));
@@ -1242,16 +1233,7 @@ static void ParseFile(Preprocessor &PP, MinimalAction *PA) {
// Code generation options
//===----------------------------------------------------------------------===//
-static llvm::cl::opt<bool>
-GenerateDebugInfo("g",
- llvm::cl::desc("Generate source level debug information"));
-
-static llvm::cl::opt<std::string>
-TargetCPU("mcpu",
- llvm::cl::desc("Target a specific cpu type (-mcpu=help for details)"));
-
-static llvm::cl::list<std::string>
-TargetFeatures("target-feature", llvm::cl::desc("Target specific attributes"));
+namespace codegenoptions {
static llvm::cl::opt<bool>
@@ -1260,15 +1242,38 @@ DisableRedZone("disable-red-zone",
llvm::cl::init(false));
static llvm::cl::opt<bool>
+GenerateDebugInfo("g",
+ llvm::cl::desc("Generate source level debug information"));
+
+static llvm::cl::opt<bool>
+NoCommon("fno-common",
+ llvm::cl::desc("Compile common globals like normal definitions"),
+ llvm::cl::ValueDisallowed);
+
+static llvm::cl::opt<bool>
NoImplicitFloat("no-implicit-float",
llvm::cl::desc("Don't generate implicit floating point instructions (x86-only)"),
llvm::cl::init(false));
+static llvm::cl::opt<bool>
+NoMergeConstants("fno-merge-all-constants",
+ llvm::cl::desc("Disallow merging of constants."));
+
+static llvm::cl::opt<std::string>
+TargetCPU("mcpu",
+ llvm::cl::desc("Target a specific cpu type (-mcpu=help for details)"));
+
+static llvm::cl::list<std::string>
+TargetFeatures("target-feature", llvm::cl::desc("Target specific attributes"));
+
+}
+
/// ComputeTargetFeatures - Recompute the target feature list to only
/// be the list of things that are enabled, based on the target cpu
/// and feature list.
static void ComputeFeatureMap(TargetInfo &Target,
llvm::StringMap<bool> &Features) {
+ using namespace codegenoptions;
assert(Features.empty() && "invalid map");
// Initialize the feature map based on the target.
@@ -1296,6 +1301,7 @@ static void ComputeFeatureMap(TargetInfo &Target,
static void InitializeCompileOptions(CompileOptions &Opts,
const LangOptions &LangOpts,
const llvm::StringMap<bool> &Features) {
+ using namespace codegenoptions;
Opts.OptimizeSize = OptSize;
Opts.DebugInfo = GenerateDebugInfo;