diff options
author | Chris Lattner <sabre@nondot.org> | 2007-12-17 17:57:27 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-12-17 17:57:27 +0000 |
commit | 3af66a9335966e9114e660cf7aafbb9272190ec2 (patch) | |
tree | 40149e2916dde3b70835647c84cc0a600ab69782 /include/clang/Lex | |
parent | fc591acc68050ab882fd242f0df2ad9196a1f3d7 (diff) |
Sink getName into DirectoryLookup to simplify the client in clang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45106 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Lex')
-rw-r--r-- | include/clang/Lex/DirectoryLookup.h | 19 | ||||
-rw-r--r-- | include/clang/Lex/HeaderMap.h | 5 |
2 files changed, 18 insertions, 6 deletions
diff --git a/include/clang/Lex/DirectoryLookup.h b/include/clang/Lex/DirectoryLookup.h index d1145840f4..df9b4229dc 100644 --- a/include/clang/Lex/DirectoryLookup.h +++ b/include/clang/Lex/DirectoryLookup.h @@ -76,10 +76,13 @@ public: u.Map = map; } - /// LookupFile - Lookup the specified file in this search path, returning it - /// if it exists or returning null if not. - const FileEntry *LookupFile(const char *FilenameStart, - const char *FilenameEnd, HeaderSearch &HS) const; + /// getLookupType - Return the kind of directory lookup that this is: either a + /// normal directory, a framework path, or a HeaderMap. + LookupType_t getLookupType() const { return (LookupType_t)LookupType; } + + /// getName - Return the directory or filename corresponding to this lookup + /// object. + const char *getName() const; /// getDir - Return the directory that this entry refers to. /// @@ -95,8 +98,6 @@ public: /// const HeaderMap *getHeaderMap() const { return isHeaderMap() ? u.Map : 0; } - LookupType_t getLookupType() const { return (LookupType_t)LookupType; } - /// isNormalDir - Return true if this is a normal directory, not a header map. bool isNormalDir() const { return getLookupType() == LT_NormalDir; } @@ -115,6 +116,12 @@ public: /// bool isUserSupplied() const { return UserSupplied; } + + /// LookupFile - Lookup the specified file in this search path, returning it + /// if it exists or returning null if not. + const FileEntry *LookupFile(const char *FilenameStart, + const char *FilenameEnd, HeaderSearch &HS) const; + private: const FileEntry *DoFrameworkLookup(const char *FilenameStart, const char *FilenameEnd, diff --git a/include/clang/Lex/HeaderMap.h b/include/clang/Lex/HeaderMap.h index 48e00bf375..8b1669f86b 100644 --- a/include/clang/Lex/HeaderMap.h +++ b/include/clang/Lex/HeaderMap.h @@ -38,6 +38,11 @@ public: /// this HeaderMap. If so, open it and return its FileEntry. const FileEntry *LookupFile(const char *FilenameStart,const char *FilenameEnd, FileManager &FM) const; + + /// getFileName - Return the filename of the headermap. + const char *getFileName() const { + return ""; + } }; |