Move the warning options from Warnings.cpp to clang-cc.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72089 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/clang-cc/clang-cc.cpp b/tools/clang-cc/clang-cc.cpp
index 4bf9257..81a819e 100644
--- a/tools/clang-cc/clang-cc.cpp
+++ b/tools/clang-cc/clang-cc.cpp
@@ -1497,6 +1497,20 @@
llvm::cl::desc("Silence ObjC rewriting warnings"));
//===----------------------------------------------------------------------===//
+// Warning Options
+//===----------------------------------------------------------------------===//
+
+// This gets all -W options, including -Werror, -W[no-]system-headers, etc. The
+// driver has stripped off -Wa,foo etc. The driver has also translated -W to
+// -Wextra, so we don't need to worry about it.
+static llvm::cl::list<std::string>
+OptWarnings("W", llvm::cl::Prefix, llvm::cl::ValueOptional);
+
+static llvm::cl::opt<bool> OptPedantic("pedantic");
+static llvm::cl::opt<bool> OptPedanticErrors("pedantic-errors");
+static llvm::cl::opt<bool> OptNoWarnings("w");
+
+//===----------------------------------------------------------------------===//
// -dump-build-information Stuff
//===----------------------------------------------------------------------===//
@@ -2028,7 +2042,8 @@
// Configure our handling of diagnostics.
Diagnostic Diags(DiagClient.get());
- if (ProcessWarningOptions(Diags))
+ if (ProcessWarningOptions(Diags, OptWarnings, OptPedantic, OptPedanticErrors,
+ OptNoWarnings))
return 1;
// -I- is a deprecated GCC feature, scan for it and reject it.