From b21e5a0fdd9bd6e6c6885428798070f0a9f71295 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 19 Jan 2009 07:36:42 +0000 Subject: [PATCH] remove the SourceManager:: and FullSourceLoc::getFileEntryForLoc methods. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62496 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/SourceLocation.h | 1 - include/clang/Basic/SourceManager.h | 6 ------ lib/Basic/SourceLocation.cpp | 5 ----- lib/CodeGen/CGDebugInfo.cpp | 2 +- 4 files changed, 1 insertion(+), 13 deletions(-) diff --git a/include/clang/Basic/SourceLocation.h b/include/clang/Basic/SourceLocation.h index e56ce98026..8def5c5c1a 100644 --- a/include/clang/Basic/SourceLocation.h +++ b/include/clang/Basic/SourceLocation.h @@ -283,7 +283,6 @@ public: const llvm::MemoryBuffer* getBuffer() const; const char* getSourceName() const; - const FileEntry* getFileEntryForLoc() const; bool isInSystemHeader() const; diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h index b60d0dab23..270fba668e 100644 --- a/include/clang/Basic/SourceManager.h +++ b/include/clang/Basic/SourceManager.h @@ -412,12 +412,6 @@ public: return FileIDs[ChunkID-1].getContentCache(); } - /// getFileEntryForLoc - Return the FileEntry record for the spelling loc of - /// the specified SourceLocation, if one exists. - const FileEntry* getFileEntryForLoc(SourceLocation Loc) const { - return getContentCacheForLoc(Loc)->Entry; - } - /// getFileEntryForID - Returns the FileEntry record for the provided FileID. const FileEntry *getFileEntryForID(FileID FID) const { return getContentCache(FID)->Entry; diff --git a/lib/Basic/SourceLocation.cpp b/lib/Basic/SourceLocation.cpp index 1f5804ff9c..66ad720bb3 100644 --- a/lib/Basic/SourceLocation.cpp +++ b/lib/Basic/SourceLocation.cpp @@ -94,11 +94,6 @@ const char* FullSourceLoc::getSourceName() const { return SrcMgr->getSourceName(*this); } -const FileEntry* FullSourceLoc::getFileEntryForLoc() const { - assert(isValid()); - return SrcMgr->getFileEntryForLoc(*this); -} - bool FullSourceLoc::isInSystemHeader() const { assert(isValid()); return SrcMgr->isInSystemHeader(*this); diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 9cbefa3d06..5e4a95cc0c 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -51,7 +51,7 @@ llvm::DICompileUnit CGDebugInfo::getOrCreateCompileUnit(SourceLocation Loc) { return llvm::DICompileUnit(); SourceManager &SM = M->getContext().getSourceManager(); - const FileEntry *FE = SM.getFileEntryForLoc(Loc); + const FileEntry *FE = SM.getFileEntryForID(SM.getCanonicalFileID(Loc)); if (FE == 0) return llvm::DICompileUnit(); // See if this compile unit has been used before. -- 2.40.0