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

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 3 18:36:24 PDT 2021


rjmccall added inline comments.


================
Comment at: clang/lib/CodeGen/CodeGenModule.cpp:4425
+  if (ReplaceInitWithGV)
+    Init = llvm::ConstantExpr::getBitCast(GV, GV->getValueType());
+
----------------
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`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101156



More information about the cfe-commits mailing list