diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-01-19 07:40:40 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-01-19 07:40:40 +0000 |
| commit | 1e9e86f4706937c3b8de7bc29b548c64636604b9 (patch) | |
| tree | 15093c12f5c1ebdc4d4e665fb50132ebd4fe091d | |
| parent | f809bbdbb827e4d02a6ddc8f0dfa694d0ca17263 (diff) | |
| download | bcm5719-llvm-1e9e86f4706937c3b8de7bc29b548c64636604b9.tar.gz bcm5719-llvm-1e9e86f4706937c3b8de7bc29b548c64636604b9.zip | |
remove the public SourceManager::getContentCacheForLoc method.
llvm-svn: 62497
| -rw-r--r-- | clang/include/clang/Basic/SourceManager.h | 8 | ||||
| -rw-r--r-- | clang/lib/Basic/SourceManager.cpp | 5 |
2 files changed, 4 insertions, 9 deletions
diff --git a/clang/include/clang/Basic/SourceManager.h b/clang/include/clang/Basic/SourceManager.h index 270fba668e6..41fa04183cc 100644 --- a/clang/include/clang/Basic/SourceManager.h +++ b/clang/include/clang/Basic/SourceManager.h @@ -403,14 +403,6 @@ public: return PLoc.getFileLocWithOffset(Loc.getMacroSpellingOffs()); } - /// getContentCacheForLoc - Return the ContentCache for the spelling loc of - /// the specified SourceLocation, if one exists. - const SrcMgr::ContentCache* getContentCacheForLoc(SourceLocation Loc) const { - Loc = getSpellingLoc(Loc); - unsigned ChunkID = Loc.getChunkID(); - assert(ChunkID-1 < FileIDs.size() && "Invalid FileID!"); - return FileIDs[ChunkID-1].getContentCache(); - } /// getFileEntryForID - Returns the FileEntry record for the provided FileID. const FileEntry *getFileEntryForID(FileID FID) const { diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp index 989c3ac1fdf..35c350ebbac 100644 --- a/clang/lib/Basic/SourceManager.cpp +++ b/clang/lib/Basic/SourceManager.cpp @@ -228,9 +228,12 @@ unsigned SourceManager::getColumnNumber(SourceLocation Loc) const { const char *SourceManager::getSourceName(SourceLocation Loc) const { if (Loc.getChunkID() == 0) return ""; + Loc = getSpellingLoc(Loc); + unsigned ChunkID = Loc.getChunkID(); + const SrcMgr::ContentCache *C = getFIDInfo(ChunkID)->getContentCache(); + // To get the source name, first consult the FileEntry (if one exists) before // the MemBuffer as this will avoid unnecessarily paging in the MemBuffer. - const SrcMgr::ContentCache *C = getContentCacheForLoc(Loc); return C->Entry ? C->Entry->getName() : C->getBuffer()->getBufferIdentifier(); } |

