]> granicus.if.org Git - clang/commitdiff
clang-cc: Keep Verbose option with HeaderSearchOptions, for now.
authorDaniel Dunbar <daniel@zuster.org>
Thu, 12 Nov 2009 23:52:46 +0000 (23:52 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Thu, 12 Nov 2009 23:52:46 +0000 (23:52 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87045 91177308-0d34-0410-b5e6-96231b3b80d8

tools/clang-cc/Options.cpp
tools/clang-cc/Options.h
tools/clang-cc/clang-cc.cpp

index 1251dcc4dbc354abee9ebe4bfa7c368a7d685e59..9469abf92cf1c7a23713f8593e5b1b4d6f0c4da2 100644 (file)
@@ -628,6 +628,9 @@ static llvm::cl::opt<std::string>
 isysroot("isysroot", llvm::cl::value_desc("dir"), llvm::cl::init("/"),
          llvm::cl::desc("Set the system root directory (usually /)"));
 
+static llvm::cl::opt<bool>
+Verbose("v", llvm::cl::desc("Enable verbose output"));
+
 }
 
 //===----------------------------------------------------------------------===//
@@ -768,7 +771,6 @@ void clang::InitializeFrontendOptions(FrontendOptions &Opts) {
 
 void clang::InitializeHeaderSearchOptions(HeaderSearchOptions &Opts,
                                           llvm::StringRef BuiltinIncludePath,
-                                          bool Verbose,
                                           const LangOptions &Lang) {
   using namespace headersearchoptions;
 
index f3ac2eaab41596f2d6285828ada75d903a3ba18a..558f24cc925d1228c65ea4ac2de70c8d05868535 100644 (file)
@@ -53,7 +53,6 @@ void InitializeCodeGenOptions(CodeGenOptions &Opts,
 
 void InitializeHeaderSearchOptions(HeaderSearchOptions &Opts,
                                    llvm::StringRef BuiltinIncludePath,
-                                   bool Verbose,
                                    const LangOptions &Lang);
 
 void InitializeLangOptions(LangOptions &Options, LangKind LK,
index 2f544a8742e5d9de793a6872cc8df795d274f915..2d04ab1a85cb4d5d634636a22731d34e79519944 100644 (file)
@@ -218,9 +218,6 @@ static llvm::cl::list<ParsedSourceLocation>
 FixItAtLocations("fixit-at", llvm::cl::value_desc("source-location"),
    llvm::cl::desc("Perform Fix-It modifications at the given source location"));
 
-static llvm::cl::opt<bool>
-Verbose("v", llvm::cl::desc("Enable verbose output"));
-
 //===----------------------------------------------------------------------===//
 // Language Options
 //===----------------------------------------------------------------------===//
@@ -982,7 +979,6 @@ static void ConstructCompilerInvocation(CompilerInvocation &Opts,
   // Initialize the header search options.
   InitializeHeaderSearchOptions(Opts.getHeaderSearchOpts(),
                                 GetBuiltinIncludePath(Argv0),
-                                Verbose,
                                 Opts.getLangOpts());
 
   // Initialize the other preprocessor options.
@@ -1039,11 +1035,6 @@ int main(int argc, char **argv) {
   llvm::cl::ParseCommandLineOptions(argc, argv,
                               "LLVM 'Clang' Compiler: http://clang.llvm.org\n");
 
-  if (Verbose)
-    llvm::errs() << "clang-cc version " CLANG_VERSION_STRING
-                 << " based upon " << PACKAGE_STRING
-                 << " hosted on " << llvm::sys::getHostTriple() << "\n";
-
   // Construct the diagnostic engine first, so that we can build a diagnostic
   // client to use for any errors during option handling.
   DiagnosticOptions DiagOpts;
@@ -1086,7 +1077,12 @@ int main(int argc, char **argv) {
   bool IsAST;
   ConstructCompilerInvocation(CompOpts, argv[0], DiagOpts, *Target, IsAST);
 
-  // Validate some options.
+  // Validate/process some options.
+  if (CompOpts.getHeaderSearchOpts().Verbose)
+    llvm::errs() << "clang-cc version " CLANG_VERSION_STRING
+                 << " based upon " << PACKAGE_STRING
+                 << " hosted on " << llvm::sys::getHostTriple() << "\n";
+
   if (CompOpts.getFrontendOpts().ShowTimers)
     ClangFrontendTimer = new llvm::Timer("Clang front-end time");