aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorKiran Chandramohan <kiran.chandramohan@arm.com>2024-05-08 10:00:48 +0100
committerGitHub <noreply@github.com>2024-05-08 10:00:48 +0100
commit602df270a9bfcb52980a93c85eb615c0d91eba0c (patch)
tree8f74a31d678c2ce00b7300b3cd25fe0d03c498d1 /flang/lib/Frontend/CompilerInvocation.cpp
parent746bf297e2f0f637d2e1c197bf04a32ab04b669a (diff)
downloadllvm-602df270a9bfcb52980a93c85eb615c0d91eba0c.zip
llvm-602df270a9bfcb52980a93c85eb615c0d91eba0c.tar.gz
llvm-602df270a9bfcb52980a93c85eb615c0d91eba0c.tar.bz2
[Flang] RFC: Add support for -w option 1/n (#90420)
Add support for the -w option to switch OFF all Flang warnings. This patch only supports switching OFF the frontend warnings. TODO : Support for MLIR, LLVM and Driver warnings. TODO : Support interactions between -w, -pedantic, -Wall
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--flang/lib/Frontend/CompilerInvocation.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp
index f1b7b53..4318286 100644
--- a/flang/lib/Frontend/CompilerInvocation.cpp
+++ b/flang/lib/Frontend/CompilerInvocation.cpp
@@ -975,6 +975,11 @@ static bool parseDialectArgs(CompilerInvocation &res, llvm::opt::ArgList &args,
res.setEnableConformanceChecks();
res.setEnableUsageChecks();
}
+
+ // -w
+ if (args.hasArg(clang::driver::options::OPT_w))
+ res.setDisableWarnings();
+
// -std=f2018
// TODO: Set proper options when more fortran standards
// are supported.
@@ -1403,6 +1408,11 @@ void CompilerInvocation::setFortranOpts() {
if (getEnableUsageChecks())
fortranOptions.features.WarnOnAllUsage();
+
+ if (getDisableWarnings()) {
+ fortranOptions.features.DisableAllNonstandardWarnings();
+ fortranOptions.features.DisableAllUsageWarnings();
+ }
}
std::unique_ptr<Fortran::semantics::SemanticsContext>