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

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 7 09:53:01 PST 2025


================
@@ -46,21 +52,124 @@ void CIRGenFunction::emitAutoVarAlloca(const VarDecl &d) {
   address = createTempAlloca(allocaTy, alignment, loc, d.getName());
   declare(address.getPointer(), &d, ty, getLoc(d.getSourceRange()), alignment);
 
+  emission.Addr = address;
   setAddrOfLocalVar(&d, address);
+
+  return emission;
+}
+
+/// Determine whether the given initializer is trivial in the sense
+/// that it requires no code to be generated.
+bool CIRGenFunction::isTrivialInitializer(const Expr *init) {
----------------
andykaylor wrote:

I'm going to defer this for now, but I agree this could be moved. I just think we need a more solid plan for where to put such things. @dkolsen-pgi was looking into this, I believe.

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


More information about the cfe-commits mailing list