<div dir="ltr">Hi *,<div>I am working on a tool allowing to modify C++ source code (refactoring). I read in [1] that RefactoringTools is not the best choice in terms of performance, my codebase is quite huge. So I ended up with an implementation leveraging on clang Replacements, w/o RefactoringTools. </div><div>I have read code in [2] to figure out how to use such Replacements in ClangTool but I didn't get so much. </div><div>Could anyone point me out an example of how to use Replacements to rewrite/insert code (i.e., adding an include line at the beginning) without leveraging on RefactoringTool? I posted my demo code here [3]</div><div><br></div><div>thank you and happy hacking!</div><div><br></div><div><br></div><div>[1] <a href="https://chromium.googlesource.com/chromium/src/+/lkcr/docs/clang_tool_refactoring.md">https://chromium.googlesource.com/chromium/src/+/lkcr/docs/clang_tool_refactoring.md</a></div><div>[2] <a href="https://github.com/llvm-mirror/clang-tools-extra/blob/master/clang-apply-replacements/tool/ClangApplyReplacementsMain.cpp">https://github.com/llvm-mirror/clang-tools-extra/blob/master/clang-apply-replacements/tool/ClangApplyReplacementsMain.cpp</a><br clear="all"><div>[3] <a href="https://gist.github.com/vaioco/3ba0fbf2b0389eac47bb8c9012e83abf">https://gist.github.com/vaioco/3ba0fbf2b0389eac47bb8c9012e83abf</a></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><pre style="white-space:pre-wrap">Valerio Costamagna<br></pre></div></div></div></div>
</div></div>