diff options
Diffstat (limited to 'Lex/HeaderSearch.cpp')
-rw-r--r-- | Lex/HeaderSearch.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Lex/HeaderSearch.cpp b/Lex/HeaderSearch.cpp index 1d79effc84..99d0d52f11 100644 --- a/Lex/HeaderSearch.cpp +++ b/Lex/HeaderSearch.cpp @@ -82,6 +82,18 @@ const HeaderMap *HeaderSearch::CreateHeaderMap(const FileEntry *FE, // File lookup within a DirectoryLookup scope //===----------------------------------------------------------------------===// +/// getName - Return the directory or filename corresponding to this lookup +/// object. +const char *DirectoryLookup::getName() const { + if (isNormalDir()) + return getDir()->getName(); + if (isFramework()) + return getFrameworkDir()->getName(); + assert(isHeaderMap() && "Unknown DirectoryLookup"); + return getHeaderMap()->getFileName(); +} + + /// LookupFile - Lookup the specified file in this search path, returning it /// if it exists or returning null if not. const FileEntry *DirectoryLookup::LookupFile(const char *FilenameStart, |