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


================
Comment at: clang/lib/CodeGen/CGVTables.cpp:623
+    llvm::Constant *C, llvm::GlobalVariable *VTable, unsigned vtableIdx,
+    unsigned lastAddrPoint) const {
+  // No need to get the offset of a nullptr.
----------------
rjmccall wrote:
> There's already an `addRelativeOffset` on `ConstantArrayBuilder`; is that 
> insufficient for some reason?  I think that, if v-table building were 
> refactored so that the places that build components also add them to the 
> v-table, we'd end up with a lot more flexibility for the ABIs.  We needed a 
> similar sort of change for pointer authentication, which we haven't 
> upstreamed to LLVM yet, but which you can see here:
> 
> https://github.com/apple/llvm-project/blob/apple/master/clang/lib/CodeGen/CGVTables.cpp
> 
> 
I actually did not know about this method, but it does seem to boil down to the 
same arithmetic used here. Will update to see if I can use the existing 
builders instead.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72959



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

Reply via email to