[clang] [CIR] Initial upstreaming of idiom recognizer pass (PR #172486)

Bruno Cardoso Lopes via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 13 14:54:41 PST 2026


================
@@ -27,6 +27,8 @@ std::unique_ptr<Pass> createHoistAllocasPass();
 std::unique_ptr<Pass> createLoweringPreparePass();
 std::unique_ptr<Pass> createLoweringPreparePass(clang::ASTContext *astCtx);
 std::unique_ptr<Pass> createGotoSolverPass();
+std::unique_ptr<Pass> createIdiomRecognizerPass();
+std::unique_ptr<Pass> createIdiomRecognizerPass(clang::ASTContext *astCtx);
----------------
bcardosolopes wrote:

> whether it would be possible to generate CIR from a non-Clang C++ front end, and I think that in principle such a thing should be possible, with the caveat that there would be a lot of work required by anyone who wanted to do such a thing.

I agree in principle but I'm not too worried about those users yet, my personal take is that it should serve Clang well first, but community pushes into that direction in the future we'll need to take into consideration how much we want to bloat Clang with AST information, or investigate other solutions.

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


More information about the cfe-commits mailing list