Skip to content

Commit 0b32769

Browse files
committed
[ARM] Apply sign-return-address attribute to outlined function
This make checking for whether PAC is necessary simpler when building the outlined frame.
1 parent 95e5a99 commit 0b32769

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6207,6 +6207,9 @@ void ARMBaseInstrInfo::mergeOutliningCandidateAttributes(
62076207
if (CFn.hasFnAttribute("branch-target-enforcement"))
62086208
F.addFnAttr(CFn.getFnAttribute("branch-target-enforcement"));
62096209

6210+
if (CFn.hasFnAttribute("sign-return-address"))
6211+
F.addFnAttr(CFn.getFnAttribute("sign-return-address"));
6212+
62106213
ARMGenInstrInfo::mergeOutliningCandidateAttributes(F, Candidates);
62116214
}
62126215

@@ -6623,10 +6626,7 @@ void ARMBaseInstrInfo::buildOutlinedFrame(
66236626
MBB.addLiveIn(ARM::LR);
66246627

66256628
// Insert a save before the outlined region
6626-
bool Auth = OF.Candidates.front()
6627-
.getMF()
6628-
->getInfo<ARMFunctionInfo>()
6629-
->shouldSignReturnAddress(true);
6629+
bool Auth = MF.getInfo<ARMFunctionInfo>()->shouldSignReturnAddress(true);
66306630
saveLROnStack(MBB, It, true, Auth);
66316631

66326632
// Fix up the instructions in the range, since we're going to modify the

0 commit comments

Comments
 (0)