LGTM.
================
Comment at: cpp11-migrate/Core/FileOverrides.cpp:207
@@ +206,3 @@
+ // replacement inside range -> resize the range
+ if (Range.contains(Replace)) {
+ int Difference = ReplaceNewSize - Replace.getLength();
----------------
Guillaume Papin wrote:
> Edwin Vane wrote:
> > Why change the range at all? If a replacement is completely within an
> > existing range, the part of the range outside of the replacement is still
> > something that has changed right?
> Yes you are right it is changed. What I'm doing here is resizing the range so
> it takes the replacement into account.
>
> Let's say we have a range: `Range(/*offset=*/0, /*length=*/5)`
> And a replacement: `Replacement(/*offset=*/2, /*length=*/1,
> /*replacement-text=*/"~~~")`
>
> The replacement deletes 1 character but adds 3 new characters, a difference
> of +2 characters.
> That's why I'm resizing the range to take the new characters into account,
> final range is `Range(0, 7)`.
Ah yes. of course.
http://llvm-reviews.chandlerc.com/D1136
BRANCH
libformat-integration-2
ARCANIST PROJECT
clang-tools-extra
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits