diff options
author | David Majnemer <david.majnemer@gmail.com> | 2015-02-20 19:58:48 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2015-02-20 19:58:48 +0000 |
commit | ab457815f36067d6ac1f034c120fcd1c2f2769c2 (patch) | |
tree | 3e309df113a72e608260d1d6a40fa178d388b8b5 /llvm/lib/IR/Verifier.cpp | |
parent | db51e2a52abd84a2d07887609768e7724063d405 (diff) | |
download | bcm5719-llvm-ab457815f36067d6ac1f034c120fcd1c2f2769c2.tar.gz bcm5719-llvm-ab457815f36067d6ac1f034c120fcd1c2f2769c2.zip |
Verifier: Unused comdats might not have a corresponding GV
This fixes PR22646.
llvm-svn: 230051
Diffstat (limited to 'llvm/lib/IR/Verifier.cpp')
-rw-r--r-- | llvm/lib/IR/Verifier.cpp | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp index 43a023ec7c0..d01e1389436 100644 --- a/llvm/lib/IR/Verifier.cpp +++ b/llvm/lib/IR/Verifier.cpp @@ -793,16 +793,9 @@ void Verifier::visitMDImportedEntity(const MDImportedEntity &N) { } void Verifier::visitComdat(const Comdat &C) { - // All Comdat::SelectionKind values other than Comdat::Any require a - // GlobalValue with the same name as the Comdat. - const GlobalValue *GV = M->getNamedValue(C.getName()); - if (C.getSelectionKind() != Comdat::Any) - Assert1(GV, - "comdat selection kind requires a global value with the same name", - &C); // The Module is invalid if the GlobalValue has private linkage. Entities // with private linkage don't have entries in the symbol table. - if (GV) + if (const GlobalValue *GV = M->getNamedValue(C.getName())) Assert1(!GV->hasPrivateLinkage(), "comdat global value has private linkage", GV); } |