rsmith added inline comments.

================
Comment at: lib/CodeGen/CGExprCXX.cpp:1887
+            Dtor = DevirtualizedDtor;
+            Ptr = CGF.EmitPointerWithAlignment(Inner);
+          } else {
----------------
yamauchi wrote:
> rsmith wrote:
> > In this case we'll emit the inner expression (including its side-effects) 
> > twice.
> > 
> > The simplest thing to do would be to just drop this `else if` case for now 
> > and add a FIXME.
> I'd go with that. I assume there isn't a simple way to adjust the this 
> pointer of a base class given a derived class? Sort of like 
> CodeGenFunction::GetAddressOfDerivedClass?
> 
I don't think we have anything quite like that. This won't be possible in the 
general case: there could be more than one base class of the current type 
within the derived class, so you'd need to take into account the path that the 
base expression took to reach the inner expression with the known dynamic type. 
(We could opportunistically do this in the common case where the derived class 
has only one base class of the base type, and it's a non-virtual base, but I 
don't think we have any existing code to do that either.)


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63161/new/

https://reviews.llvm.org/D63161



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to