<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Jun 4, 2014 at 3:30 AM, Daniel Dilts <span dir="ltr"><<a href="mailto:diltsman@gmail.com" target="_blank">diltsman@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div><div dir="ltr">Is there a way to modify multiple locations if a given check finds an issue? My use case is I am checking for class naming conventions.<br> <br>If the check finds a declaration I can figure out how to modify the name at the declaration, but I want to also change all usages at the same time.<br>
</div></div>
</blockquote></div><br>
</div><div class="gmail_extra">It's possible to supply several FixItHints, and they can be in any source files known to SourceManager. I didn't check, but this should work, and if it doesn't, I'll fix it.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">But you're going to face another problem as well: usages of a class or its members may be spread over many translation units, and clang-tidy's support of the multiple-TU use-case is rudimentary at the moment. While you can run the clang-tidy binary on several translation units, and it will even deduplicate error reports by code location, there are still many things to do in this land:</div>
<div class="gmail_extra"> * We'll need a way to run over all translation units in the compilations database, so that clang-tidy can be sure it sees all the code, and that the changes it makes are complete.</div><div class="gmail_extra">
* We'll need a way to separate analysis from the actual application of generated fixes, so that one could run several clang-tidy processes in parallel to speed up the refactoring.</div><div class="gmail_extra"> * We'd also need not only to deduplicate changes, but also check all the changes for mutual compatibility - this is not specific to multi-TU use-case, but with multiple TUs chances to get incompatible changes are higher.<br>
</div><div class="gmail_extra"><br></div><div class="gmail_extra">I'm probably missing something else that would be important for the multiple-TU case.</div></div>