diff options
author | Andre Kuhlenschmidt <andre.kuhlenschmidt@gmail.com> | 2025-07-09 12:35:43 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-09 12:35:43 -0700 |
commit | fc9dd587347ee2708ac1eff2716d3edd6b08a873 (patch) | |
tree | 8c06d5f39fe602e2de235c22b55525e3585c16f4 /flang/lib/Frontend/CompilerInvocation.cpp | |
parent | 8f8b1b0402ede9bee4225bfde18ea1be8158dba2 (diff) | |
download | llvm-fc9dd587347ee2708ac1eff2716d3edd6b08a873.zip llvm-fc9dd587347ee2708ac1eff2716d3edd6b08a873.tar.gz llvm-fc9dd587347ee2708ac1eff2716d3edd6b08a873.tar.bz2 |
[flang][driver] add -Wfatal-errors (#147614)
Adds the flag `-Wfatal-errors` which truncates the error messages at 1 error.
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | flang/lib/Frontend/CompilerInvocation.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp index 5455efd..f55d866 100644 --- a/flang/lib/Frontend/CompilerInvocation.cpp +++ b/flang/lib/Frontend/CompilerInvocation.cpp @@ -1029,7 +1029,10 @@ static bool parseDiagArgs(CompilerInvocation &res, llvm::opt::ArgList &args, for (const auto &wArg : wArgs) { if (wArg == "error") { res.setWarnAsErr(true); - // -W(no-)<feature> + // -Wfatal-errors + } else if (wArg == "fatal-errors") { + res.setMaxErrors(1); + // -W[no-]<feature> } else if (!features.EnableWarning(wArg)) { const unsigned diagID = diags.getCustomDiagID( clang::DiagnosticsEngine::Error, "Unknown diagnostic option: -W%0"); @@ -1790,6 +1793,7 @@ CompilerInvocation::getSemanticsCtx( semanticsContext->set_moduleDirectory(getModuleDir()) .set_searchDirectories(fortranOptions.searchDirectories) .set_intrinsicModuleDirectories(fortranOptions.intrinsicModuleDirectories) + .set_maxErrors(getMaxErrors()) .set_warningsAreErrors(getWarnAsErr()) .set_moduleFileSuffix(getModuleFileSuffix()) .set_underscoring(getCodeGenOpts().Underscoring); |