File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -712,7 +712,7 @@ bool AArch64Arm64ECCallLowering::processFunction(
712
712
// name (emitting the definition) can grab it from the metadata.
713
713
//
714
714
// FIXME: Handle functions with weak linkage?
715
- if (F. hasExternalLinkage () || F.hasWeakLinkage () || F. hasLinkOnceLinkage ()) {
715
+ if (!F. hasLocalLinkage () || F.hasAddressTaken ()) {
716
716
if (std::optional<std::string> MangledName =
717
717
getArm64ECMangledFunctionName (F.getName ().str ())) {
718
718
F.setMetadata (" arm64ec_unmangled_name" ,
Original file line number Diff line number Diff line change @@ -1121,7 +1121,8 @@ void AArch64AsmPrinter::emitFunctionEntryLabel() {
1121
1121
TS->emitDirectiveVariantPCS (CurrentFnSym);
1122
1122
}
1123
1123
1124
- if (TM.getTargetTriple ().isWindowsArm64EC ()) {
1124
+ if (TM.getTargetTriple ().isWindowsArm64EC () &&
1125
+ !MF->getFunction ().hasLocalLinkage ()) {
1125
1126
// For ARM64EC targets, a function definition's name is mangled differently
1126
1127
// from the normal symbol. We emit the alias from the unmangled symbol to
1127
1128
// mangled symbol name here.
Original file line number Diff line number Diff line change 2
2
3
3
; Validates when local linkage functions get a thunk generated.
4
4
5
- ; Being called does not cause a thunk to be generated.
5
+ ; Being called does not cause a thunk to be generated or the symbol name to be mangled.
6
+ ; CHECK-NOT: "#does_not_have_addr_taken":
6
7
; CHECK-NOT: $ientry_thunk$cdecl$v$f;
7
8
define internal void @does_not_have_addr_taken (float ) nounwind {
8
9
ret void
@@ -12,7 +13,8 @@ define void @calls_does_not_have_addr_taken() nounwind {
12
13
ret void
13
14
}
14
15
15
- ; Having an address taken does cause a thunk to be generated.
16
+ ; Having an address taken does cause a thunk to be generated and the symbol name to be mangled.
17
+ ; CHECK: "#has_addr_taken":
16
18
; CHECK: $ientry_thunk$cdecl$v$i8;
17
19
define internal void @has_addr_taken (i64 ) nounwind {
18
20
ret void
You can’t perform that action at this time.
0 commit comments