[clang] [clang][bytecode] Do pointer-to-bool convesions without classify() (PR #221516)
via cfe-commits
cfe-commits at lists.llvm.org
Sat Sep 5 21:03:41 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Timm Baeder (tbaederr)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/221516.diff
1 Files Affected:
- (modified) clang/lib/AST/ByteCode/Compiler.cpp (+5-4)
``````````diff
diff --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp
index 03f9478a6e4e0..c99f2affc6824 100644
--- a/clang/lib/AST/ByteCode/Compiler.cpp
+++ b/clang/lib/AST/ByteCode/Compiler.cpp
@@ -851,13 +851,14 @@ bool Compiler<Emitter>::VisitCastExpr(const CastExpr *E) {
}
case CK_PointerToBoolean:
- case CK_MemberPointerToBoolean: {
- PrimType PtrT = classifyPrim(SubExpr->getType());
+ if (!this->visit(SubExpr))
+ return false;
+ return this->emitIsNonNullPtr(E);
+ case CK_MemberPointerToBoolean:
if (!this->visit(SubExpr))
return false;
- return this->emitIsNonNull(PtrT, E);
- }
+ return this->emitIsNonNullMemberPtr(E);
case CK_IntegralComplexToBoolean:
case CK_FloatingComplexToBoolean: {
``````````
</details>
https://github.com/llvm/llvm-project/pull/221516
More information about the cfe-commits
mailing list