diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2010-07-14 23:19:41 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2010-07-14 23:19:41 +0000 |
commit | 8d5609b6044b75c760d8ca705d364cca9fb29da9 (patch) | |
tree | 512a3953515a38d768571abfa798c3b2a10c668a /clang/lib/Rewrite/Rewriter.cpp | |
parent | 5f0e252f635ab98060f6eb8e51babf6767064a8d (diff) | |
download | llvm-8d5609b6044b75c760d8ca705d364cca9fb29da9.zip llvm-8d5609b6044b75c760d8ca705d364cca9fb29da9.tar.gz llvm-8d5609b6044b75c760d8ca705d364cca9fb29da9.tar.bz2 |
Pass StringRefs by value.
llvm-svn: 108375
Diffstat (limited to 'clang/lib/Rewrite/Rewriter.cpp')
-rw-r--r-- | clang/lib/Rewrite/Rewriter.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Rewrite/Rewriter.cpp b/clang/lib/Rewrite/Rewriter.cpp index 8b0bf91..92e2b03 100644 --- a/clang/lib/Rewrite/Rewriter.cpp +++ b/clang/lib/Rewrite/Rewriter.cpp @@ -40,7 +40,7 @@ void RewriteBuffer::RemoveText(unsigned OrigOffset, unsigned Size) { AddReplaceDelta(OrigOffset, -Size); } -void RewriteBuffer::InsertText(unsigned OrigOffset, const llvm::StringRef &Str, +void RewriteBuffer::InsertText(unsigned OrigOffset, llvm::StringRef Str, bool InsertAfter) { // Nothing to insert, exit early. @@ -57,7 +57,7 @@ void RewriteBuffer::InsertText(unsigned OrigOffset, const llvm::StringRef &Str, /// buffer with a new string. This is effectively a combined "remove+insert" /// operation. void RewriteBuffer::ReplaceText(unsigned OrigOffset, unsigned OrigLength, - const llvm::StringRef &NewStr) { + llvm::StringRef NewStr) { unsigned RealOffset = getMappedOffset(OrigOffset, true); Buffer.erase(RealOffset, OrigLength); Buffer.insert(RealOffset, NewStr.begin(), NewStr.end()); @@ -185,7 +185,7 @@ RewriteBuffer &Rewriter::getEditBuffer(FileID FID) { /// InsertText - Insert the specified string at the specified location in the /// original buffer. -bool Rewriter::InsertText(SourceLocation Loc, const llvm::StringRef &Str, +bool Rewriter::InsertText(SourceLocation Loc, llvm::StringRef Str, bool InsertAfter) { if (!isRewritable(Loc)) return true; FileID FID; @@ -207,7 +207,7 @@ bool Rewriter::RemoveText(SourceLocation Start, unsigned Length) { /// buffer with a new string. This is effectively a combined "remove/insert" /// operation. bool Rewriter::ReplaceText(SourceLocation Start, unsigned OrigLength, - const llvm::StringRef &NewStr) { + llvm::StringRef NewStr) { if (!isRewritable(Start)) return true; FileID StartFileID; unsigned StartOffs = getLocationOffsetAndFileID(Start, StartFileID); |