Skip to content

Conversation

@klausler
Copy link
Contributor

@klausler klausler commented Sep 5, 2024

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 #107337.

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 llvm#107337.
@klausler klausler requested a review from Renaud-K September 5, 2024 16:23
@llvmbot llvmbot added flang Flang issues not falling into any other category flang:semantics labels Sep 5, 2024
@llvmbot
Copy link
Member

llvmbot commented Sep 5, 2024

@llvm/pr-subscribers-flang-semantics

Author: Peter Klausler (klausler)

Changes

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 #107337.


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

1 Files Affected:

  • (modified) flang/lib/Semantics/expression.cpp (+2-1)
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);
     }

@klausler klausler merged commit 3f1d0e1 into llvm:main Sep 5, 2024
@klausler klausler deleted the bug107337 branch September 5, 2024 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flang:semantics flang Flang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[flang] Many warnings issued from a module included by a use statement after disabling types

3 participants