mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-29 10:32:47 +00:00
IR: Allow comdats to be applied to globals with internal linkage
Our verifier check for checking if a global has local linkage was too strict. Forbid private linkage but permit local linkage. Object file formats permit this and forbidding it prevents elimination of unused, internal, vftables under the MSVC ABI. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212900 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f803b3d992
commit
e8d826b844
@ -605,11 +605,10 @@ void Verifier::visitComdat(const Comdat &C) {
|
||||
Assert1(GV,
|
||||
"comdat selection kind requires a global value with the same name",
|
||||
&C);
|
||||
// The Module is invalid if the GlobalValue has local linkage. Allowing
|
||||
// otherwise opens us up to seeing the underling global value get renamed if
|
||||
// collisions occur.
|
||||
// The Module is invalid if the GlobalValue has private linkage. Entities
|
||||
// with private linkage don't have entries in the symbol table.
|
||||
if (GV)
|
||||
Assert1(!GV->hasLocalLinkage(), "comdat global value has local linkage",
|
||||
Assert1(!GV->hasPrivateLinkage(), "comdat global value has private linkage",
|
||||
GV);
|
||||
}
|
||||
|
||||
|
@ -16,3 +16,6 @@ define void @f() comdat $f {
|
||||
ret void
|
||||
}
|
||||
; CHECK: define void @f() comdat $f
|
||||
|
||||
$i = comdat largest
|
||||
@i = internal global i32 0, comdat $i
|
||||
|
@ -2,4 +2,4 @@
|
||||
|
||||
$v = comdat any
|
||||
@v = private global i32 0, comdat $v
|
||||
; CHECK: comdat global value has local linkage
|
||||
; CHECK: comdat global value has private linkage
|
||||
|
Loading…
Reference in New Issue
Block a user