IRObject: Mark extern_weak as weak.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262222 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola 2016-02-29 14:26:06 +00:00
parent cb7bae1ff0
commit 78ddd2d003
2 changed files with 6 additions and 1 deletions

View File

@ -231,7 +231,8 @@ uint32_t IRObjectFile::getSymbolFlags(DataRefImpl Symb) const {
Res |= BasicSymbolRef::SF_Global;
if (GV->hasCommonLinkage())
Res |= BasicSymbolRef::SF_Common;
if (GV->hasLinkOnceLinkage() || GV->hasWeakLinkage())
if (GV->hasLinkOnceLinkage() || GV->hasWeakLinkage() ||
GV->hasExternalWeakLinkage())
Res |= BasicSymbolRef::SF_Weak;
if (GV->getName().startswith("llvm."))

View File

@ -6,6 +6,7 @@
; CHECK-NEXT: t f2
; CHECK-NEXT: W f3
; CHECK-NEXT: U f4
; CHECK-NEXT: w f5
; CHECK-NEXT: D g1
; CHECK-NEXT: d g2
; CHECK-NEXT: C g3
@ -31,6 +32,7 @@ module asm ".long undef_asm_sym"
@a2 = internal alias i32, i32* @g1
define void @f1() {
call void @f5()
ret void
}
@ -43,3 +45,5 @@ define linkonce_odr void @f3() {
}
declare void @f4()
declare extern_weak void @f5()