[clang] [CIR] Make ASTContext optional in runCIRToCIRPasses (PR #227128)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 28 17:04:41 PDT 2026


================
@@ -111,15 +122,14 @@ runCIRToCIRPasses(mlir::ModuleOp theModule, mlir::MLIRContext &mlirContext,
   // outlines dynamic global initializers into functions.  It must run before
   // CallConvLowering so the classifier sees them, otherwise their signatures
   // go unclassified and caller and callee disagree on the ABI.
-  pm.addPass(mlir::createLoweringPreparePass(&astContext));
+  pm.addPass(mlir::createLoweringPreparePass(astContext));
----------------
andykaylor wrote:

Do we need this to be passed through to `LoweringPreparePass`? I was just thinking we needed it in `runCIRToCIRPasses`. It's probably more likely to be used in `createLibOptPass` where it was already dead. Sorry to be fickle about this. I'm just not sure what @bcardosolopes needs.

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


More information about the cfe-commits mailing list