Skip to content

Commit 1fa8394

Browse files
committed
Revert "[llvm][CFI] Do not canonicalize COFF functions in a comdat (#139962)"
This reverts commit 33684ac. Reverting since this is breaking a bunch of builders. See the llvm-ci messages on #139962.
1 parent dd4b69f commit 1fa8394

File tree

2 files changed

+1
-50
lines changed

2 files changed

+1
-50
lines changed

llvm/lib/Transforms/IPO/LowerTypeTests.cpp

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1711,22 +1711,8 @@ void LowerTypeTestsModule::buildBitSetsFromFunctionsNative(
17111711
F->getValueType(), 0, F->getLinkage(), "", CombinedGlobalElemPtr, &M);
17121712
FAlias->setVisibility(F->getVisibility());
17131713
FAlias->takeName(F);
1714-
if (FAlias->hasName()) {
1714+
if (FAlias->hasName())
17151715
F->setName(FAlias->getName() + ".cfi");
1716-
// For COFF we should also rename the comdat if this function also
1717-
// happens to be the key function. Even if the comdat name changes, this
1718-
// should still be fine since comdat and symbol resolution happens
1719-
// before LTO, so all symbols which would prevail have been selected.
1720-
if (F->hasComdat() && ObjectFormat == Triple::COFF &&
1721-
F->getComdat()->getName() == FAlias->getName()) {
1722-
Comdat *OldComdat = F->getComdat();
1723-
Comdat *NewComdat = M.getOrInsertComdat(F->getName());
1724-
for (GlobalObject &GO : M.global_objects()) {
1725-
if (GO.getComdat() == OldComdat)
1726-
GO.setComdat(NewComdat);
1727-
}
1728-
}
1729-
}
17301716
replaceCfiUses(F, FAlias, IsJumpTableCanonical);
17311717
if (!F->hasLocalLinkage())
17321718
F->setVisibility(GlobalVariable::HiddenVisibility);

llvm/test/Transforms/LowerTypeTests/cfi-coff-comdat-rename.ll

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)