clang-cc: Keep Verbose option with HeaderSearchOptions, for now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87045 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/clang-cc/Options.cpp b/tools/clang-cc/Options.cpp
index 1251dcc..9469abf 100644
--- a/tools/clang-cc/Options.cpp
+++ b/tools/clang-cc/Options.cpp
@@ -628,6 +628,9 @@
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::InitializeHeaderSearchOptions(HeaderSearchOptions &Opts,
llvm::StringRef BuiltinIncludePath,
- bool Verbose,
const LangOptions &Lang) {
using namespace headersearchoptions;
diff --git a/tools/clang-cc/Options.h b/tools/clang-cc/Options.h
index f3ac2ea..558f24c 100644
--- a/tools/clang-cc/Options.h
+++ b/tools/clang-cc/Options.h
@@ -53,7 +53,6 @@
void InitializeHeaderSearchOptions(HeaderSearchOptions &Opts,
llvm::StringRef BuiltinIncludePath,
- bool Verbose,
const LangOptions &Lang);
void InitializeLangOptions(LangOptions &Options, LangKind LK,
diff --git a/tools/clang-cc/clang-cc.cpp b/tools/clang-cc/clang-cc.cpp
index 2f544a8..2d04ab1 100644
--- a/tools/clang-cc/clang-cc.cpp
+++ b/tools/clang-cc/clang-cc.cpp
@@ -218,9 +218,6 @@
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 @@
// Initialize the header search options.
InitializeHeaderSearchOptions(Opts.getHeaderSearchOpts(),
GetBuiltinIncludePath(Argv0),
- Verbose,
Opts.getLangOpts());
// Initialize the other preprocessor options.
@@ -1039,11 +1035,6 @@
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 @@
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");