[PATCH] D101156: [Clang] Support a user-defined __dso_handle

Andrew Savonichev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jun 6 14:58:31 PDT 2021


asavonic added inline comments.


================
Comment at: clang/lib/CodeGen/CodeGenModule.cpp:4425
+  if (ReplaceInitWithGV)
+    Init = llvm::ConstantExpr::getBitCast(GV, GV->getValueType());
+
----------------
rjmccall wrote:
> Can we actually do this bitcast for arbitrary initializers?  This seems problematic.
> 
> I think we just need to hold `Init` in an `llvm::TrackingVH` across the call to `GetAddrOfGlobalVar`.
Thanks a lot! `TrackingVH` works great, with a few adjustments because it cannot be checked for nullptr.


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

https://reviews.llvm.org/D101156



More information about the cfe-commits mailing list