<div dir="ltr"><div class="gmail_default" style>On Sun, Jan 13, 2013 at 9:25 PM, Sean Silva <span dir="ltr"><<a href="mailto:silvas@purdue.edu" target="_blank">silvas@purdue.edu</a>></span> wrote:<br></div><div class="gmail_extra">
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Tooling folks, I have a quick question about making changes to<br>
headers with a clang tool.<br>
<br>
Suppose the following basic setup:<br>
<br>
- I have a compile_commands.json for a project.<br>
- I have a tool that renames class Foo to Bar.<br>
<br>
So if Foo appears in headers, how do occurrences of Foo in headers get renamed?<br>
<br>
To my understanding, the compile_commands.json only tracks the ".cpp"<br>
files that are compiled, rather than each source file in the project.<br>
This makes me wonder:<br>
<br>
- How will a tool will ensure that Foo only gets renamed once if it is<br>
in a header that is included multiple times?<br></blockquote><div><br></div><div style>If you use the RefactoringTool, adding Replacement's will auto-deduplicate.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

- Once Foo gets renamed in a header, how will the other files that<br>
have yet to be processed still see the old name (the new name would<br>
cause a compilation failure since the references in the other ".cpp"<br>
file will not have yet been renamed).<br></blockquote><div><br></div><div style>Use RefactoringTool and make all your replacements in a single tool-run. It will apply all changes in the very end.</div><div style><br></div>
<div style>Cheers,</div><div style>/Manuel</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Is there a "standard" way to deal with this?<br>
<span class="HOEnZb"><font color="#888888"><br>
-- Sean Silva<br>
</font></span></blockquote></div><br></div></div>