[clang] [OpenCL] Put constant initializer globals into constant addrspace (PR #90048)
Sven van Haastregt via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 30 04:26:07 PDT 2024
================
@@ -535,20 +535,24 @@ void AggExprEmitter::EmitArrayInit(Address DestPtr, llvm::ArrayType *AType,
elementType.isTriviallyCopyableType(CGF.getContext())) {
CodeGen::CodeGenModule &CGM = CGF.CGM;
ConstantEmitter Emitter(CGF);
- LangAS AS = ArrayQTy.getAddressSpace();
+ QualType GVArrayQTy = ArrayQTy;
+ if (!GVArrayQTy.hasAddressSpace())
+ GVArrayQTy = CGM.getContext().getAddrSpaceQualType(
----------------
svenvh wrote:
Thanks, updated.
https://github.com/llvm/llvm-project/pull/90048
More information about the cfe-commits
mailing list