summaryrefslogtreecommitdiffstats
path: root/clang/Basic
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-10-11 18:38:32 +0000
committerChris Lattner <sabre@nondot.org>2007-10-11 18:38:32 +0000
commit16a0de468f0f01569a42d871e30ebc1db04a4711 (patch)
tree16fc8f7fa009877b7b09ce98cd1e01e356a4bb87 /clang/Basic
parentd797113659e7514a6cad0aee94a3ca7d7a0f6acf (diff)
downloadbcm5719-llvm-16a0de468f0f01569a42d871e30ebc1db04a4711.tar.gz
bcm5719-llvm-16a0de468f0f01569a42d871e30ebc1db04a4711.zip
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! :) llvm-svn: 42868
Diffstat (limited to 'clang/Basic')
-rw-r--r--clang/Basic/SourceManager.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/Basic/SourceManager.cpp b/clang/Basic/SourceManager.cpp
index 380edc0f931..cc1312f0499 100644
--- a/clang/Basic/SourceManager.cpp
+++ b/clang/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
OpenPOWER on IntegriCloud