llvm.org GIT mirror llvm / fad81ab
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255169 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 4 years ago
3 changed file(s) with 20 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
10491049 return false;
10501050 }
10511051 // If the Dest is weak, use the source linkage.
1052 LinkFromSrc = Dest.hasExternalWeakLinkage();
1052 if (Dest.hasExternalWeakLinkage()) {
1053 LinkFromSrc = true;
1054 return false;
1055 }
1056 // Link an available_externally over a declaration.
1057 LinkFromSrc = !Src.isDeclaration() && Dest.isDeclaration();
10531058 return false;
10541059 }
10551060
0 @h = global void ()* @f
1
2 define available_externally void @f() {
3 ret void
4 }
0 ; RUN: llvm-link -S %s %p/Inputs/available_externally_over_decl.ll | FileCheck %s
1
2 declare void @f()
3
4 define void ()* @main() {
5 ret void ()* @f
6 }
7
8 ; CHECK: define available_externally void @f() {