summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2018-04-16 19:42:32 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2018-04-16 19:42:32 +0000
commita3b5f71eaa924f71321fb989d727a3a6365ba557 (patch)
tree3092cd77bd37e5c18b815ad93bdaa2a18908b086 /clang/lib/CodeGen/CodeGenModule.cpp
parent1c3bd2ff0c71590ad02c68bf0d4bbd3bbc27837e (diff)
downloadbcm5719-llvm-a3b5f71eaa924f71321fb989d727a3a6365ba557.tar.gz
bcm5719-llvm-a3b5f71eaa924f71321fb989d727a3a6365ba557.zip
Use export_as for autolinking frameworks
framework module SomeKitCore { ... export_as SomeKit } Given the module above, while generting autolink information during codegen, clang should to emit '-framework SomeKitCore' only if SomeKit was not imported in the relevant TU, otherwise it should use '-framework SomeKit' instead. rdar://problem/38269782 llvm-svn: 330152
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 687a6ca8d33..42a8cd800fa 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -1556,6 +1556,12 @@ static void addLinkOptionsPostorder(CodeGenModule &CGM, Module *Mod,
// Add linker options to link against the libraries/frameworks
// described by this module.
llvm::LLVMContext &Context = CGM.getLLVMContext();
+
+ // For modules that use export_as for linking, use that module
+ // name instead.
+ if (Mod->UseExportAsModuleLinkName)
+ return;
+
for (unsigned I = Mod->LinkLibraries.size(); I > 0; --I) {
// Link against a framework. Frameworks are currently Darwin only, so we
// don't to ask TargetCodeGenInfo for the spelling of the linker option.
OpenPOWER on IntegriCloud