From: Eric Liu Date: Mon, 3 Oct 2016 19:14:30 +0000 (+0000) Subject: Added more comments to tooling::Replacements. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3aadb130cda5fc61b873ba7b05bdd070a570dbf5;p=clang Added more comments to tooling::Replacements. Summary: Also test phabricator commit processing. Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D25207 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@283135 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Tooling/Core/Replacement.h b/include/clang/Tooling/Core/Replacement.h index 82f1716e60..e57afc7f85 100644 --- a/include/clang/Tooling/Core/Replacement.h +++ b/include/clang/Tooling/Core/Replacement.h @@ -176,6 +176,8 @@ class Replacements { /// - are insertions at the same offset and applying them in either order /// has the same effect, i.e. X + Y = Y + X when inserting X and Y /// respectively. + /// - are identical replacements, i.e. applying the same replacement twice + /// is equivalent to applying it once. /// Examples: /// 1. Replacement A(0, 0, "a") and B(0, 0, "aa") are order-independent since /// applying them in either order gives replacement (0, 0, "aaa"). @@ -186,6 +188,8 @@ class Replacements { /// since applying them in either order gives (0, 2, "123"). /// 3. Replacement A(0, 3, "123") and B(2, 3, "321") are order-independent /// since either order gives (0, 5, "12321"). + /// 4. Replacement A(0, 3, "ab") and B(0, 3, "ab") are order-independent since + /// applying the same replacement twice is equivalent to applying it once. /// Replacements with offset UINT_MAX are special - we do not detect conflicts /// for such replacements since users may add them intentionally as a special /// category of replacements.