[clang] [clang][DependencyScanner] Remove all warning flags when suppressing warnings (PR #71612)
Jan Svoboda via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 7 19:19:08 PST 2023
================
@@ -52,6 +52,28 @@ static void optimizeHeaderSearchOpts(HeaderSearchOptions &Opts,
Opts.UserEntries.push_back(Entries[Idx]);
}
+static void optimizeDiagnosticOpts(DiagnosticOptions &Opts,
+ bool IsSystemModule) {
+ // If this is not a system module or -Wsystem-headers was passed, don't
+ // optimize.
+ if (!IsSystemModule)
+ return;
+ bool Wsystem_headers = false;
+ for (StringRef Opt : Opts.Warnings) {
+ bool isPositive = !Opt.consume_front("no-");
+ if (Opt == "system-headers")
+ Wsystem_headers = isPositive;
+ }
+ if (Wsystem_headers)
+ return;
----------------
jansvoboda11 wrote:
Could we reuse `clang::ProcessWarningOptions()` to avoid duplicating the logic?
https://github.com/llvm/llvm-project/pull/71612
More information about the cfe-commits
mailing list