Ingo =?utf-8?q?Müller?= <[email protected]>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/[email protected]>


https://github.com/RKSimon updated 
https://github.com/llvm/llvm-project/pull/169822

>From b386d2eb54b392ff399a4f4022132cf5dd4a15fb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ingo=20M=C3=BCller?= <[email protected]>
Date: Thu, 27 Nov 2025 15:37:07 +0000
Subject: [PATCH 1/2] [clang:ast] Suppress warning for unused var without
 assertions.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This PR suppresses a compiler warning, which turns into an error with
`-Werror`, for a variable introduced in #169276 and only used in an
assertion (which is, thus, unused if compiled without assertions).

Signed-off-by: Ingo Müller <[email protected]>
---
 clang/lib/AST/ExprConstant.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index 7b9380de6834d..431b58f4627bb 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -12181,6 +12181,7 @@ static bool evalShiftWithCount(
   QualType SourceTy = Call->getArg(0)->getType();
   QualType CountTy = Call->getArg(1)->getType();
   assert(SourceTy->isVectorType() && CountTy->isVectorType());
+  (void)CountTy;
 
   QualType DestEltTy = SourceTy->castAs<VectorType>()->getElementType();
   unsigned DestEltWidth = Source.getVectorElt(0).getInt().getBitWidth();

>From f294c8c6d3d7d0c4110f7c2800fdd9e0b2e1f31e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ingo=20M=C3=BCller?= <[email protected]>
Date: Thu, 27 Nov 2025 15:52:38 +0000
Subject: [PATCH 2/2] Replace variable instead of suppressing warning.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Ingo Müller <[email protected]>
---
 clang/lib/AST/ExprConstant.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index 431b58f4627bb..cab17ecdc7b29 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -12179,9 +12179,8 @@ static bool evalShiftWithCount(
   assert(Call->getNumArgs() == 2);
 
   QualType SourceTy = Call->getArg(0)->getType();
-  QualType CountTy = Call->getArg(1)->getType();
-  assert(SourceTy->isVectorType() && CountTy->isVectorType());
-  (void)CountTy;
+  assert(SourceTy->isVectorType() &&
+         Call->getArg(1)->getType()->isVectorType());
 
   QualType DestEltTy = SourceTy->castAs<VectorType>()->getElementType();
   unsigned DestEltWidth = Source.getVectorElt(0).getInt().getBitWidth();

_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to