Skip to content

Commit e6d070d

Browse files
committed
Try to only remove comdata if the global is a declaration
1 parent 307a6d8 commit e6d070d

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
@@ -5190,7 +5190,8 @@ IRGenModule::getAddrOfTypeMetadata(CanType concreteType,
51905190
}
51915191

51925192
if (auto *GV = dyn_cast<llvm::GlobalVariable>(addr.getValue()))
5193-
GV->setComdat(nullptr);
5193+
if (GV->isDeclaration())
5194+
GV->setComdat(nullptr);
51945195

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

0 commit comments

Comments
 (0)