diff options
author | Douglas Gregor <dgregor@apple.com> | 2013-01-14 19:00:05 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2013-01-14 19:00:05 +0000 |
commit | 1715a2f9d597735f12b290beb70318c5c009a60c (patch) | |
tree | 953af47f03ac6c2c4bfe72fa1546befd82f0fdf0 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 1afbabab32278fac416a8d3115dbad9d573bf142 (diff) | |
download | bcm5719-llvm-1715a2f9d597735f12b290beb70318c5c009a60c.tar.gz bcm5719-llvm-1715a2f9d597735f12b290beb70318c5c009a60c.zip |
When forming the link options for an imported module, also include the
link options for the modules it imports.
llvm-svn: 172448
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index c43528866b0..4b662e0b899 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/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; } |