================
@@ -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:

> replace CallOp with IterBeginOp, we could just add an attribute to the CallOp 
> saying that it's a begin iterator during codegen, similar to how 
> ctor/dtor/assign are being handled.

The tradeoff here is how many such attributes we want to have and how much 
flexibility we would like to have on specializing them. For example, we could 
have a IterOp that also has begin() and end() methods, or extra ones for 
checking whether it's const. Any new needed information on iterators we can 
change IterOp directly, not affecting any CallOp user. If we use attributes on 
CallOp for that, we have to express directly in the call all of those 
informations, probably adding more than one attribute, or robust ones. Feels 
more MLIR-like to me to encode as a new operation in this specific case. IMO 
special member functions are in a different category, and I feel like they are 
good where they are.

https://github.com/llvm/llvm-project/pull/172486
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to