summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Verifier.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-02-20 19:58:48 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-02-20 19:58:48 +0000
commitab457815f36067d6ac1f034c120fcd1c2f2769c2 (patch)
tree3e309df113a72e608260d1d6a40fa178d388b8b5 /llvm/lib/IR/Verifier.cpp
parentdb51e2a52abd84a2d07887609768e7724063d405 (diff)
downloadbcm5719-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.cpp9
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);
}
OpenPOWER on IntegriCloud