================
@@ -2356,12 +2358,27 @@ CIRGenModule::getAddrOfConstantStringFromLiteral(const
StringLiteral *s,
cir::GlobalOp gv = getGlobalForStringLiteral(s, name);
auto arrayTy = mlir::dyn_cast<cir::ArrayType>(gv.getSymType());
assert(arrayTy && "String literal must be array");
- assert(!cir::MissingFeatures::addressSpace());
- cir::PointerType ptrTy = getBuilder().getPointerTo(arrayTy.getElementType());
+ cir::PointerType ptrTy = getBuilder().getPointerTo(
+ arrayTy.getElementType(),
+ getTypes().getPointerAddressSpace(s->getType()));
return builder.getGlobalViewAttr(ptrTy, gv);
}
+LangAS CIRGenModule::getGlobalConstantAddressSpace() const {
+ if (langOpts.OpenCL)
+ return LangAS::opencl_constant;
+ if (langOpts.SYCLIsDevice) {
+ errorNYI("SYCL global constant address space");
----------------
Fznamznon wrote:
I wonder if that NYI is a big deal?
Otherwise we could move that function to CodeGenUtils since it does the same as
OGCG version and has nothing to do with CIR aside from this NYI.
https://github.com/llvm/llvm-project/pull/226996
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits