mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-02 07:17:36 +00:00
Verifier: Unused comdats might not have a corresponding GV
This fixes PR22646. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230051 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user