[llvm] r262222 - IRObject: Mark extern_weak as weak.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 29 06:26:07 PST 2016
Author: rafael
Date: Mon Feb 29 08:26:06 2016
New Revision: 262222
URL: http://llvm.org/viewvc/llvm-project?rev=262222&view=rev
Log:
IRObject: Mark extern_weak as weak.
Modified:
llvm/trunk/lib/Object/IRObjectFile.cpp
llvm/trunk/test/Object/X86/nm-ir.ll
Modified: llvm/trunk/lib/Object/IRObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/IRObjectFile.cpp?rev=262222&r1=262221&r2=262222&view=diff
==============================================================================
--- llvm/trunk/lib/Object/IRObjectFile.cpp (original)
+++ llvm/trunk/lib/Object/IRObjectFile.cpp Mon Feb 29 08:26:06 2016
@@ -231,7 +231,8 @@ uint32_t IRObjectFile::getSymbolFlags(Da
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."))
Modified: llvm/trunk/test/Object/X86/nm-ir.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/X86/nm-ir.ll?rev=262222&r1=262221&r2=262222&view=diff
==============================================================================
--- llvm/trunk/test/Object/X86/nm-ir.ll (original)
+++ llvm/trunk/test/Object/X86/nm-ir.ll Mon Feb 29 08:26:06 2016
@@ -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()
More information about the llvm-commits
mailing list