[clang] [CIR] Run the CIR lowering pipeline without a live ASTContext and accept serialized .cir as cc1 input (PR #219048)

Bruno Cardoso Lopes via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 1 18:56:34 PDT 2026


================
@@ -7,6 +7,10 @@ set(LLVM_LINK_COMPONENTS
 
 get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
 
+# CIRGenAction reaches into the Transforms-private LowerModule helper to
+# stand up the AST-free LoweringPrepare pipeline.
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../Dialect/Transforms)
----------------
bcardosolopes wrote:

This is the part I'd push back on hardest. Two libraries now `-I` into another library's source dir to get at a private header, and the comment here says so out loud (same thing in `Lowering/CMakeLists.txt`).

If `LowerModule` is what CIRGen and the lowering pipeline agree on, it's an interface, so put it in `clang/include/clang/CIR/` and depend on it properly. Reaching in with `include_directories` gets you a dependency that doesn't show up in the build graph and that nobody will notice breaking.

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


More information about the cfe-commits mailing list