From ae4feb62e075190c8754c778a24f62f2e36e583f Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Fri, 25 Jan 2013 01:50:28 +0000 Subject: [PATCH] [Lex] Remove DirectoryLookup.UserSpecified, which is unused. llvm-svn: 173409 --- clang/include/clang/Lex/DirectoryLookup.h | 16 ++++------------ clang/lib/Frontend/InitHeaderSearch.cpp | 9 +++++---- clang/lib/Lex/PPDirectives.cpp | 2 +- clang/unittests/Lex/PPCallbacksTest.cpp | 2 +- 4 files changed, 11 insertions(+), 18 deletions(-) diff --git a/clang/include/clang/Lex/DirectoryLookup.h b/clang/include/clang/Lex/DirectoryLookup.h index d773fc6..0539018 100644 --- a/clang/include/clang/Lex/DirectoryLookup.h +++ b/clang/include/clang/Lex/DirectoryLookup.h @@ -50,10 +50,6 @@ private: /// SrcMgr::CharacteristicKind. unsigned DirCharacteristic : 2; - /// UserSupplied - True if this is a user-supplied directory. - /// - bool UserSupplied : 1; - /// LookupType - This indicates whether this DirectoryLookup object is a /// normal directory, a framework, or a headermap. unsigned LookupType : 2; @@ -65,8 +61,8 @@ public: /// DirectoryLookup ctor - Note that this ctor *does not take ownership* of /// 'dir'. DirectoryLookup(const DirectoryEntry *dir, SrcMgr::CharacteristicKind DT, - bool isUser, bool isFramework) - : DirCharacteristic(DT), UserSupplied(isUser), + bool isFramework) + : DirCharacteristic(DT), LookupType(isFramework ? LT_Framework : LT_NormalDir), IsIndexHeaderMap(false) { u.Dir = dir; @@ -75,8 +71,8 @@ public: /// DirectoryLookup ctor - Note that this ctor *does not take ownership* of /// 'map'. DirectoryLookup(const HeaderMap *map, SrcMgr::CharacteristicKind DT, - bool isUser, bool isIndexHeaderMap) - : DirCharacteristic(DT), UserSupplied(isUser), LookupType(LT_HeaderMap), + bool isIndexHeaderMap) + : DirCharacteristic(DT), LookupType(LT_HeaderMap), IsIndexHeaderMap(isIndexHeaderMap) { u.Map = map; } @@ -119,10 +115,6 @@ public: return (SrcMgr::CharacteristicKind)DirCharacteristic; } - /// isUserSupplied - True if this is a user-supplied directory. - /// - bool isUserSupplied() const { return UserSupplied; } - /// \brief Whether this header map is building a framework or not. bool isIndexHeaderMap() const { return isHeaderMap() && IsIndexHeaderMap; diff --git a/clang/lib/Frontend/InitHeaderSearch.cpp b/clang/lib/Frontend/InitHeaderSearch.cpp index 444d9f3..00a1491 100644 --- a/clang/lib/Frontend/InitHeaderSearch.cpp +++ b/clang/lib/Frontend/InitHeaderSearch.cpp @@ -141,8 +141,8 @@ void InitHeaderSearch::AddPath(const Twine &Path, // If the directory exists, add it. if (const DirectoryEntry *DE = FM.getDirectory(MappedPathStr)) { - IncludePath.push_back(std::make_pair(Group, DirectoryLookup(DE, Type, - isUserSupplied, isFramework))); + IncludePath.push_back( + std::make_pair(Group, DirectoryLookup(DE, Type, isFramework))); return; } @@ -152,8 +152,9 @@ void InitHeaderSearch::AddPath(const Twine &Path, if (const FileEntry *FE = FM.getFile(MappedPathStr)) { if (const HeaderMap *HM = Headers.CreateHeaderMap(FE)) { // It is a headermap, add it to the search path. - IncludePath.push_back(std::make_pair(Group, DirectoryLookup(HM, Type, - isUserSupplied, Group == IndexHeaderMap))); + IncludePath.push_back( + std::make_pair(Group, + DirectoryLookup(HM, Type, Group == IndexHeaderMap))); return; } } diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp index 156ebd2..74376e4 100644 --- a/clang/lib/Lex/PPDirectives.cpp +++ b/clang/lib/Lex/PPDirectives.cpp @@ -1376,7 +1376,7 @@ void Preprocessor::HandleIncludeDirective(SourceLocation HashLoc, if (Callbacks->FileNotFound(Filename, RecoveryPath)) { if (const DirectoryEntry *DE = FileMgr.getDirectory(RecoveryPath)) { // Add the recovery path to the list of search paths. - DirectoryLookup DL(DE, SrcMgr::C_User, true, false); + DirectoryLookup DL(DE, SrcMgr::C_User, false); HeaderInfo.AddSearchPath(DL, isAngled); // Try the lookup again, skipping the cache. diff --git a/clang/unittests/Lex/PPCallbacksTest.cpp b/clang/unittests/Lex/PPCallbacksTest.cpp index 3cf0ed4..073e07c 100644 --- a/clang/unittests/Lex/PPCallbacksTest.cpp +++ b/clang/unittests/Lex/PPCallbacksTest.cpp @@ -109,7 +109,7 @@ protected: // Add header's parent path to search path. StringRef SearchPath = path::parent_path(HeaderPath); const DirectoryEntry *DE = FileMgr.getDirectory(SearchPath); - DirectoryLookup DL(DE, SrcMgr::C_User, true, false); + DirectoryLookup DL(DE, SrcMgr::C_User, false); HeaderInfo.AddSearchPath(DL, IsSystemHeader); } -- 2.7.4