Linker: Do not expect comdat to exist in source module.

llvm-svn: 240341
This commit is contained in:
Peter Collingbourne 2015-06-22 21:46:51 +00:00
parent 771f4d9d97
commit ea45d834e0
2 changed files with 8 additions and 2 deletions

View File

@ -1573,8 +1573,8 @@ bool ModuleLinker::run() {
if (C.getSelectionKind() == Comdat::Any)
continue;
const GlobalValue *GV = SrcM->getNamedValue(C.getName());
assert(GV);
MapValue(GV, ValueMap, RF_None, &TypeMap, &ValMaterializer);
if (GV)
MapValue(GV, ValueMap, RF_None, &TypeMap, &ValMaterializer);
}
// Strip replaced subprograms before mapping any metadata -- so that we're

View File

@ -0,0 +1,6 @@
; RUN: llvm-link %s /dev/null -S -o - | FileCheck %s
$c = comdat largest
; CHECK: @c = global i32 0, comdat
@c = global i32 0, comdat