28 : HasRedZone(MFI.hasRedZone()) {}
44 if (!
F.hasFnAttribute(
"sign-return-address")) {
45 const Module &M = *
F.getParent();
46 if (
const auto *Sign = mdconst::extract_or_null<ConstantInt>(
47 M.getModuleFlag(
"sign-return-address"))) {
48 if (Sign->getZExtValue()) {
49 if (
const auto *
All = mdconst::extract_or_null<ConstantInt>(
50 M.getModuleFlag(
"sign-return-address-all")))
51 return {
true,
All->getZExtValue()};
55 return {
false,
false};
58 StringRef Scope =
F.getFnAttribute(
"sign-return-address").getValueAsString();
59 if (Scope.equals(
"none"))
60 return {
false,
false};
62 if (Scope.equals(
"all"))
65 assert(Scope.equals(
"non-leaf"));
70 if (!
F.hasFnAttribute(
"sign-return-address-key")) {
71 if (
const auto *BKey = mdconst::extract_or_null<ConstantInt>(
72 F.getParent()->getModuleFlag(
"sign-return-address-with-bkey")))
73 return BKey->getZExtValue();
80 F.getFnAttribute(
"sign-return-address-key").getValueAsString();
81 assert(Key.equals_insensitive(
"a_key") || Key.equals_insensitive(
"b_key"));
82 return Key.equals_insensitive(
"b_key");
89 if (
F.hasFnAttribute(Attribute::NoRedZone))
94 IsMTETagged =
F.hasFnAttribute(Attribute::SanitizeMemTag);
96 if (!
F.hasFnAttribute(
"branch-target-enforcement")) {
97 if (
const auto *BTE = mdconst::extract_or_null<ConstantInt>(
98 F.getParent()->getModuleFlag(
"branch-target-enforcement")))
99 BranchTargetEnforcement = BTE->getZExtValue();
104 F.getFnAttribute(
"branch-target-enforcement").getValueAsString();
118 if (!SignReturnAddress)
120 if (SignReturnAddressAll)
129 [](
const auto &
Info) { return Info.getReg() == AArch64::LR; }));
134 if (!NeedsDwarfUnwindInfo)
138 return *NeedsDwarfUnwindInfo;
143 if (!NeedsAsyncDwarfUnwindInfo) {
148 NeedsAsyncDwarfUnwindInfo = needsDwarfUnwindInfo(MF) &&
152 return *NeedsAsyncDwarfUnwindInfo;
static std::pair< bool, bool > GetSignReturnAddress(const Function &F)
static bool ShouldSignWithBKey(const Function &F, const AArch64Subtarget &STI)
Analysis containing CSE Info
This file contains the declarations for the subclasses of Constant, which represent the different fla...
Module.h This file contains the declarations for the Module class.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
AArch64FunctionInfo - This class is derived from MachineFunctionInfo and contains private AArch64-spe...
bool shouldSignReturnAddress(const MachineFunction &MF) const
bool needsDwarfUnwindInfo(const MachineFunction &MF) const
void initializeBaseYamlFields(const yaml::AArch64FunctionInfo &YamlMFI)
bool needsAsyncDwarfUnwindInfo(const MachineFunction &MF) const
MachineFunctionInfo * clone(BumpPtrAllocator &Allocator, MachineFunction &DestMF, const DenseMap< MachineBasicBlock *, MachineBasicBlock * > &Src2DstMBB) const override
Make a functionally equivalent copy of this MachineFunctionInfo in MF.
const Triple & getTargetTriple() const
Allocate memory in an ever growing pool, as if by bump-pointer.
bool usesWindowsCFI() const
const std::vector< CalleeSavedInfo > & getCalleeSavedInfo() const
Returns a reference to call saved info vector for the current function.
bool needsFrameMoves() const
True if this function needs frame moves for debug or exceptions.
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
Function & getFunction()
Return the LLVM function that this machine code represents.
const LLVMTargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
Ty * cloneInfo(const Ty &Old)
A Module instance is used to store all the information related to an LLVM module.
StringRef - Represent a constant reference to a string, i.e.
bool equals_insensitive(StringRef RHS) const
Check for string equality, ignoring case.
const MCAsmInfo * getMCAsmInfo() const
Return target specific asm information.
bool isOSWindows() const
Tests whether the OS is Windows.
This is an optimization pass for GlobalISel generic memory operations.
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.
@ Async
"Asynchronous" unwind tables (instr precise)
MachineFunctionInfo - This class can be derived from and used by targets to hold private target-speci...
std::optional< bool > HasRedZone
AArch64FunctionInfo()=default
void mappingImpl(yaml::IO &YamlIO) override