[cfe-dev] RefactoringTool corrupts source file
Manuel Klimek via cfe-dev
cfe-dev at lists.llvm.org
Tue Sep 1 04:58:25 PDT 2015
On Mon, Aug 31, 2015 at 10:07 PM Daniel Dilts via cfe-dev <
cfe-dev at lists.llvm.org> wrote:
> I have a pair of FrontEndActions that I am running against a source file.
> The first one modifies the token stream. The second one modifies the AST.
> I am running them both using the same RefactoringTool instance. When both
> actions modify the source it corrupts the file. Looking at it more closely
> it appears to be caused by runAndSave() not clearing out
> RefactoringTool::Replace after applying the replacements.
> Should runAndSave() clear the replacements collection after applying them
> or is the current behavior correct?
So far I never thought of anybody wanting to call runAndSave multiple
times. If we can make it work, you're right, we should clear the
replacements in between - feel free to send me a patch to that end :)
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-dev