aboutsummaryrefslogtreecommitdiff
path: root/lib/Rewrite
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2010-03-16 14:14:31 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2010-03-16 14:14:31 +0000
commitf6ac97b101c8840efa92bf29166077ce4049e293 (patch)
treeae3c4bd11598f49ee678e6fba5a3e2df38d24427 /lib/Rewrite
parentc506357c3778092c2a3251243f12524e8eb89274 (diff)
Let SourceManager::getBufferData return StringRef instead of a pair of two const char*.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98630 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Rewrite')
-rw-r--r--lib/Rewrite/HTMLRewrite.cpp2
-rw-r--r--lib/Rewrite/Rewriter.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/Rewrite/HTMLRewrite.cpp b/lib/Rewrite/HTMLRewrite.cpp
index f325121d08..7b78070a27 100644
--- a/lib/Rewrite/HTMLRewrite.cpp
+++ b/lib/Rewrite/HTMLRewrite.cpp
@@ -44,7 +44,7 @@ void html::HighlightRange(Rewriter &R, SourceLocation B, SourceLocation E,
EOffset += Lexer::MeasureTokenLength(E, R.getSourceMgr(), R.getLangOpts());
bool Invalid = false;
- const char *BufferStart = SM.getBufferData(FID, &Invalid).first;
+ const char *BufferStart = SM.getBufferData(FID, &Invalid).data();
if (Invalid)
return;
diff --git a/lib/Rewrite/Rewriter.cpp b/lib/Rewrite/Rewriter.cpp
index 9744496ac4..bf8ba701a8 100644
--- a/lib/Rewrite/Rewriter.cpp
+++ b/lib/Rewrite/Rewriter.cpp
@@ -165,8 +165,8 @@ RewriteBuffer &Rewriter::getEditBuffer(FileID FID) {
return I->second;
I = RewriteBuffers.insert(I, std::make_pair(FID, RewriteBuffer()));
- std::pair<const char*, const char*> MB = SourceMgr->getBufferData(FID);
- I->second.Initialize(MB.first, MB.second);
+ llvm::StringRef MB = SourceMgr->getBufferData(FID);
+ I->second.Initialize(MB.begin(), MB.end());
return I->second;
}