aboutsummaryrefslogtreecommitdiff
path: root/Basic/SourceManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Basic/SourceManager.cpp')
-rw-r--r--Basic/SourceManager.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/Basic/SourceManager.cpp b/Basic/SourceManager.cpp
index 380edc0f93..cc1312f049 100644
--- a/Basic/SourceManager.cpp
+++ b/Basic/SourceManager.cpp
@@ -209,6 +209,13 @@ SourceLocation SourceManager::getInstantiationLoc(SourceLocation PhysLoc,
return SourceLocation::getMacroLoc(MacroIDs.size()-1, 0, 0);
}
+/// getBufferData - Return a pointer to the start and end of the character
+/// data for the specified FileID.
+std::pair<const char*, const char*>
+SourceManager::getBufferData(unsigned FileID) const {
+ const llvm::MemoryBuffer *Buf = getBuffer(FileID);
+ return std::make_pair(Buf->getBufferStart(), Buf->getBufferEnd());
+}
/// getCharacterData - Return a pointer to the start of the specified location