aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/HeaderSearch.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-12-31 04:05:44 +0000
committerDouglas Gregor <dgregor@apple.com>2011-12-31 04:05:44 +0000
commit51f564f80d9f71e175635b452ffeeeff899e9bf1 (patch)
treeada57bc51cc68158361f5d1a49d8de00b6a1e564 /lib/Lex/HeaderSearch.cpp
parent868f65c6bf904591f62a0d69866825d2d3dfd16f (diff)
Implement support for module requirements, which indicate the language
features needed for a particular module to be available. This allows mixed-language modules, where certain headers only work under some language variants (e.g., in C++, std.tuple might only be available in C++11 mode). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147387 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/HeaderSearch.cpp')
-rw-r--r--lib/Lex/HeaderSearch.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Lex/HeaderSearch.cpp b/lib/Lex/HeaderSearch.cpp
index 8a73fb9565..070daa0cd1 100644
--- a/lib/Lex/HeaderSearch.cpp
+++ b/lib/Lex/HeaderSearch.cpp
@@ -38,9 +38,10 @@ HeaderFileInfo::getControllingMacro(ExternalIdentifierLookup *External) {
ExternalHeaderFileInfoSource::~ExternalHeaderFileInfoSource() {}
-HeaderSearch::HeaderSearch(FileManager &FM, DiagnosticsEngine &Diags)
+HeaderSearch::HeaderSearch(FileManager &FM, DiagnosticsEngine &Diags,
+ const LangOptions &LangOpts)
: FileMgr(FM), Diags(Diags), FrameworkMap(64),
- ModMap(FileMgr, *Diags.getClient())
+ ModMap(FileMgr, *Diags.getClient(), LangOpts)
{
AngledDirIdx = 0;
SystemDirIdx = 0;
@@ -803,8 +804,8 @@ bool HeaderSearch::hasModuleMap(StringRef FileName,
}
Module *HeaderSearch::findModuleForHeader(const FileEntry *File) {
- if (Module *Module = ModMap.findModuleForHeader(File))
- return Module;
+ if (Module *Mod = ModMap.findModuleForHeader(File))
+ return Mod;
return 0;
}