mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
Don't crash when the key of a comdat is lazily linked.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223673 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
70b0751080
commit
dcc44c64c1
@ -1482,6 +1482,15 @@ bool ModuleLinker::run() {
|
||||
for (unsigned i = 0, e = AppendingVars.size(); i != e; ++i)
|
||||
linkAppendingVarInit(AppendingVars[i]);
|
||||
|
||||
for (const auto &Entry : DstM->getComdatSymbolTable()) {
|
||||
const Comdat &C = Entry.getValue();
|
||||
if (C.getSelectionKind() == Comdat::Any)
|
||||
continue;
|
||||
const GlobalValue *GV = SrcM->getNamedValue(C.getName());
|
||||
assert(GV);
|
||||
MapValue(GV, ValueMap, RF_None, &TypeMap, &ValMaterializer);
|
||||
}
|
||||
|
||||
// Link in the function bodies that are defined in the source module into
|
||||
// DstM.
|
||||
for (Function &SF : *SrcM) {
|
||||
|
@ -6,8 +6,14 @@ define internal void @f() comdat $c {
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: $c = comdat any
|
||||
; CHECK: @a = alias void ()* @f
|
||||
; CHECK: define internal void @f() comdat $c {
|
||||
; CHECK: ret void
|
||||
; CHECK: }
|
||||
; CHECK-DAG: $c = comdat any
|
||||
; CHECK-DAG: @a = alias void ()* @f
|
||||
; CHECK-DAG: define internal void @f() comdat $c
|
||||
|
||||
$f2 = comdat largest
|
||||
define internal void @f2() comdat $f2 {
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK-DAG: $f2 = comdat largest
|
||||
; CHECK-DAG: define internal void @f2() comdat $f2
|
||||
|
Loading…
Reference in New Issue
Block a user