]> granicus.if.org Git - clang/commitdiff
clang-cc: Start sinking (CodeGen) options into namespaces to limit their scope.
authorDaniel Dunbar <daniel@zuster.org>
Tue, 10 Nov 2009 17:50:42 +0000 (17:50 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Tue, 10 Nov 2009 17:50:42 +0000 (17:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86690 91177308-0d34-0410-b5e6-96231b3b80d8

tools/clang-cc/clang-cc.cpp

index 861e20e47fba9bbba89b14caf344a2808424966d..bd18165467ee5d1bb68406c619333dd905233697 100644 (file)
@@ -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>
@@ -1259,16 +1241,39 @@ DisableRedZone("disable-red-zone",
                llvm::cl::desc("Do not emit code that uses the 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;