This revision was automatically updated to reflect the committed changes.
Closed by commit rL273290: Added calculateRangesAfterReplaments() to calculate
affacted ranges in theā¦ (authored by ioeric).
Changed prior to commit:
http://reviews.llvm.org/D21547?vs=61405=61407#toc
Repository:
rL
ioeric added inline comments.
Comment at: lib/Tooling/Core/Replacement.cpp:285
@@ +284,3 @@
+[](const Range , const Range ) -> bool {
+ if (LHS.getOffset() != RHS.getOffset())
+return LHS.getOffset() < RHS.getOffset();
ioeric updated this revision to Diff 61405.
ioeric marked 2 inline comments as done.
ioeric added a comment.
- removed redundant return type in lambda function.
http://reviews.llvm.org/D21547
Files:
include/clang/Tooling/Core/Replacement.h
lib/Tooling/Core/Replacement.cpp
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
A couple of small comments, otherwise looks good.
Comment at: lib/Tooling/Core/Replacement.cpp:284
@@ +283,3 @@
+ std::sort(Ranges.begin(), Ranges.end(),
+
ioeric added inline comments.
Comment at: include/clang/Tooling/Core/Replacement.h:69
@@ +68,3 @@
+ /// \brief Whether this range equals to \p RHS or not.
+ bool operator==(const Range ) const {
+return Offset == RHS.getOffset() && Length == RHS.getLength();
ioeric updated this revision to Diff 61375.
ioeric marked 5 inline comments as done and an inline comment as not done.
ioeric added a comment.
- Addressed reviewer's comments.
http://reviews.llvm.org/D21547
Files:
include/clang/Tooling/Core/Replacement.h
lib/Tooling/Core/Replacement.cpp
djasper added a comment.
Nice :)
Comment at: include/clang/Tooling/Core/Replacement.h:62
@@ +61,3 @@
+ /// \brief Whether this range is less-than \p RHS or not.
+ bool operator<(const Range ) const {
+if (Offset != RHS.getOffset())
Can we just add a
ioeric added inline comments.
Comment at: include/clang/Tooling/Core/Replacement.h:253
@@ +252,3 @@
+std::vector
+calculateRangesAfterReplacements(const Replacements ,
+ const std::vector );
getShiftedRanges sounds like it's
ioeric updated this revision to Diff 61359.
ioeric marked 6 inline comments as done.
ioeric added a comment.
- Use mergeReplacements to calculate the new affected ranges.
http://reviews.llvm.org/D21547
Files:
include/clang/Tooling/Core/Replacement.h
lib/Tooling/Core/Replacement.cpp
djasper added inline comments.
Comment at: include/clang/Tooling/Core/Replacement.h:68
@@ +67,3 @@
+/// \brief Less-than operator between two Ranges.
+bool operator<(const Range , const Range );
+
Can we keep these private for now?
Comment at:
ioeric updated this revision to Diff 61340.
ioeric added a comment.
- fixed commenting.
http://reviews.llvm.org/D21547
Files:
include/clang/Tooling/Core/Replacement.h
lib/Tooling/Core/Replacement.cpp
unittests/Tooling/RefactoringTest.cpp
Index: unittests/Tooling/RefactoringTest.cpp
ioeric created this revision.
ioeric added reviewers: djasper, klimek.
ioeric added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
Added calculateRangesAfterReplaments() to calculate original ranges as well as
newly affacted ranges in the new code.
http://reviews.llvm.org/D21547
12 matches
Mail list logo