[cfe-commits] r145696 - in /cfe/trunk: lib/Serialization/ASTReader.cpp test/Modules/diamond.c
Douglas Gregor
dgregor at apple.com
Fri Dec 2 11:11:09 PST 2011
Author: dgregor
Date: Fri Dec 2 13:11:09 2011
New Revision: 145696
URL: http://llvm.org/viewvc/llvm-project?rev=145696&view=rev
Log:
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.
Modified:
cfe/trunk/lib/Serialization/ASTReader.cpp
cfe/trunk/test/Modules/diamond.c
Modified: cfe/trunk/lib/Serialization/ASTReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReader.cpp?rev=145696&r1=145695&r2=145696&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReader.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReader.cpp Fri Dec 2 13:11:09 2011
@@ -2504,6 +2504,18 @@
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);
+ }
+ }
}
}
Modified: cfe/trunk/test/Modules/diamond.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/diamond.c?rev=145696&r1=145695&r2=145696&view=diff
==============================================================================
--- cfe/trunk/test/Modules/diamond.c (original)
+++ cfe/trunk/test/Modules/diamond.c Fri Dec 2 13:11:09 2011
@@ -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);
More information about the cfe-commits
mailing list