From 7e343b2161cc2b20ff088fa4db8e5251a507d16c Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 19 Jan 2009 07:32:13 +0000 Subject: [PATCH] SourceManager::getBufferData(SourceLocation) is dead, delete it. llvm-svn: 62495 --- clang/include/clang/Basic/SourceManager.h | 3 +-- clang/lib/Basic/SourceManager.cpp | 10 ++-------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/clang/include/clang/Basic/SourceManager.h b/clang/include/clang/Basic/SourceManager.h index c3c1a6963133..b60d0dab2349 100644 --- a/clang/include/clang/Basic/SourceManager.h +++ b/clang/include/clang/Basic/SourceManager.h @@ -334,9 +334,8 @@ public: return getContentCache(FID)->getBuffer(); } - /// getBufferData - Return a pointer to the start and end of the character + /// getBufferData - Return a pointer to the start and end of the source buffer /// data for the specified FileID. - std::pair getBufferData(SourceLocation Loc) const; std::pair getBufferData(FileID FID) const; /// getIncludeLoc - Return the location of the #include for the specified diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp index b053b160e1ce..989c3ac1fdf4 100644 --- a/clang/lib/Basic/SourceManager.cpp +++ b/clang/lib/Basic/SourceManager.cpp @@ -180,14 +180,8 @@ SourceLocation SourceManager::getInstantiationLoc(SourceLocation SpellingLoc, return SourceLocation::getMacroLoc(MacroIDs.size()-1, 0); } -/// getBufferData - Return a pointer to the start and end of the character -/// data for the specified location. -std::pair -SourceManager::getBufferData(SourceLocation Loc) const { - const llvm::MemoryBuffer *Buf = getBuffer(getCanonicalFileID(Loc)); - return std::make_pair(Buf->getBufferStart(), Buf->getBufferEnd()); -} - +/// getBufferData - Return a pointer to the start and end of the source buffer +/// data for the specified FileID. std::pair SourceManager::getBufferData(FileID FID) const { const llvm::MemoryBuffer *Buf = getBuffer(FID);