Skip to content

Commit 3eb7711

Browse files
authored
[AArch64][PAC][NFC] Make checkAuthenticatedRegister() return void (#92507)
The return value is not used. This change simplifies the upcoming fix
1 parent 243611e commit 3eb7711

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

llvm/lib/Target/AArch64/AArch64PointerAuth.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ MachineMemOperand *createCheckMemOperand(MachineFunction &MF,
231231

232232
} // namespace
233233

234-
MachineBasicBlock &llvm::AArch64PAuth::checkAuthenticatedRegister(
234+
void llvm::AArch64PAuth::checkAuthenticatedRegister(
235235
MachineBasicBlock::iterator MBBI, AuthCheckMethod Method,
236236
Register AuthenticatedReg, Register TmpReg, bool UseIKey, unsigned BrkImm) {
237237

@@ -246,13 +246,13 @@ MachineBasicBlock &llvm::AArch64PAuth::checkAuthenticatedRegister(
246246
default:
247247
break;
248248
case AuthCheckMethod::None:
249-
return MBB;
249+
return;
250250
case AuthCheckMethod::DummyLoad:
251251
BuildMI(MBB, MBBI, DL, TII->get(AArch64::LDRWui), getWRegFromXReg(TmpReg))
252252
.addReg(AuthenticatedReg)
253253
.addImm(0)
254254
.addMemOperand(createCheckMemOperand(MF, Subtarget));
255-
return MBB;
255+
return;
256256
}
257257

258258
// Control flow has to be changed, so arrange new MBBs.
@@ -287,7 +287,7 @@ MachineBasicBlock &llvm::AArch64PAuth::checkAuthenticatedRegister(
287287
.addReg(TmpReg)
288288
.addImm(62)
289289
.addMBB(BreakBlock);
290-
return *SuccessBlock;
290+
return;
291291
case AuthCheckMethod::XPACHint:
292292
assert(AuthenticatedReg == AArch64::LR &&
293293
"XPACHint mode is only compatible with checking the LR register");
@@ -304,7 +304,7 @@ MachineBasicBlock &llvm::AArch64PAuth::checkAuthenticatedRegister(
304304
BuildMI(CheckBlock, DL, TII->get(AArch64::Bcc))
305305
.addImm(AArch64CC::NE)
306306
.addMBB(BreakBlock);
307-
return *SuccessBlock;
307+
return;
308308
}
309309
llvm_unreachable("Unknown AuthCheckMethod enum");
310310
}

llvm/lib/Target/AArch64/AArch64PointerAuth.h

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,10 @@ enum class AuthCheckMethod {
9898
/// using an I-key or D-key and which register can be used as temporary.
9999
/// If an explicit BRK instruction is used to generate an exception, BrkImm
100100
/// specifies its immediate operand.
101-
///
102-
/// \returns The machine basic block containing the code that is executed
103-
/// after the check succeeds.
104-
MachineBasicBlock &checkAuthenticatedRegister(MachineBasicBlock::iterator MBBI,
105-
AuthCheckMethod Method,
106-
Register AuthenticatedReg,
107-
Register TmpReg, bool UseIKey,
108-
unsigned BrkImm);
101+
void checkAuthenticatedRegister(MachineBasicBlock::iterator MBBI,
102+
AuthCheckMethod Method,
103+
Register AuthenticatedReg, Register TmpReg,
104+
bool UseIKey, unsigned BrkImm);
109105

110106
/// Returns the number of bytes added by checkAuthenticatedRegister.
111107
unsigned getCheckerSizeInBytes(AuthCheckMethod Method);

0 commit comments

Comments
 (0)