From 2fa3ec888a980bf09e3d68435e227d3c4280bf70 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 19 Jan 2009 07:40:40 +0000 Subject: remove the public SourceManager::getContentCacheForLoc method. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62497 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Basic/SourceManager.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/Basic/SourceManager.cpp') diff --git a/lib/Basic/SourceManager.cpp b/lib/Basic/SourceManager.cpp index 989c3ac1fd..35c350ebba 100644 --- a/lib/Basic/SourceManager.cpp +++ b/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(); } -- cgit v1.2.3-18-g5258