Skip to content

Conversation

@boomanaiden154
Copy link
Contributor

…70d689745a7d

These are only used in assertions so trigger warnings in release builds. Fix this per the LLVM programming standards.

These are only used in assertions so trigger warnings in release builds.
Fix this per the LLVM programming standards.
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" clang:bytecode Issues for the clang bytecode constexpr interpreter labels Dec 8, 2025
@llvmbot
Copy link
Member

llvmbot commented Dec 8, 2025

@llvm/pr-subscribers-clang

Author: Aiden Grossman (boomanaiden154)

Changes

…70d689745a7d

These are only used in assertions so trigger warnings in release builds. Fix this per the LLVM programming standards.


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

1 Files Affected:

  • (modified) clang/lib/AST/ByteCode/InterpBuiltin.cpp (+4-4)
diff --git a/clang/lib/AST/ByteCode/InterpBuiltin.cpp b/clang/lib/AST/ByteCode/InterpBuiltin.cpp
index 2704fdccd1faf..626c5b64a444f 100644
--- a/clang/lib/AST/ByteCode/InterpBuiltin.cpp
+++ b/clang/lib/AST/ByteCode/InterpBuiltin.cpp
@@ -3848,9 +3848,9 @@ static bool interp_builtin_ia32_gfni_affine(InterpState &S, CodePtr OpPC,
   X = S.Stk.pop<Pointer>();
 
   const Pointer &Dst = S.Stk.peek<Pointer>();
-  const auto *XVecT = XType->castAs<VectorType>();
   const auto *AVecT = AType->castAs<VectorType>();
-  assert(XVecT->getNumElements() == AVecT->getNumElements());
+  assert(XType->castAs<VectorType>()->getNumElements() ==
+         AVecT->getNumElements());
   unsigned NumBytesInQWord = 8;
   unsigned NumBytes = AVecT->getNumElements();
   unsigned NumBitsInQWord = 64;
@@ -3905,8 +3905,8 @@ static bool interp__builtin_ia32_gfni_mul(InterpState &S, CodePtr OpPC,
 
   const Pointer &Dst = S.Stk.peek<Pointer>();
   const auto *AVecT = AType->castAs<VectorType>();
-  const auto *BVecT = BType->castAs<VectorType>();
-  assert(AVecT->getNumElements() == BVecT->getNumElements());
+  assert(AVecT->getNumElements() ==
+         BType->castAs<VectorType>()->getNumElements());
 
   PrimType AElemT = *S.getContext().classify(AVecT->getElementType());
   unsigned NumBytes = A.getNumElems();

@boomanaiden154 boomanaiden154 enabled auto-merge (squash) December 8, 2025 23:03
@boomanaiden154 boomanaiden154 merged commit 392c302 into llvm:main Dec 8, 2025
11 of 13 checks passed
@boomanaiden154 boomanaiden154 deleted the unused-variable-1911ce132659222aee353882bd5570d689745a7d branch December 9, 2025 00:27
honeygoyal pushed a commit to honeygoyal/llvm-project that referenced this pull request Dec 9, 2025
…70d689745a7d

These are only used in assertions so trigger warnings in release builds.
Fix this per the LLVM programming standards.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:bytecode Issues for the clang bytecode constexpr interpreter clang:frontend Language frontend issues, e.g. anything involving "Sema" clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants