[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
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150901/5da3a0e3/attachment.html>


More information about the cfe-dev mailing list