[clang] [clang] Add builtin_get_vtable_pointer and virtual_member_address (PR #135469)
Oliver Hunt via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 15 13:31:24 PDT 2025
================
@@ -5349,6 +5350,40 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
return RValue::get(Result);
}
+ case Builtin::BI__builtin_virtual_member_address: {
+ Address This = EmitLValue(E->getArg(0)).getAddress();
+ APValue ConstMemFun;
+ E->getArg(1)->isCXX11ConstantExpr(getContext(), &ConstMemFun, nullptr);
----------------
ojhunt wrote:
Yes, the isCXX11ConstantExpr gives us the target through ConstMemFun, but I'll see if there's a cleaner way to do this.
https://github.com/llvm/llvm-project/pull/135469
More information about the cfe-commits
mailing list