jfb marked an inline comment as done.
jfb added inline comments.

================
Comment at: lib/CodeGen/CGBuilder.h:260
+                            CharUnits::fromQuantity(Offset.getSExtValue())));
+  }
+
----------------
efriedma wrote:
> Not sure about the new helper.  We already have CreateStructGEP and 
> CreateConstArrayGEP which do approximately what you want.
It's close to doing what we want, but not quite? It seems like the original 
code would have used them otherwise.

To use them we'd have to:

  - branch on struct / array
    - for struct calculate the offset there (which the new helper does)
    - for array get the element size

Seems simpler to use GEP2_32 and more fool-proof to (internal to the helper) 
use GEP's own idea of what the offset is, no?


Repository:
  rC Clang

https://reviews.llvm.org/D49209



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

Reply via email to