diff options
author | Chris Lattner <sabre@nondot.org> | 2007-10-11 18:38:32 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-10-11 18:38:32 +0000 |
commit | 8a12c2777cccdf629b89745b6ecc89a8c1641e4e (patch) | |
tree | 9984c8669f8e4370ff99d6810cee9a2f1fff6fb3 /Basic/SourceManager.cpp | |
parent | dfbcce2b55ca8b45ce9d9c09c32e43c3bd73ac2a (diff) |
Push the rewriting APIs along. Build a trivial client that replaces tabs
with x's for now. The APIs are all unimplemented, so it doesn't do
anything yet! :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42868 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Basic/SourceManager.cpp')
-rw-r--r-- | Basic/SourceManager.cpp | 7 |
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 |