aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/FrontendActions.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-10-05 00:22:33 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-10-05 00:22:33 +0000
commitc7782d96c657eeb767bfea5117db49dc40e6356c (patch)
treebaf78e80d2cbfacb521141025c0c03eaf2506bfd /lib/Frontend/FrontendActions.cpp
parentf03b888a12ccff7d54ddd8a79a0141cf23adbf67 (diff)
[Modules] Introduce Module::TopHeaders which is a set of top-level headers
that are associated with a (sub)module. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165279 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/FrontendActions.cpp')
-rw-r--r--lib/Frontend/FrontendActions.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/Frontend/FrontendActions.cpp b/lib/Frontend/FrontendActions.cpp
index 24960cf6a0..f4ea5d3da0 100644
--- a/lib/Frontend/FrontendActions.cpp
+++ b/lib/Frontend/FrontendActions.cpp
@@ -132,7 +132,7 @@ ASTConsumer *GenerateModuleAction::CreateASTConsumer(CompilerInstance &CI,
}
/// \brief Collect the set of header includes needed to construct the given
-/// module.
+/// module and update the TopHeaders file set of the module.
///
/// \param Module The module we're collecting includes from.
///
@@ -149,15 +149,18 @@ static void collectModuleHeaderIncludes(const LangOptions &LangOpts,
// Add includes for each of these headers.
for (unsigned I = 0, N = Module->Headers.size(); I != N; ++I) {
+ const FileEntry *Header = Module->Headers[I];
+ Module->TopHeaders.insert(Header);
if (LangOpts.ObjC1)
Includes += "#import \"";
else
Includes += "#include \"";
- Includes += Module->Headers[I]->getName();
+ Includes += Header->getName();
Includes += "\"\n";
}
if (const FileEntry *UmbrellaHeader = Module->getUmbrellaHeader()) {
+ Module->TopHeaders.insert(UmbrellaHeader);
if (Module->Parent) {
// Include the umbrella header for submodules.
if (LangOpts.ObjC1)
@@ -184,9 +187,11 @@ static void collectModuleHeaderIncludes(const LangOptions &LangOpts,
// If this header is marked 'unavailable' in this module, don't include
// it.
- if (const FileEntry *Header = FileMgr.getFile(Dir->path()))
+ if (const FileEntry *Header = FileMgr.getFile(Dir->path())) {
if (ModMap.isHeaderInUnavailableModule(Header))
continue;
+ Module->TopHeaders.insert(Header);
+ }
// Include this header umbrella header for submodules.
if (LangOpts.ObjC1)