aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Lex
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2013-03-21 01:08:50 +0000
committerDouglas Gregor <dgregor@apple.com>2013-03-21 01:08:50 +0000
commitcdf2808c4e735a717599751dcd2b434f239e1c68 (patch)
tree5fc928e9dcc83080ce96b9ef3a9980b54ea53bc0 /include/clang/Lex
parentb9da713efb4277753211590953f433723908aade (diff)
<rdar://problem/13037793> Allow the names of modules to differ from the name of their subdirectory in the include path.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177621 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Lex')
-rw-r--r--include/clang/Lex/DirectoryLookup.h18
-rw-r--r--include/clang/Lex/HeaderSearch.h6
2 files changed, 21 insertions, 3 deletions
diff --git a/include/clang/Lex/DirectoryLookup.h b/include/clang/Lex/DirectoryLookup.h
index 0539018e66..261dfabc0f 100644
--- a/include/clang/Lex/DirectoryLookup.h
+++ b/include/clang/Lex/DirectoryLookup.h
@@ -56,6 +56,10 @@ private:
/// \brief Whether this is a header map used when building a framework.
unsigned IsIndexHeaderMap : 1;
+
+ /// \brief Whether we've performed an exhaustive search for module maps
+ /// within the subdirectories of this directory.
+ unsigned SearchedAllModuleMaps : 1;
public:
/// DirectoryLookup ctor - Note that this ctor *does not take ownership* of
@@ -64,7 +68,7 @@ public:
bool isFramework)
: DirCharacteristic(DT),
LookupType(isFramework ? LT_Framework : LT_NormalDir),
- IsIndexHeaderMap(false) {
+ IsIndexHeaderMap(false), SearchedAllModuleMaps(false) {
u.Dir = dir;
}
@@ -73,7 +77,7 @@ public:
DirectoryLookup(const HeaderMap *map, SrcMgr::CharacteristicKind DT,
bool isIndexHeaderMap)
: DirCharacteristic(DT), LookupType(LT_HeaderMap),
- IsIndexHeaderMap(isIndexHeaderMap) {
+ IsIndexHeaderMap(isIndexHeaderMap), SearchedAllModuleMaps(false) {
u.Map = map;
}
@@ -109,6 +113,16 @@ public:
/// isHeaderMap - Return true if this is a header map, not a normal directory.
bool isHeaderMap() const { return getLookupType() == LT_HeaderMap; }
+ /// \brief Determine whether we have already searched this entire
+ /// directory for module maps.
+ bool haveSearchedAllModuleMaps() const { return SearchedAllModuleMaps; }
+
+ /// \brief Specify whether we have already searched all of the subdirectories
+ /// for module maps.
+ void setSearchedAllModuleMaps(bool SAMM) {
+ SearchedAllModuleMaps = SAMM;
+ }
+
/// DirCharacteristic - The type of directory this is, one of the DirType enum
/// values.
SrcMgr::CharacteristicKind getDirCharacteristic() const {
diff --git a/include/clang/Lex/HeaderSearch.h b/include/clang/Lex/HeaderSearch.h
index a0ce139993..8a5a798560 100644
--- a/include/clang/Lex/HeaderSearch.h
+++ b/include/clang/Lex/HeaderSearch.h
@@ -505,7 +505,11 @@ private:
Module *loadFrameworkModule(StringRef Name,
const DirectoryEntry *Dir,
bool IsSystem);
-
+
+ /// \brief Load all of the module maps within the immediate subdirectories
+ /// of the given search directory.
+ void loadSubdirectoryModuleMaps(DirectoryLookup &SearchDir);
+
public:
/// \brief Retrieve the module map.
ModuleMap &getModuleMap() { return ModMap; }