Displaying 2 results from an estimated 2 matches for "slotm1".
Did you mean:
slot1
2016 Feb 29
0
[cfe-dev] RFC: A new ABI for virtual calls, and a change to the virtual call representation in the IR
...i32 1)
> %slotp1 = add %slot, 1
> %result = insertvalue {i8*, i8*} {i8* 0, i8* 0}, 0, %slotp1
> ret {i8*, i8*} %result
> }
>
> define @callmfp(%A* %a, {i8*, i8*} %m) {
> ; assuming the call is virtual and no this adjustment
> %slot = extractvalue i8* %m, 0
> %slotm1 = sub %slot, 1
> %vtable = load i8* %a
> %fp = i8* @llvm.vtable.load.relative(%vtable, %slotm1)
> %casted_fp = bitcast i8* %fp to void (%A*)
> call void %casted_fp(%a)
> }
>
> !0 = {!"A", @A_vtable, 16}
> !1 = {!"B", @B_vtable, 16}
> !2 = {!&qu...
2016 Feb 29
10
RFC: A new ABI for virtual calls, and a change to the virtual call representation in the IR
...i32 @llvm.vtable.slot.offset(!"A", i32 1)
%slotp1 = add %slot, 1
%result = insertvalue {i8*, i8*} {i8* 0, i8* 0}, 0, %slotp1
ret {i8*, i8*} %result
}
define @callmfp(%A* %a, {i8*, i8*} %m) {
; assuming the call is virtual and no this adjustment
%slot = extractvalue i8* %m, 0
%slotm1 = sub %slot, 1
%vtable = load i8* %a
%fp = i8* @llvm.vtable.load.relative(%vtable, %slotm1)
%casted_fp = bitcast i8* %fp to void (%A*)
call void %casted_fp(%a)
}
!0 = {!"A", @A_vtable, 16}
!1 = {!"B", @B_vtable, 16}
!2 = {!"A", @C_vtable0, 16}
!3 = {!"B&q...