[flang-commits] [flang] 3f1d0e1 - [flang] Silence warning in module file (#107421)
via flang-commits
flang-commits at lists.llvm.org
Thu Sep 5 11:53:26 PDT 2024
Author: Peter Klausler
Date: 2024-09-05T11:53:22-07:00
New Revision: 3f1d0e1b1dfef0af0ca5f3315317246d0026fb70
URL: https://github.com/llvm/llvm-project/commit/3f1d0e1b1dfef0af0ca5f3315317246d0026fb70
DIFF: https://github.com/llvm/llvm-project/commit/3f1d0e1b1dfef0af0ca5f3315317246d0026fb70.diff
LOG: [flang] Silence warning in module file (#107421)
Most warnings should be silenced when processing the content of a module
file, since the warning should have also appeared when the module file
was generated. The case of an intrinsic type kind not being supported
for a target wasn't being suppressed; fix.
Fixes https://github.com/llvm/llvm-project/issues/107337.
Added:
Modified:
flang/lib/Semantics/expression.cpp
Removed:
################################################################################
diff --git a/flang/lib/Semantics/expression.cpp b/flang/lib/Semantics/expression.cpp
index 60db02dc764b46..3684839c187e68 100644
--- a/flang/lib/Semantics/expression.cpp
+++ b/flang/lib/Semantics/expression.cpp
@@ -4027,7 +4027,8 @@ bool ExpressionAnalyzer::CheckIntrinsicKind(
return true;
} else if (foldingContext_.targetCharacteristics().CanSupportType(
category, kind)) {
- if (context_.ShouldWarn(common::UsageWarning::BadTypeForTarget)) {
+ if (context_.ShouldWarn(common::UsageWarning::BadTypeForTarget) &&
+ !context_.IsInModuleFile(GetContextualMessages().at())) {
Say("%s(KIND=%jd) is not an enabled type for this target"_warn_en_US,
ToUpperCase(EnumToString(category)), kind);
}
More information about the flang-commits
mailing list