[clang] [CIR] Make ASTContext optional in runCIRToCIRPasses (PR #227128)
Konstantinos Parasyris via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 30 17:00:54 PDT 2026
koparasy wrote:
@bcardosolopes Done, the `ASTContext` parameter and the `LoweringPrepare` plumbing are gone. I dropped `clangAST` from `MLIRCIRTransforms` (CharUnits are header only in libopt.). I checked a shared-libs build: libMLIRCIRTransforms.so needs no symbols from libclangAST.so.
The library still gets `clangAST` transitively through MLIRCIR. That one is a real dependency. The only cause is `#cir.var.decl`: its `ASTVarDeclInterface` default methods call into `clang::VarDecl`, which lands in libMLIRCIR.so. Nothing reads the attribute today; CIRGen only sets it in CIRGenCXX.cpp. Dropping it (along with the CIR_AST class and ASTAttrInterfaces) should remove the dialect's last link to clangAST. That's doable, at some point we discussed to not do so. I leave it as is for now, and we can address this in a follow-up PR.
https://github.com/llvm/llvm-project/pull/227128
More information about the cfe-commits
mailing list