[clang] [clang][bytecode] Add opaque pointers to support type-only pointers (PR #213017)
Oliver Hunt via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 19 23:14:26 PDT 2026
================
@@ -1221,3 +1254,172 @@ IntPointer IntPointer::baseCast(const interp::Context &Ctx,
std::nullopt, RD, false);
return {T.getTypePtr(), Value + BaseLayoutOffset.getQuantity()};
}
+
+std::optional<size_t>
+OpaquePointer::computeLayoutOffset(const ASTContext &ASTCtx) const {
----------------
ojhunt wrote:
I just had a dream of a faster access path in the interpreter, ah well :(
I wish there was some direct way to verify compatible layout, oh well.
Can bitfields effect this? you can't in principle get the offset of a bit field but I don't know if it's possible to construct a code path that could reach here in such a position. In principle I would expect sema to have already rejected that before evaluation happens.
https://github.com/llvm/llvm-project/pull/213017
More information about the cfe-commits
mailing list