[PATCH] D72959: Relative VTables ABI on Fuchsia

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 24 10:48:29 PDT 2020


rjmccall 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.
----------------
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




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72959





More information about the cfe-commits mailing list