ymandel added a comment.

Thanks for expanding the description, including the helpful example.  I'm not 
sure, though, that this is the "right" behavior, at least not always. Worse, 
I'm not sure there is a single "right" behavior. I can easily imagine a tidy 
that matches multiple times in the same TU and tries, therefore, to apply the 
same fix multiple times, even though it wants at most one (and possibly an 
error).  The major problem is that character-level (versus AST level) edits 
simply don't compose. So, multiple edits on a file are always suspect.  Could 
you also give an example (in terms of code changes, not YAML) of why this comes 
up? As in, are we sure that the problem lies in the algorithm here, rather than 
in the phrasing of the transformation itself?

That said, based on some of your linked bugs, it sounds like your change would 
make the behavior here consistent with the behavior in another situation (when 
clang-tidy applies the edits directly rather than outputting to YAML?).  
Consistency could be a strong argument in favor of this change.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76054/new/

https://reviews.llvm.org/D76054



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to