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

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

Reply via email to