diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-11-12 07:28:44 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-11-12 07:28:44 +0000 |
commit | 6907943901e0aae5be7618c36c0f8275634e6ab5 (patch) | |
tree | 035e97bdc444a17340d84d479e198a13e82f7dc3 /lib/Frontend/Warnings.cpp | |
parent | c706468b1e00bab49ca92eb500a39657f530f828 (diff) |
Move warning options into DiagnosticOptions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86968 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/Warnings.cpp')
-rw-r--r-- | lib/Frontend/Warnings.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/Frontend/Warnings.cpp b/lib/Frontend/Warnings.cpp index 3f442c8a7f..ff44c90516 100644 --- a/lib/Frontend/Warnings.cpp +++ b/lib/Frontend/Warnings.cpp @@ -24,6 +24,7 @@ #include "clang/Basic/Diagnostic.h" #include "clang/Sema/SemaDiagnostic.h" #include "clang/Lex/LexDiagnostic.h" +#include "clang/Frontend/DiagnosticOptions.h" #include "clang/Frontend/FrontendDiagnostic.h" #include <cstdio> #include <cstring> @@ -32,26 +33,24 @@ using namespace clang; bool clang::ProcessWarningOptions(Diagnostic &Diags, - std::vector<std::string> &Warnings, - bool Pedantic, bool PedanticErrors, - bool NoWarnings) { + const DiagnosticOptions &Opts) { Diags.setSuppressSystemWarnings(true); // Default to -Wno-system-headers - Diags.setIgnoreAllWarnings(NoWarnings); + Diags.setIgnoreAllWarnings(Opts.IgnoreWarnings); // If -pedantic or -pedantic-errors was specified, then we want to map all // extension diagnostics onto WARNING or ERROR unless the user has futz'd // around with them explicitly. - if (PedanticErrors) + if (Opts.PedanticErrors) Diags.setExtensionHandlingBehavior(Diagnostic::Ext_Error); - else if (Pedantic) + else if (Opts.Pedantic) Diags.setExtensionHandlingBehavior(Diagnostic::Ext_Warn); else Diags.setExtensionHandlingBehavior(Diagnostic::Ext_Ignore); // FIXME: -Wfatal-errors / -Wfatal-errors=foo - for (unsigned i = 0, e = Warnings.size(); i != e; ++i) { - const std::string &Opt = Warnings[i]; + for (unsigned i = 0, e = Opts.Warnings.size(); i != e; ++i) { + const std::string &Opt = Opts.Warnings[i]; const char *OptStart = &Opt[0]; const char *OptEnd = OptStart+Opt.size(); assert(*OptEnd == 0 && "Expect null termination for lower-bound search"); |