diff options
author | David Majnemer <david.majnemer@gmail.com> | 2014-07-13 04:56:11 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2014-07-13 04:56:11 +0000 |
commit | ebc741168bc0bd25666282979b318370477bd405 (patch) | |
tree | c7427b5e0b87f34d55db94ead57914cc0984499d /llvm/lib/IR/Verifier.cpp | |
parent | 299674e94fe67203866fe2a9c60b2172bee5f915 (diff) | |
download | bcm5719-llvm-ebc741168bc0bd25666282979b318370477bd405.tar.gz bcm5719-llvm-ebc741168bc0bd25666282979b318370477bd405.zip |
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.
llvm-svn: 212900
Diffstat (limited to 'llvm/lib/IR/Verifier.cpp')
-rw-r--r-- | llvm/lib/IR/Verifier.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp index 314bad36b15..ec7ae3a77a7 100644 --- a/llvm/lib/IR/Verifier.cpp +++ b/llvm/lib/IR/Verifier.cpp @@ -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); } |