@@ -813,8 +813,8 @@ bool AArch64Arm64ECCallLowering::runOnModule(Module &Mod) {
813813 }
814814 }
815815
816- if (!F.hasFnAttribute (Attribute::HybridPatchable) || F. isDeclaration () ||
817- F.hasLocalLinkage () ||
816+ if (!F.hasFnAttribute (Attribute::HybridPatchable) ||
817+ F.isDeclarationForLinker () || F. hasLocalLinkage () ||
818818 F.getName ().ends_with (HybridPatchableTargetSuffix))
819819 continue ;
820820
@@ -857,7 +857,7 @@ bool AArch64Arm64ECCallLowering::runOnModule(Module &Mod) {
857857
858858 SetVector<GlobalValue *> DirectCalledFns;
859859 for (Function &F : Mod)
860- if (!F.isDeclaration () &&
860+ if (!F.isDeclarationForLinker () &&
861861 F.getCallingConv () != CallingConv::ARM64EC_Thunk_Native &&
862862 F.getCallingConv () != CallingConv::ARM64EC_Thunk_X64)
863863 processFunction (F, DirectCalledFns, FnsMap);
@@ -869,7 +869,8 @@ bool AArch64Arm64ECCallLowering::runOnModule(Module &Mod) {
869869 };
870870 SmallVector<ThunkInfo> ThunkMapping;
871871 for (Function &F : Mod) {
872- if (!F.isDeclaration () && (!F.hasLocalLinkage () || F.hasAddressTaken ()) &&
872+ if (!F.isDeclarationForLinker () &&
873+ (!F.hasLocalLinkage () || F.hasAddressTaken ()) &&
873874 F.getCallingConv () != CallingConv::ARM64EC_Thunk_Native &&
874875 F.getCallingConv () != CallingConv::ARM64EC_Thunk_X64) {
875876 if (!F.hasComdat ())
@@ -959,7 +960,7 @@ bool AArch64Arm64ECCallLowering::processFunction(
959960 // unprototyped functions in C)
960961 if (Function *F = CB->getCalledFunction ()) {
961962 if (!LowerDirectToIndirect || F->hasLocalLinkage () ||
962- F->isIntrinsic () || !F->isDeclaration ())
963+ F->isIntrinsic () || !F->isDeclarationForLinker ())
963964 continue ;
964965
965966 DirectCalledFns.insert (F);
0 commit comments