Skip to content

[AArch64][PAC][NFC] Make checkAuthenticatedRegister() return void #92507

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions llvm/lib/Target/AArch64/AArch64PointerAuth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ MachineMemOperand *createCheckMemOperand(MachineFunction &MF,

} // namespace

MachineBasicBlock &llvm::AArch64PAuth::checkAuthenticatedRegister(
void llvm::AArch64PAuth::checkAuthenticatedRegister(
MachineBasicBlock::iterator MBBI, AuthCheckMethod Method,
Register AuthenticatedReg, Register TmpReg, bool UseIKey, unsigned BrkImm) {

Expand All @@ -246,13 +246,13 @@ MachineBasicBlock &llvm::AArch64PAuth::checkAuthenticatedRegister(
default:
break;
case AuthCheckMethod::None:
return MBB;
return;
case AuthCheckMethod::DummyLoad:
BuildMI(MBB, MBBI, DL, TII->get(AArch64::LDRWui), getWRegFromXReg(TmpReg))
.addReg(AuthenticatedReg)
.addImm(0)
.addMemOperand(createCheckMemOperand(MF, Subtarget));
return MBB;
return;
}

// Control flow has to be changed, so arrange new MBBs.
Expand Down Expand Up @@ -287,7 +287,7 @@ MachineBasicBlock &llvm::AArch64PAuth::checkAuthenticatedRegister(
.addReg(TmpReg)
.addImm(62)
.addMBB(BreakBlock);
return *SuccessBlock;
return;
case AuthCheckMethod::XPACHint:
assert(AuthenticatedReg == AArch64::LR &&
"XPACHint mode is only compatible with checking the LR register");
Expand All @@ -304,7 +304,7 @@ MachineBasicBlock &llvm::AArch64PAuth::checkAuthenticatedRegister(
BuildMI(CheckBlock, DL, TII->get(AArch64::Bcc))
.addImm(AArch64CC::NE)
.addMBB(BreakBlock);
return *SuccessBlock;
return;
}
llvm_unreachable("Unknown AuthCheckMethod enum");
}
Expand Down
12 changes: 4 additions & 8 deletions llvm/lib/Target/AArch64/AArch64PointerAuth.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,10 @@ enum class AuthCheckMethod {
/// using an I-key or D-key and which register can be used as temporary.
/// If an explicit BRK instruction is used to generate an exception, BrkImm
/// specifies its immediate operand.
///
/// \returns The machine basic block containing the code that is executed
/// after the check succeeds.
MachineBasicBlock &checkAuthenticatedRegister(MachineBasicBlock::iterator MBBI,
AuthCheckMethod Method,
Register AuthenticatedReg,
Register TmpReg, bool UseIKey,
unsigned BrkImm);
void checkAuthenticatedRegister(MachineBasicBlock::iterator MBBI,
AuthCheckMethod Method,
Register AuthenticatedReg, Register TmpReg,
bool UseIKey, unsigned BrkImm);

/// Returns the number of bytes added by checkAuthenticatedRegister.
unsigned getCheckerSizeInBytes(AuthCheckMethod Method);
Expand Down
Loading