[llvm-branch-commits] [clang] [CIR] Add CIRGen support for static local variables with non-constant initializers (PR #179827)

Andy Kaylor via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Feb 5 10:10:02 PST 2026


andykaylor wrote:

> > The adding of the AST ref to the IR is quite unfortunate, presumably this is intended to be removed in the future?
> 
> The intent is to the keep the AST around - which shouldn't preclude raising CIR or enhancing operations whenever it makes sense. This something we learned from Swift, which keeps AST around in SIL and use that for analysis / optimizations (there's a whole backlog/background for that in the RFCs).
> 
> The AST is too big to be entirely replicated in CIR, and it's super handy to have around if we want to progressively lower CIR.

Oh! I starting to understand this a bit better. When I was working on the pointer-to-member stuff, there was a case (with pointer-to-virtual-function, I think) where we were having to call into the target-specific CXXABI to get some information for our current representation. I didn't like that and made a mental note that we need to uplevel that, but that required information from the AST so I didn't know how we would get that after codegen. Now I do!

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


More information about the llvm-branch-commits mailing list