Skip to content

Commit 3727381

Browse files
committed
Try to only remove comdata if the global is a declaration
1 parent 3e06dd9 commit 3727381

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/IRGen/GenDecl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5131,7 +5131,8 @@ IRGenModule::getAddrOfTypeMetadata(CanType concreteType,
51315131
}
51325132

51335133
if (auto *GV = dyn_cast<llvm::GlobalVariable>(addr.getValue()))
5134-
GV->setComdat(nullptr);
5134+
if (GV->isDeclaration())
5135+
GV->setComdat(nullptr);
51355136

51365137
// FIXME: MC breaks when emitting alias references on some platforms
51375138
// (rdar://problem/22450593 ). Work around this by referring to the aliasee

0 commit comments

Comments
 (0)