diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-08-19 19:10:30 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-08-19 19:10:30 +0000 |
commit | d7407dc92c7d19cafce429e7e1cf9819d3fc0b92 (patch) | |
tree | b1682301e20128532bd5143096f2eee9f99794f1 /lib/Frontend/RewriteBlocks.cpp | |
parent | 7e37c818f9f77608c602ffb32c1135e3cd0132a8 (diff) |
Convert parts of Rewriter to StringRef based API.
- Please accept my sincere apologies for the gratuitous elimination of code
duplication, manual string length counting, unnecessary strlen calls, etc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79448 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/RewriteBlocks.cpp')
-rw-r--r-- | lib/Frontend/RewriteBlocks.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Frontend/RewriteBlocks.cpp b/lib/Frontend/RewriteBlocks.cpp index a7b5e3d686..b7cdb48aab 100644 --- a/lib/Frontend/RewriteBlocks.cpp +++ b/lib/Frontend/RewriteBlocks.cpp @@ -236,7 +236,8 @@ void RewriteBlocks::InsertText(SourceLocation Loc, const char *StrData, void RewriteBlocks::ReplaceText(SourceLocation Start, unsigned OrigLength, const char *NewStr, unsigned NewLength) { - if (!Rewrite.ReplaceText(Start, OrigLength, NewStr, NewLength)) + if (!Rewrite.ReplaceText(Start, OrigLength, + llvm::StringRef(NewStr, NewLength))) return; Diags.Report(Context->getFullLoc(Start), RewriteFailedDiag); } |