LLVM: include/llvm/CodeGen/StackProtector.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16#ifndef LLVM_CODEGEN_STACKPROTECTOR_H

17#define LLVM_CODEGEN_STACKPROTECTOR_H

18

25

26namespace llvm {

27

33

38 static constexpr unsigned DefaultSSPBufferSize = 8;

39

40

41 using SSPLayoutMap =

43

44

45

46

47 SSPLayoutMap Layout;

48

49

50

51 unsigned SSPBufferSize = DefaultSSPBufferSize;

52

53 bool RequireStackProtector = false;

54

55

56 bool HasPrologue = false;

57

58

59 bool HasIRCheck = false;

60

61public:

62

64

66};

67

70 using SSPLayoutMap = SSPLayoutInfo::SSPLayoutMap;

71

73

74public:

76

78

79

80

82 SSPLayoutMap *Layout = nullptr);

83};

84

92

94private:

95

96 using SSPLayoutMap = SSPLayoutInfo::SSPLayoutMap;

97

99

102

103 std::optional DTU;

104

106

107public:

108 static char ID;

109

111

113

115

116

118 return LayoutInfo.shouldEmitSDCheck(BB);

119 }

120

122

124 LayoutInfo.copyToMachineFrameInfo(MFI);

125 }

126

127

128

130 SSPLayoutMap *Layout = nullptr) {

132 }

133};

134

135}

136

137#endif

This header defines various interfaces for pass management in LLVM.

FunctionAnalysisManager FAM

Represent the analysis usage information of a pass.

LLVM Basic Block Representation.

The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.

A Module instance is used to store all the information related to an LLVM module.

A set of analyses that are preserved following a run of a transformation pass.

Definition StackProtector.h:68

static bool requiresStackProtector(Function *F, SSPLayoutMap *Layout=nullptr)

Check whether or not F needs a stack protector based upon the stack protector level.

Result run(Function &F, FunctionAnalysisManager &FAM)

SSPLayoutInfo Result

Definition StackProtector.h:75

Definition StackProtector.h:34

void copyToMachineFrameInfo(MachineFrameInfo &MFI) const

friend class StackProtectorPass

Definition StackProtector.h:35

bool shouldEmitSDCheck(const BasicBlock &BB) const

friend class SSPLayoutAnalysis

Definition StackProtector.h:36

friend class StackProtector

Definition StackProtector.h:37

StackProtectorPass(const TargetMachine &TM)

Definition StackProtector.h:89

PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM)

void getAnalysisUsage(AnalysisUsage &AU) const override

getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...

static char ID

Definition StackProtector.h:108

bool shouldEmitSDCheck(const BasicBlock &BB) const

Definition StackProtector.h:117

static bool requiresStackProtector(Function *F, SSPLayoutMap *Layout=nullptr)

Check whether or not F needs a stack protector based upon the stack protector level.

Definition StackProtector.h:129

bool runOnFunction(Function &Fn) override

runOnFunction - Virtual method overriden by subclasses to do the per-function processing of the pass.

SSPLayoutInfo & getLayoutInfo()

Definition StackProtector.h:112

void copyToMachineFrameInfo(MachineFrameInfo &MFI) const

Definition StackProtector.h:123

This base class for TargetLowering contains the SelectionDAG-independent parts that can be used from ...

Primary interface to the complete machine description for the target machine.

This is an optimization pass for GlobalISel generic memory operations.

AnalysisManager< Function > FunctionAnalysisManager

Convenience typedef for the Function analysis manager.

A CRTP mix-in that provides informational APIs needed for analysis passes.

A special type used by analysis passes to provide an address that identifies that particular analysis...

A CRTP mix-in to automatically provide informational APIs needed for passes.