Displaying 2 results from an estimated 2 matches for "callmfp".
Did you mean:
callme
2016 Feb 29
0
[cfe-dev] RFC: A new ABI for virtual calls, and a change to the virtual call representation in the IR
...> virtual void f();
> virtual void g();
> virtual void h();
> };
>
> void fcall(A *a) {
> a->f();
> }
>
> void gcall(A *a) {
> a->g();
> }
>
> typedef void (A::*mfp)();
>
> mfp getmfp() {
> return &A::g;
> }
>
> void callmfp(A *a, mfp m) {
> (a->*m)();
> }
>
> In IR:
>
> @A_vtable = {i8*, i8*, i32, i32} {0, @A::rtti, @A::f - (@A_vtable + 16),
> @A::g - (@A_vtable + 16)}
> @B_vtable = {i8*, i8*, i32} {0, @B::rtti, @B::h - (@B_vtable + 16)}
> @C_vtable0 = {i8*, i8*, i32, i32, i32} {0, @C::...
2016 Feb 29
10
RFC: A new ABI for virtual calls, and a change to the virtual call representation in the IR
...virtual void f();
virtual void g();
};
struct B {
virtual void h();
};
struct C : A, B {
virtual void f();
virtual void g();
virtual void h();
};
void fcall(A *a) {
a->f();
}
void gcall(A *a) {
a->g();
}
typedef void (A::*mfp)();
mfp getmfp() {
return &A::g;
}
void callmfp(A *a, mfp m) {
(a->*m)();
}
In IR:
@A_vtable = {i8*, i8*, i32, i32} {0, @A::rtti, @A::f - (@A_vtable + 16), @A::g - (@A_vtable + 16)}
@B_vtable = {i8*, i8*, i32} {0, @B::rtti, @B::h - (@B_vtable + 16)}
@C_vtable0 = {i8*, i8*, i32, i32, i32} {0, @C::rtti, @C::f - (@C_vtable0 + 16), @C::g - (@...