From c86c2a24f44ffd9e0af8a7587d6e1f080311b27e Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Wed, 23 Jul 2025 15:51:27 -0700 Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?= =?UTF-8?q?l=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Created using spr 1.3.6 --- llvm/lib/Transforms/IPO/LowerTypeTests.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/llvm/lib/Transforms/IPO/LowerTypeTests.cpp b/llvm/lib/Transforms/IPO/LowerTypeTests.cpp index 486205c8a3848..43f22bcc892ef 100644 --- a/llvm/lib/Transforms/IPO/LowerTypeTests.cpp +++ b/llvm/lib/Transforms/IPO/LowerTypeTests.cpp @@ -2453,6 +2453,17 @@ bool LowerTypeTestsModule::lower() { } else { Alias->setName(AliasName); } + + if (auto *F = M.getFunction((AliasName + ".cfi").str())) { + // Function can be an alias. In such case we need definition of .cfi + // of aliasee. + if (auto *CfiAleasee = M.getFunction((Aliasee + ".cfi").str())) { + F->replaceAllUsesWith(CfiAleasee); + F->eraseFromParent(); + } else { + F->setName(Aliasee + ".cfi"); + } + } } } }