Skip to content

Conversation

klausler
Copy link
Contributor

A recent patch had three declared but unused variables in it, triggering a warning in some build bots. Remove them.

A recent patch had three declared but unused variables in it,
triggering a warning in some build bots.  Remove them.
@klausler klausler self-assigned this Apr 22, 2024
@klausler klausler merged commit 2e2ac6f into llvm:main Apr 22, 2024
@klausler klausler deleted the fix branch April 22, 2024 23:22
@llvmbot llvmbot added flang Flang issues not falling into any other category flang:semantics labels Apr 22, 2024
@llvmbot
Copy link
Member

llvmbot commented Apr 22, 2024

@llvm/pr-subscribers-flang-semantics

Author: Peter Klausler (klausler)

Changes

A recent patch had three declared but unused variables in it, triggering a warning in some build bots. Remove them.


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

1 Files Affected:

  • (modified) flang/lib/Evaluate/fold-logical.cpp (-3)
diff --git a/flang/lib/Evaluate/fold-logical.cpp b/flang/lib/Evaluate/fold-logical.cpp
index 4c1afe9a0f2952..b7d641711c363d 100644
--- a/flang/lib/Evaluate/fold-logical.cpp
+++ b/flang/lib/Evaluate/fold-logical.cpp
@@ -482,11 +482,9 @@ static Expr<Type<TypeCategory::Logical, KIND>> RewriteOutOfRange(
     CHECK(x != nullptr);
     if (const auto *mold{UnwrapExpr<Expr<SomeType>>(args[1])}) {
       DynamicType xType{x->GetType().value()};
-      DynamicType moldType{mold->GetType().value()};
       std::optional<Expr<LogicalResult>> result;
       bool alwaysFalse{false};
       if (auto *iXExpr{UnwrapExpr<Expr<SomeInteger>>(*x)}) {
-        DynamicType iXType{iXExpr->GetType().value()};
         int iXKind{iXExpr->GetType().value().kind()};
         if (auto *iMoldExpr{UnwrapExpr<Expr<SomeInteger>>(*mold)}) {
           // INTEGER -> INTEGER
@@ -522,7 +520,6 @@ static Expr<Type<TypeCategory::Logical, KIND>> RewriteOutOfRange(
           }
         }
       } else if (auto *rXExpr{UnwrapExpr<Expr<SomeReal>>(*x)}) {
-        DynamicType rXType{rXExpr->GetType().value()};
         int rXKind{rXExpr->GetType().value().kind()};
         if (auto *iMoldExpr{UnwrapExpr<Expr<SomeInteger>>(*mold)}) {
           // REAL -> INTEGER

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.

2 participants