diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-12-02 19:11:09 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-12-02 19:11:09 +0000 |
commit | 07165b9e3b78ed76a7db561f392335e4a54c9e51 (patch) | |
tree | 1e325983af69ab78bb05c458bc07dbf051a2bb55 /lib/Serialization | |
parent | af13bfc3b40aa4a46f4e71d200ecfb10f45297fc (diff) |
When making a module visible, also make any of its exported modules
visible, allowing one to create modules that import (and then
re-export) other modules.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145696 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization')
-rw-r--r-- | lib/Serialization/ASTReader.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/Serialization/ASTReader.cpp b/lib/Serialization/ASTReader.cpp index 26fca2290e..76bc0b8400 100644 --- a/lib/Serialization/ASTReader.cpp +++ b/lib/Serialization/ASTReader.cpp @@ -2504,6 +2504,18 @@ void ASTReader::makeModuleVisible(Module *Mod, if (!Sub->getValue()->IsExplicit && Visited.insert(Sub->getValue())) Stack.push_back(Sub->getValue()); } + + // Push any exported modules onto the stack to be marked as visible. + for (unsigned I = 0, N = Mod->Exports.size(); I != N; ++I) { + Module *Exported = Mod->Exports[I].getPointer(); + if (Visited.insert(Exported)) { + // FIXME: The intent of wildcards is to re-export any imported modules. + // However, we don't yet have the module-dependency information to do + // this, so we ignore wildcards for now. + if (!Mod->Exports[I].getInt()) + Stack.push_back(Exported); + } + } } } |