diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-12-09 22:44:00 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-12-09 22:44:00 +0000 |
commit | ed11bd286f76e2ea2bf7ba1ebeff2d77a1be93a0 (patch) | |
tree | 9fc4786bcc62b3620f4e23887b060cd1875ee00c /llvm/lib/Linker/LinkModules.cpp | |
parent | 7f4880888222fd1728b09a9e62461540db8753e7 (diff) | |
download | bcm5719-llvm-ed11bd286f76e2ea2bf7ba1ebeff2d77a1be93a0.tar.gz bcm5719-llvm-ed11bd286f76e2ea2bf7ba1ebeff2d77a1be93a0.zip |
Synchronize the logic for deciding to link a gv.
We were deciding to not link an available_externally gv over a
declaration, but then copying over the body anyway.
llvm-svn: 255169
Diffstat (limited to 'llvm/lib/Linker/LinkModules.cpp')
-rw-r--r-- | llvm/lib/Linker/LinkModules.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp index a9fcee7c98c..3d40c126dd2 100644 --- a/llvm/lib/Linker/LinkModules.cpp +++ b/llvm/lib/Linker/LinkModules.cpp @@ -1050,7 +1050,12 @@ bool ModuleLinker::shouldLinkFromSource(bool &LinkFromSrc, return false; } // If the Dest is weak, use the source linkage. - LinkFromSrc = Dest.hasExternalWeakLinkage(); + if (Dest.hasExternalWeakLinkage()) { + LinkFromSrc = true; + return false; + } + // Link an available_externally over a declaration. + LinkFromSrc = !Src.isDeclaration() && Dest.isDeclaration(); return false; } |