[flang-commits] [flang] [flang] Silence warning in module file (PR #107421)

via flang-commits flang-commits at lists.llvm.org
Thu Sep 5 09:24:35 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-flang-semantics

Author: Peter Klausler (klausler)

<details>
<summary>Changes</summary>

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.

---
Full diff: https://github.com/llvm/llvm-project/pull/107421.diff


1 Files Affected:

- (modified) flang/lib/Semantics/expression.cpp (+2-1) 


``````````diff
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);
     }

``````````

</details>


https://github.com/llvm/llvm-project/pull/107421


More information about the flang-commits mailing list