aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Lex/HeaderSearch.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-01-18 16:23:48 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-01-18 16:23:48 +0000
commit06d4ba388873e6d1cfa9cd715a8935ecc8cd2097 (patch)
tree3eb853da77d46cc77c4b017525a422f9ddb1385b /include/clang/Lex/HeaderSearch.h
parent30d791273d07fac9c0c1641a0731191bca6e8606 (diff)
downloadsrc-06d4ba388873e6d1cfa9cd715a8935ecc8cd2097.tar.gz
src-06d4ba388873e6d1cfa9cd715a8935ecc8cd2097.zip
Vendor import of clang RELEASE_360/rc1 tag r226102 (effectively, 3.6.0 RC1):vendor/clang/clang-release_360-r226102
Notes
Notes: svn path=/vendor/clang/dist/; revision=277325 svn path=/vendor/clang/clang-release_360-r226102/; revision=277326; tag=vendor/clang/clang-release_360-r226102
Diffstat (limited to 'include/clang/Lex/HeaderSearch.h')
-rw-r--r--include/clang/Lex/HeaderSearch.h29
1 files changed, 16 insertions, 13 deletions
diff --git a/include/clang/Lex/HeaderSearch.h b/include/clang/Lex/HeaderSearch.h
index 034262982770..158f67d40b49 100644
--- a/include/clang/Lex/HeaderSearch.h
+++ b/include/clang/Lex/HeaderSearch.h
@@ -231,7 +231,11 @@ class HeaderSearch {
/// \brief Describes whether a given directory has a module map in it.
llvm::DenseMap<const DirectoryEntry *, bool> DirectoryHasModuleMap;
-
+
+ /// \brief Set of module map files we've already loaded, and a flag indicating
+ /// whether they were valid or not.
+ llvm::DenseMap<const FileEntry *, bool> LoadedModuleMaps;
+
/// \brief Uniqued set of framework names, which is used to track which
/// headers were included as framework headers.
llvm::StringSet<llvm::BumpPtrAllocator> FrameworkNames;
@@ -248,7 +252,7 @@ class HeaderSearch {
unsigned NumMultiIncludeFileOptzn;
unsigned NumFrameworkLookups, NumSubFrameworkLookups;
- bool EnabledModules;
+ const LangOptions &LangOpts;
// HeaderSearch doesn't support default or copy construction.
HeaderSearch(const HeaderSearch&) LLVM_DELETED_FUNCTION;
@@ -384,14 +388,12 @@ public:
/// \param SuggestedModule If non-null, and the file found is semantically
/// part of a known module, this will be set to the module that should
/// be imported instead of preprocessing/parsing the file found.
- const FileEntry *LookupFile(StringRef Filename, SourceLocation IncludeLoc,
- bool isAngled, const DirectoryLookup *FromDir,
- const DirectoryLookup *&CurDir,
- ArrayRef<const FileEntry *> Includers,
- SmallVectorImpl<char> *SearchPath,
- SmallVectorImpl<char> *RelativePath,
- ModuleMap::KnownHeader *SuggestedModule,
- bool SkipCache = false);
+ const FileEntry *LookupFile(
+ StringRef Filename, SourceLocation IncludeLoc, bool isAngled,
+ const DirectoryLookup *FromDir, const DirectoryLookup *&CurDir,
+ ArrayRef<std::pair<const FileEntry *, const DirectoryEntry *>> Includers,
+ SmallVectorImpl<char> *SearchPath, SmallVectorImpl<char> *RelativePath,
+ ModuleMap::KnownHeader *SuggestedModule, bool SkipCache = false);
/// \brief Look up a subframework for the specified \#include file.
///
@@ -409,7 +411,7 @@ public:
/// \brief Look up the specified framework name in our framework cache.
/// \returns The DirectoryEntry it is in if we know, null otherwise.
FrameworkCacheEntry &LookupFrameworkCache(StringRef FWName) {
- return FrameworkMap.GetOrCreateValue(FWName).getValue();
+ return FrameworkMap[FWName];
}
/// \brief Mark the specified file as a target of of a \#include,
@@ -477,7 +479,7 @@ public:
const HeaderMap *CreateHeaderMap(const FileEntry *FE);
/// Returns true if modules are enabled.
- bool enabledModules() const { return EnabledModules; }
+ bool enabledModules() const { return LangOpts.Modules; }
/// \brief Retrieve the name of the module file that should be used to
/// load the given module.
@@ -638,7 +640,8 @@ private:
};
LoadModuleMapResult loadModuleMapFileImpl(const FileEntry *File,
- bool IsSystem);
+ bool IsSystem,
+ const DirectoryEntry *Dir);
/// \brief Try to load the module map file in the given directory.
///