[clang] [clang] Recover necessary AddrSpaceCast (PR #119246)

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 12 02:05:08 PST 2024


================
@@ -3302,6 +3302,9 @@ void ItaniumCXXABI::EmitThreadLocalInitFuncs(
       CharUnits Align = CGM.getContext().getDeclAlign(VD);
       Val = Builder.CreateAlignedLoad(Var->getValueType(), Val, Align);
     }
+    if (Val->getType() != Wrapper->getReturnType()) {
+      Val = Builder.CreateAddrSpaceCast(Val, Wrapper->getReturnType());
+    }
----------------
arsenm wrote:

Don't think you need the condition, CreateAddrSpaceCast should be a no-op if the types match 

https://github.com/llvm/llvm-project/pull/119246


More information about the cfe-commits mailing list