================ @@ -3581,8 +3582,10 @@ ConstantAddress CodeGenModule::GetAddrOfTemplateParamObject( isExternallyVisible(TPO->getLinkageAndVisibility().getLinkage()) ? llvm::GlobalValue::LinkOnceODRLinkage : llvm::GlobalValue::InternalLinkage; - auto *GV = new llvm::GlobalVariable(getModule(), Init->getType(), - /*isConstant=*/true, Linkage, Init, Name); + auto *GV = new llvm::GlobalVariable( + getModule(), Init->getType(), + /*isConstant=*/true, Linkage, Init, Name, nullptr, + llvm::GlobalValue::NotThreadLocal, GlobalsInt8PtrTy->getAddressSpace()); ---------------- AlexVlx wrote:
At the same time, it's not terribly costly (except for lines of code), and, unfortunately, there might be quite a few "broken" datalayouts (NVPTX is in the same boat, as is DirectX). I'm not entirely convinced the breakage is not an intentional design choice for pseudo/meta/abstract targets (abusing nomenclature, apologies). I'd submit that this (the changes/CodeGen) is still in Clang, which would still fall under the "the FE/language has to deal with ASes having special properties, LLVM shouldn't care", and it is an artifact of composing AS aware languages (OCL/CUDA/HIP etc.) with said abstract targets. https://github.com/llvm/llvm-project/pull/88182 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits