Skip to content

Commit eebc6c8

Browse files
committed
more DEBUGGING
1 parent 74d13e3 commit eebc6c8

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

include/swift/IRGen/Linking.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1632,10 +1632,18 @@ class ApplyIRLinkage {
16321632
// apply the COMDAT.
16331633
if (definition)
16341634
if (IRL.Linkage == llvm::GlobalValue::LinkOnceODRLinkage ||
1635-
IRL.Linkage == llvm::GlobalValue::WeakODRLinkage)
1636-
if (Triple.supportsCOMDAT())
1637-
if (llvm::GlobalObject *GO = dyn_cast<llvm::GlobalObject>(GV))
1635+
IRL.Linkage == llvm::GlobalValue::WeakODRLinkage) {
1636+
if (Triple.supportsCOMDAT()) {
1637+
if (llvm::GlobalObject *GO = dyn_cast<llvm::GlobalObject>(GV)) {
1638+
if (GV->getName().equals("$sSo18CFDateFormatterRefaMf")) {
1639+
llvm::dbgs() << "Setting comdat in" << M->getName() << "\n";
1640+
}
16381641
GO->setComdat(M->getOrInsertComdat(GV->getName()));
1642+
}
1643+
}
1644+
} else if (GV->getName().equals("$sSo18CFDateFormatterRefaMf")){
1645+
llvm::dbgs() << "Not setting comdat in " << M->getName() << "\n";
1646+
}
16391647
}
16401648
};
16411649

lib/IRGen/GenDecl.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2705,9 +2705,6 @@ Address IRGenModule::getAddrOfSILGlobalVariable(SILGlobalVariable *var,
27052705
gvar->setInitializer(llvm::Constant::getNullValue(storageTypeWithContainer));
27062706
else
27072707
gvar->setComdat(nullptr);
2708-
if (gvar->getName().equals("$sSo18CFDateFormatterRefaMf")) {
2709-
gvar->dump();
2710-
}
27112708
}
27122709
llvm::Constant *addr = gvar;
27132710
if (var->isInitializedObject() && !canMakeStaticObjectsReadOnly()) {
@@ -5135,6 +5132,10 @@ IRGenModule::getAddrOfTypeMetadata(CanType concreteType,
51355132

51365133
if (auto *GV = dyn_cast<llvm::GlobalVariable>(addr.getValue()))
51375134
GV->setComdat(nullptr);
5135+
if (addr.getValue()->getName().equals("$sSo18CFDateFormatterRefaMf")) {
5136+
addr.getValue()->dump();
5137+
}
5138+
51385139

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

0 commit comments

Comments
 (0)