diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp --- a/llvm/lib/IR/Verifier.cpp +++ b/llvm/lib/IR/Verifier.cpp @@ -378,9 +378,6 @@ for (const NamedMDNode &NMD : M.named_metadata()) visitNamedMDNode(NMD); - for (const StringMapEntry &SMEC : M.getComdatSymbolTable()) - visitComdat(SMEC.getValue()); - visitModuleFlags(M); visitModuleIdents(M); visitModuleCommandLines(M); @@ -1305,14 +1302,6 @@ N.getRawEntity()); } -void Verifier::visitComdat(const Comdat &C) { - // The Module is invalid if the GlobalValue has private linkage. Entities - // with private linkage don't have entries in the symbol table. - if (const GlobalValue *GV = M.getNamedValue(C.getName())) - Assert(!GV->hasPrivateLinkage(), "comdat global value has private linkage", - GV); -} - void Verifier::visitModuleIdents(const Module &M) { const NamedMDNode *Idents = M.getNamedMetadata("llvm.ident"); if (!Idents) diff --git a/llvm/test/Verifier/comdat2.ll b/llvm/test/Verifier/comdat2.ll --- a/llvm/test/Verifier/comdat2.ll +++ b/llvm/test/Verifier/comdat2.ll @@ -1,5 +1,6 @@ -; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s +; This used to be invalid, but now it's valid. Ensure the verifier +; doesn't reject it. +; RUN: llvm-as %s -o /dev/null $v = comdat any @v = private global i32 0, comdat($v) -; CHECK: comdat global value has private linkage