summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Rewrite/RewriteRope.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/Rewrite/RewriteRope.cpp b/clang/lib/Rewrite/RewriteRope.cpp
index 30bbcfafb53..bd99732dc87 100644
--- a/clang/lib/Rewrite/RewriteRope.cpp
+++ b/clang/lib/Rewrite/RewriteRope.cpp
@@ -798,9 +798,8 @@ RopePiece RewriteRope::MakeRopeString(const char *Start, const char *End) {
memcpy(AllocBuffer->Data, Start, Len);
AllocOffs = Len;
- // Start out the new allocation with a refcount of 1, since we have an
- // internal reference to it.
- AllocBuffer->addRef();
+ // Return a RopePiece that wraps 'AllocBuffer'. The constructor of RopePiece
+ // will increment the reference count of AllocBuffer.
return RopePiece(AllocBuffer, 0, Len);
}
OpenPOWER on IntegriCloud