From 16a0de468f0f01569a42d871e30ebc1db04a4711 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 11 Oct 2007 18:38:32 +0000 Subject: 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 --- clang/Basic/SourceManager.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'clang/Basic') 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 +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 -- cgit v1.2.3