aboutsummaryrefslogtreecommitdiff
path: root/lib/Basic/SourceManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Basic/SourceManager.cpp')
-rw-r--r--lib/Basic/SourceManager.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/Basic/SourceManager.cpp b/lib/Basic/SourceManager.cpp
index 6335504a7d..4007ccf2a6 100644
--- a/lib/Basic/SourceManager.cpp
+++ b/lib/Basic/SourceManager.cpp
@@ -474,8 +474,7 @@ bool SourceManager::overrideFileContents(const FileEntry *SourceFile,
return false;
}
-std::pair<const char*, const char*>
-SourceManager::getBufferData(FileID FID, bool *Invalid) const {
+llvm::StringRef SourceManager::getBufferData(FileID FID, bool *Invalid) const {
if (Invalid)
*Invalid = false;
@@ -483,10 +482,9 @@ SourceManager::getBufferData(FileID FID, bool *Invalid) const {
if (!Buf) {
if (*Invalid)
*Invalid = true;
- const char *FakeText = "";
- return std::make_pair(FakeText, FakeText + strlen(FakeText));
+ return "";
}
- return std::make_pair(Buf->getBufferStart(), Buf->getBufferEnd());
+ return Buf->getBuffer();
}
//===----------------------------------------------------------------------===//