#include "AArch64PointerAuth.h"
#include "AArch64.h"
#include "AArch64InstrInfo.h"
#include "AArch64MachineFunctionInfo.h"
#include "AArch64Subtarget.h"
#include "Utils/AArch64BaseInfo.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
usingnamespacellvm;
usingnamespacellvm::AArch64PAuth;
#define AARCH64_POINTER_AUTH_NAME …
namespace {
class AArch64PointerAuth : public MachineFunctionPass { … };
}
INITIALIZE_PASS(…)
FunctionPass *llvm::createAArch64PointerAuthPass() { … }
char AArch64PointerAuth::ID = …;
static void BuildPACM(const AArch64Subtarget &Subtarget, MachineBasicBlock &MBB,
MachineBasicBlock::iterator MBBI, DebugLoc DL,
MachineInstr::MIFlag Flags, MCSymbol *PACSym = nullptr) { … }
void AArch64PointerAuth::signLR(MachineFunction &MF,
MachineBasicBlock::iterator MBBI) const { … }
void AArch64PointerAuth::authenticateLR(
MachineFunction &MF, MachineBasicBlock::iterator MBBI) const { … }
namespace {
MachineMemOperand *createCheckMemOperand(MachineFunction &MF,
const AArch64Subtarget &Subtarget) { … }
}
void llvm::AArch64PAuth::checkAuthenticatedRegister(
MachineBasicBlock::iterator MBBI, AuthCheckMethod Method,
Register AuthenticatedReg, Register TmpReg, bool UseIKey, unsigned BrkImm) { … }
unsigned llvm::AArch64PAuth::getCheckerSizeInBytes(AuthCheckMethod Method) { … }
bool AArch64PointerAuth::checkAuthenticatedLR(
MachineBasicBlock::iterator TI) const { … }
void AArch64PointerAuth::emitBlend(MachineBasicBlock::iterator MBBI,
Register Result, Register AddrDisc,
unsigned IntDisc) const { … }
void AArch64PointerAuth::expandPAuthBlend(
MachineBasicBlock::iterator MBBI) const { … }
bool AArch64PointerAuth::runOnMachineFunction(MachineFunction &MF) { … }