aboutsummaryrefslogtreecommitdiff
path: root/lib/Basic/SourceManager.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-01-19 07:40:40 +0000
committerChris Lattner <sabre@nondot.org>2009-01-19 07:40:40 +0000
commit2fa3ec888a980bf09e3d68435e227d3c4280bf70 (patch)
treeef10d589b8b15bb438fd2bf55ddc6b80cb20f990 /lib/Basic/SourceManager.cpp
parentb21e5a0fdd9bd6e6c6885428798070f0a9f71295 (diff)
remove the public SourceManager::getContentCacheForLoc method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62497 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/SourceManager.cpp')
-rw-r--r--lib/Basic/SourceManager.cpp5
1 files changed, 4 insertions, 1 deletions
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();
}