Skip to content

Commit ba1db4b

Browse files
committed
Try to only remove comdata if the global is a declaration
1 parent 489fd67 commit ba1db4b

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
@@ -5180,7 +5180,8 @@ IRGenModule::getAddrOfTypeMetadata(CanType concreteType,
51805180
}
51815181

51825182
if (auto *GV = dyn_cast<llvm::GlobalVariable>(addr.getValue()))
5183-
GV->setComdat(nullptr);
5183+
if (GV->isDeclaration())
5184+
GV->setComdat(nullptr);
51845185

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

0 commit comments

Comments
 (0)