Displaying 4 results from an estimated 4 matches for "virtual_method2".
2013 May 10
0
[LLVMdev] [cfe-dev] "load groups" IR feature to improve C++ devirtualization
...ature I'd like to take advantage of which would let us perform elimination of more vptr loads. In this code:
> >
> > Cls *p = new Cls;
> > p->virtual_method1();
> > p->method_changing_vptr(); // uses placement new to legally change the vptr
> > p->virtual_method2(); // invalid!
> > Cls *q = p;
> > q->virtual_method2(); // this must get a new vptr lookup.
>
> I bungled my example, and I want to fix that first. I was thinking:
>
> Derived *p = new Derived;
> p->virtual_method1();
> p->method_changing_vptr()...
2013 May 10
0
[LLVMdev] [cfe-dev] "load groups" IR feature to improve C++ devirtualization
...ere a language in C++ feature I'd like to take advantage of which would let us perform elimination of more vptr loads. In this code:
>
> Cls *p = new Cls;
> p->virtual_method1();
> p->method_changing_vptr(); // uses placement new to legally change the vptr
> p->virtual_method2(); // invalid!
> Cls *q = p;
> q->virtual_method2(); // this must get a new vptr lookup.
This is not how I understand the [basic.life] rules. The question is whether a pointer value, reference, or name is formally forwarded to point to the new object. Because the dynamic type is d...
2013 May 10
4
[LLVMdev] "load groups" IR feature to improve C++ devirtualization
...lization in clang, and there a
language in C++ feature I'd like to take advantage of which would let us
perform elimination of more vptr loads. In this code:
Cls *p = new Cls;
p->virtual_method1();
p->method_changing_vptr(); // uses placement new to legally change the
vptr
p->virtual_method2(); // invalid!
Cls *q = p;
q->virtual_method2(); // this must get a new vptr lookup.
there is no need to reload p's vptr, even if the method did update the vptr.
C++ [basic.life] gives us a guarantee that a pointer will only update to
point to a new object allocated at the same place...
2013 May 10
4
[LLVMdev] [cfe-dev] "load groups" IR feature to improve C++ devirtualization
...9;d like to take advantage of which would let us
> perform elimination of more vptr loads. In this code:
> >
> > Cls *p = new Cls;
> > p->virtual_method1();
> > p->method_changing_vptr(); // uses placement new to legally change
> the vptr
> > p->virtual_method2(); // invalid!
> > Cls *q = p;
> > q->virtual_method2(); // this must get a new vptr lookup.
>
I bungled my example, and I want to fix that first. I was thinking:
Derived *p = new Derived;
p->virtual_method1();
p->method_changing_vptr(); // uses placement new...