[clang] [CIR][CodeGen] Replace errorNYI with assert for address space in emitAutoVarAlloca (PR #197506)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Fri May 29 14:55:07 PDT 2026


================
@@ -32,8 +32,9 @@ CIRGenFunction::AutoVarEmission
 CIRGenFunction::emitAutoVarAlloca(const VarDecl &d,
                                   mlir::OpBuilder::InsertPoint ip) {
   QualType ty = d.getType();
-  if (ty.getAddressSpace() != LangAS::Default)
-    cgm.errorNYI(d.getSourceRange(), "emitAutoVarAlloca: address space");
+  assert(
+      ty.getAddressSpace() == LangAS::Default ||
+      (ty.getAddressSpace() == LangAS::opencl_private && getLangOpts().OpenCL));
----------------
andykaylor wrote:

This looks much more specific than I was expecting, but I see that it matches the assert in classic codegen, so I guess it's OK.

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


More information about the cfe-commits mailing list