ratzdi wrote: > > Hello. `prepare()` should be fast. It is used to determine whether or not a > > tweak can be applied. Heavy operations should only take place within > > `apply()`. In current implementation `prepare()` is not fast. E.g. > > `ReplaceQualifiedWithAlias::prepare()` does full AST traversal (and after > > that we do this full AST traversal again in `apply()`). > > It seems we still traverses the full AST in > `ReplaceQualifiedWithAlias::prepare()`, full AST traversal happens inside > `collectVisibleContexts()`. And calling `collectVisibleContexts()` inside > `ProcessDecl` leads to `O(N^2)` (or maybe `O(N^3)`? because `ProcessDecl` is > recursive) complexity at `apply()`. > > So, this still looks too heavy to be a tweak, because originally tweak is a > fast code action.
Hi @ArcsinX, thank You for the insightful comment. I have fixed the issue mentioned. https://github.com/llvm/llvm-project/pull/204151 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
