summaryrefslogtreecommitdiffstats
path: root/clang/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
commit1fb5c3a63a88e4758b196f1bda64eecce9b29d3f (patch)
tree0da4770b525e3b6a77a4b54bd828262d2bda7dfa /clang/lib/Lex/HeaderSearch.cpp
parent84a5dfdf727df09432aaa40ac72aa94e500326e4 (diff)
downloadbcm5719-llvm-1fb5c3a63a88e4758b196f1bda64eecce9b29d3f.tar.gz
bcm5719-llvm-1fb5c3a63a88e4758b196f1bda64eecce9b29d3f.zip
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). llvm-svn: 147387
Diffstat (limited to 'clang/lib/Lex/HeaderSearch.cpp')
-rw-r--r--clang/lib/Lex/HeaderSearch.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp
index 8a73fb95658..070daa0cd12 100644
--- a/clang/lib/Lex/HeaderSearch.cpp
+++ b/clang/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;
}
OpenPOWER on IntegriCloud