From: Daniel Dunbar Date: Tue, 10 Nov 2009 17:50:42 +0000 (+0000) Subject: clang-cc: Start sinking (CodeGen) options into namespaces to limit their scope. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bc2ea3406bf29ade6ac2329181890c2f352c0700;p=clang 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 --- 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 DisableLLVMOptimizations("disable-llvm-optzns", llvm::cl::desc("Don't run LLVM optimization passes")); -static llvm::cl::opt -NoCommon("fno-common", - llvm::cl::desc("Compile common globals like normal definitions"), - llvm::cl::ValueDisallowed); - static llvm::cl::opt MainFileName("main-file-name", llvm::cl::desc("Main file name to use for debug info")); @@ -641,10 +636,6 @@ static llvm::cl::opt NoElideConstructors("fno-elide-constructors", llvm::cl::desc("Disable C++ copy constructor elision")); -static llvm::cl::opt -NoMergeConstants("fno-merge-all-constants", - llvm::cl::desc("Disallow merging of constants.")); - static llvm::cl::opt 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 -GenerateDebugInfo("g", - llvm::cl::desc("Generate source level debug information")); - -static llvm::cl::opt -TargetCPU("mcpu", - llvm::cl::desc("Target a specific cpu type (-mcpu=help for details)")); - -static llvm::cl::list -TargetFeatures("target-feature", llvm::cl::desc("Target specific attributes")); +namespace codegenoptions { static llvm::cl::opt @@ -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 +GenerateDebugInfo("g", + llvm::cl::desc("Generate source level debug information")); + +static llvm::cl::opt +NoCommon("fno-common", + llvm::cl::desc("Compile common globals like normal definitions"), + llvm::cl::ValueDisallowed); + static llvm::cl::opt NoImplicitFloat("no-implicit-float", llvm::cl::desc("Don't generate implicit floating point instructions (x86-only)"), llvm::cl::init(false)); +static llvm::cl::opt +NoMergeConstants("fno-merge-all-constants", + llvm::cl::desc("Disallow merging of constants.")); + +static llvm::cl::opt +TargetCPU("mcpu", + llvm::cl::desc("Target a specific cpu type (-mcpu=help for details)")); + +static llvm::cl::list +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 &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 &Features) { + using namespace codegenoptions; Opts.OptimizeSize = OptSize; Opts.DebugInfo = GenerateDebugInfo;