37 lines
1.3 KiB
Text
37 lines
1.3 KiB
Text
|
Add retguard for arm64.
|
||
|
|
||
|
Index: lib/Target/AArch64/AArch64FrameLowering.h
|
||
|
--- lib/Target/AArch64/AArch64FrameLowering.h.orig
|
||
|
+++ lib/Target/AArch64/AArch64FrameLowering.h
|
||
|
@@ -13,6 +13,7 @@
|
||
|
#ifndef LLVM_LIB_TARGET_AARCH64_AARCH64FRAMELOWERING_H
|
||
|
#define LLVM_LIB_TARGET_AARCH64_AARCH64FRAMELOWERING_H
|
||
|
|
||
|
+#include "AArch64ReturnProtectorLowering.h"
|
||
|
#include "llvm/Support/TypeSize.h"
|
||
|
#include "llvm/CodeGen/TargetFrameLowering.h"
|
||
|
|
||
|
@@ -22,9 +23,12 @@ class MCCFIInstruction;
|
||
|
|
||
|
class AArch64FrameLowering : public TargetFrameLowering {
|
||
|
public:
|
||
|
+
|
||
|
+ const AArch64ReturnProtectorLowering RPL;
|
||
|
+
|
||
|
explicit AArch64FrameLowering()
|
||
|
: TargetFrameLowering(StackGrowsDown, Align(16), 0, Align(16),
|
||
|
- true /*StackRealignable*/) {}
|
||
|
+ true /*StackRealignable*/), RPL() {}
|
||
|
|
||
|
void
|
||
|
emitCalleeSavedFrameMoves(MachineBasicBlock &MBB,
|
||
|
@@ -38,6 +42,8 @@ class AArch64FrameLowering : public TargetFrameLowerin
|
||
|
/// the function.
|
||
|
void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
|
||
|
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
|
||
|
+
|
||
|
+ const ReturnProtectorLowering *getReturnProtector() const override;
|
||
|
|
||
|
bool canUseAsPrologue(const MachineBasicBlock &MBB) const override;
|
||
|
|