[llvm] [MergeFunctions] keep the symbol of a function an alias points at on COFF (PR #222024)

Charles Zablit via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 18 09:50:31 PDT 2026


================
@@ -858,6 +860,21 @@ static bool canCreateAliasFor(Function *F) {
   return true;
 }
 
+static bool hasNonLocalAlias(const Function *F) {
+  for (const GlobalAlias &GA : F->getParent()->aliases())
+    if (!GA.hasLocalLinkage() && GA.getAliaseeObject() == F)
+      return true;
+  return false;
+}
+
+/// A COFF weak external must name its target, and a local symbol has no name
+/// the linker can agree on across objects (LNK1227).
+static bool canBeAliasee(const Function *F) {
----------------
charles-zablit wrote:

It matches the existing terminology: `getAliaseeObject()`, `getAliasee()`, `setAliasee()`.

https://github.com/llvm/llvm-project/pull/222024


More information about the llvm-commits mailing list