[clang] [clang][bytecode][NFC] Use `Block::deref()` in `EvalEmitter` (PR #178630)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 29 02:48:22 PST 2026
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Timm Baeder (tbaederr)
<details>
<summary>Changes</summary>
Instead of doing the casting around `Block::data()` ourselves.
---
Full diff: https://github.com/llvm/llvm-project/pull/178630.diff
1 Files Affected:
- (modified) clang/lib/AST/ByteCode/EvalEmitter.cpp (+2-2)
``````````diff
diff --git a/clang/lib/AST/ByteCode/EvalEmitter.cpp b/clang/lib/AST/ByteCode/EvalEmitter.cpp
index cf3cc1b17133c..7d44c32d73555 100644
--- a/clang/lib/AST/ByteCode/EvalEmitter.cpp
+++ b/clang/lib/AST/ByteCode/EvalEmitter.cpp
@@ -293,7 +293,7 @@ bool EvalEmitter::emitGetLocal(uint32_t I, SourceInfo Info) {
if (!CheckLocalLoad(S, OpPC, B))
return false;
- S.Stk.push<T>(*reinterpret_cast<T *>(B->data()));
+ S.Stk.push<T>(B->deref<T>());
return true;
}
@@ -305,7 +305,7 @@ bool EvalEmitter::emitSetLocal(uint32_t I, SourceInfo Info) {
using T = typename PrimConv<OpType>::T;
Block *B = getLocal(I);
- *reinterpret_cast<T *>(B->data()) = S.Stk.pop<T>();
+ B->deref<T>() = S.Stk.pop<T>();
auto &Desc = B->getBlockDesc<InlineDescriptor>();
Desc.IsInitialized = true;
``````````
</details>
https://github.com/llvm/llvm-project/pull/178630
More information about the cfe-commits
mailing list