aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2013-01-14 19:00:05 +0000
committerDouglas Gregor <dgregor@apple.com>2013-01-14 19:00:05 +0000
commit3baad29d4413e1409fc69a472d374cf5de1d78ec (patch)
tree5015fbe9515d08d78063522296a7335c670b3d34 /lib/CodeGen
parentbdc691f1d61765dd806d5ae3b75ae004f676a7c9 (diff)
When forming the link options for an imported module, also include the
link options for the modules it imports. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172448 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/CodeGenModule.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index c43528866b..4b662e0b89 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/lib/CodeGen/CodeGenModule.cpp
@@ -2822,8 +2822,7 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) {
Metadata->addOperand(llvm::MDNode::get(getLLVMContext(), OptString));
}
- // We've imported this module; now import any of its children that haven't
- // already been imported.
+ // Import this module's (non-explicit) submodules.
for (clang::Module::submodule_iterator Sub = Mod->submodule_begin(),
SubEnd = Mod->submodule_end();
Sub != SubEnd; ++Sub) {
@@ -2833,6 +2832,12 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) {
if (ImportedModules.insert(*Sub))
Stack.push_back(*Sub);
}
+
+ // Import this module's dependencies.
+ for (unsigned I = 0, N = Mod->Imports.size(); I != N; ++I) {
+ if (ImportedModules.insert(Mod->Imports[I]))
+ Stack.push_back(Mod->Imports[I]);
+ }
}
break;
}