aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Serialization/ASTReader.cpp12
-rw-r--r--test/Modules/diamond.c6
2 files changed, 12 insertions, 6 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);
+ }
+ }
}
}
diff --git a/test/Modules/diamond.c b/test/Modules/diamond.c
index 93722e9fe2..59181c533d 100644
--- a/test/Modules/diamond.c
+++ b/test/Modules/diamond.c
@@ -5,12 +5,6 @@
__import_module__ diamond_bottom;
-// FIXME: We want 'bottom' to re-export left and right, and both of those to
-// re-export 'top'.
-__import_module__ diamond_top;
-__import_module__ diamond_left;
-__import_module__ diamond_right;
-
void test_diamond(int i, float f, double d, char c) {
top(&i);
left(&f);