[clang] [CIR] Emit init of local variables (PR #130164)

Henrich Lauko via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 6 12:06:07 PST 2025


================
@@ -94,10 +203,59 @@ void CIRGenFunction::emitVarDecl(const VarDecl &d) {
 
   assert(d.hasLocalStorage());
 
-  assert(!cir::MissingFeatures::opAllocaVarDeclContext());
+  CIRGenFunction::VarDeclContext varDeclCtx{*this, &d};
   return emitAutoVarDecl(d);
 }
 
+void CIRGenFunction::emitScalarInit(const Expr *init, mlir::Location loc,
+                                    LValue lvalue, bool capturedByInit) {
+  Qualifiers::ObjCLifetime lifetime = Qualifiers::ObjCLifetime::OCL_None;
----------------
xlauko wrote:

Why not:
```
  Qualifiers::ObjCLifetime lifetime = lvalue.getObjCLifetime();
```
as in main codegen?

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


More information about the cfe-commits mailing list