[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cfe-dev
Subject:    [cfe-dev] RefactoringTool corrupts source file
From:       Daniel Dilts via cfe-dev <cfe-dev () lists ! llvm ! org>
Date:       2015-08-31 20:07:16
Message-ID: CANgHf=wjX8=XN4pgnswjCouhiS+rgeEeqW4cUDamYOVknoz3qg () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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?

[Attachment #5 (text/html)]

<div dir="ltr"><div>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.</div><div><br></div><div>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.</div><div><br></div><div>Should runAndSave() clear the replacements \
collection after applying them or is the current behavior correct?</div></div>


[Attachment #6 (text/plain)]

_______________________________________________
cfe-dev mailing list
cfe-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic