13
13
#ifndef LLVM_IR_ARGUMENT_H
14
14
#define LLVM_IR_ARGUMENT_H
15
15
16
+ #include " llvm/Support/Compiler.h"
16
17
#include " llvm/ADT/Twine.h"
17
18
#include " llvm/IR/Attributes.h"
18
19
#include " llvm/IR/Value.h"
@@ -37,7 +38,7 @@ class Argument final : public Value {
37
38
38
39
public:
39
40
// / Argument constructor.
40
- explicit Argument (Type *Ty, const Twine &Name = " " , Function *F = nullptr ,
41
+ LLVM_ABI explicit Argument (Type *Ty, const Twine &Name = " " , Function *F = nullptr ,
41
42
unsigned ArgNo = 0 );
42
43
43
44
inline const Function *getParent () const { return Parent; }
@@ -56,133 +57,133 @@ class Argument final : public Value {
56
57
// / addrspace(0).
57
58
// / If AllowUndefOrPoison is true, respect the semantics of nonnull attribute
58
59
// / and return true even if the argument can be undef or poison.
59
- bool hasNonNullAttr (bool AllowUndefOrPoison = true ) const ;
60
+ LLVM_ABI bool hasNonNullAttr (bool AllowUndefOrPoison = true ) const ;
60
61
61
62
// / If this argument has the dereferenceable attribute, return the number of
62
63
// / bytes known to be dereferenceable. Otherwise, zero is returned.
63
- uint64_t getDereferenceableBytes () const ;
64
+ LLVM_ABI uint64_t getDereferenceableBytes () const ;
64
65
65
66
// / If this argument has the dereferenceable_or_null attribute, return the
66
67
// / number of bytes known to be dereferenceable. Otherwise, zero is returned.
67
- uint64_t getDereferenceableOrNullBytes () const ;
68
+ LLVM_ABI uint64_t getDereferenceableOrNullBytes () const ;
68
69
69
70
// / If this argument has nofpclass attribute, return the mask representing
70
71
// / disallowed floating-point values. Otherwise, fcNone is returned.
71
- FPClassTest getNoFPClass () const ;
72
+ LLVM_ABI FPClassTest getNoFPClass () const ;
72
73
73
74
// / If this argument has a range attribute, return the value range of the
74
75
// / argument. Otherwise, std::nullopt is returned.
75
- std::optional<ConstantRange> getRange () const ;
76
+ LLVM_ABI std::optional<ConstantRange> getRange () const ;
76
77
77
78
// / Return true if this argument has the byval attribute.
78
- bool hasByValAttr () const ;
79
+ LLVM_ABI bool hasByValAttr () const ;
79
80
80
81
// / Return true if this argument has the byref attribute.
81
- bool hasByRefAttr () const ;
82
+ LLVM_ABI bool hasByRefAttr () const ;
82
83
83
84
// / Return true if this argument has the swiftself attribute.
84
- bool hasSwiftSelfAttr () const ;
85
+ LLVM_ABI bool hasSwiftSelfAttr () const ;
85
86
86
87
// / Return true if this argument has the swifterror attribute.
87
- bool hasSwiftErrorAttr () const ;
88
+ LLVM_ABI bool hasSwiftErrorAttr () const ;
88
89
89
90
// / Return true if this argument has the byval, inalloca, or preallocated
90
91
// / attribute. These attributes represent arguments being passed by value,
91
92
// / with an associated copy between the caller and callee
92
- bool hasPassPointeeByValueCopyAttr () const ;
93
+ LLVM_ABI bool hasPassPointeeByValueCopyAttr () const ;
93
94
94
95
// / If this argument satisfies has hasPassPointeeByValueAttr, return the
95
96
// / in-memory ABI size copied to the stack for the call. Otherwise, return 0.
96
- uint64_t getPassPointeeByValueCopySize (const DataLayout &DL) const ;
97
+ LLVM_ABI uint64_t getPassPointeeByValueCopySize (const DataLayout &DL) const ;
97
98
98
99
// / Return true if this argument has the byval, sret, inalloca, preallocated,
99
100
// / or byref attribute. These attributes represent arguments being passed by
100
101
// / value (which may or may not involve a stack copy)
101
- bool hasPointeeInMemoryValueAttr () const ;
102
+ LLVM_ABI bool hasPointeeInMemoryValueAttr () const ;
102
103
103
104
// / If hasPointeeInMemoryValueAttr returns true, the in-memory ABI type is
104
105
// / returned. Otherwise, nullptr.
105
- Type *getPointeeInMemoryValueType () const ;
106
+ LLVM_ABI Type *getPointeeInMemoryValueType () const ;
106
107
107
108
// / If this is a byval or inalloca argument, return its alignment.
108
109
// / FIXME: Remove this function once transition to Align is over.
109
110
// / Use getParamAlign() instead.
110
- LLVM_DEPRECATED (" Use getParamAlign() instead" , " getParamAlign" )
111
+ LLVM_ABI LLVM_DEPRECATED (" Use getParamAlign() instead" , " getParamAlign" )
111
112
uint64_t getParamAlignment() const ;
112
113
113
114
// / If this is a byval or inalloca argument, return its alignment.
114
- MaybeAlign getParamAlign () const ;
115
+ LLVM_ABI MaybeAlign getParamAlign () const ;
115
116
116
- MaybeAlign getParamStackAlign () const ;
117
+ LLVM_ABI MaybeAlign getParamStackAlign () const ;
117
118
118
119
// / If this is a byval argument, return its type.
119
- Type *getParamByValType () const ;
120
+ LLVM_ABI Type *getParamByValType () const ;
120
121
121
122
// / If this is an sret argument, return its type.
122
- Type *getParamStructRetType () const ;
123
+ LLVM_ABI Type *getParamStructRetType () const ;
123
124
124
125
// / If this is a byref argument, return its type.
125
- Type *getParamByRefType () const ;
126
+ LLVM_ABI Type *getParamByRefType () const ;
126
127
127
128
// / If this is an inalloca argument, return its type.
128
- Type *getParamInAllocaType () const ;
129
+ LLVM_ABI Type *getParamInAllocaType () const ;
129
130
130
131
// / Return true if this argument has the nest attribute.
131
- bool hasNestAttr () const ;
132
+ LLVM_ABI bool hasNestAttr () const ;
132
133
133
134
// / Return true if this argument has the noalias attribute.
134
- bool hasNoAliasAttr () const ;
135
+ LLVM_ABI bool hasNoAliasAttr () const ;
135
136
136
137
// / Return true if this argument has the nocapture attribute.
137
- bool hasNoCaptureAttr () const ;
138
+ LLVM_ABI bool hasNoCaptureAttr () const ;
138
139
139
140
// / Return true if this argument has the nofree attribute.
140
- bool hasNoFreeAttr () const ;
141
+ LLVM_ABI bool hasNoFreeAttr () const ;
141
142
142
143
// / Return true if this argument has the sret attribute.
143
- bool hasStructRetAttr () const ;
144
+ LLVM_ABI bool hasStructRetAttr () const ;
144
145
145
146
// / Return true if this argument has the inreg attribute.
146
- bool hasInRegAttr () const ;
147
+ LLVM_ABI bool hasInRegAttr () const ;
147
148
148
149
// / Return true if this argument has the returned attribute.
149
- bool hasReturnedAttr () const ;
150
+ LLVM_ABI bool hasReturnedAttr () const ;
150
151
151
152
// / Return true if this argument has the readonly or readnone attribute.
152
- bool onlyReadsMemory () const ;
153
+ LLVM_ABI bool onlyReadsMemory () const ;
153
154
154
155
// / Return true if this argument has the inalloca attribute.
155
- bool hasInAllocaAttr () const ;
156
+ LLVM_ABI bool hasInAllocaAttr () const ;
156
157
157
158
// / Return true if this argument has the preallocated attribute.
158
- bool hasPreallocatedAttr () const ;
159
+ LLVM_ABI bool hasPreallocatedAttr () const ;
159
160
160
161
// / Return true if this argument has the zext attribute.
161
- bool hasZExtAttr () const ;
162
+ LLVM_ABI bool hasZExtAttr () const ;
162
163
163
164
// / Return true if this argument has the sext attribute.
164
- bool hasSExtAttr () const ;
165
+ LLVM_ABI bool hasSExtAttr () const ;
165
166
166
167
// / Add attributes to an argument.
167
- void addAttrs (AttrBuilder &B);
168
+ LLVM_ABI void addAttrs (AttrBuilder &B);
168
169
169
- void addAttr (Attribute::AttrKind Kind);
170
+ LLVM_ABI void addAttr (Attribute::AttrKind Kind);
170
171
171
- void addAttr (Attribute Attr);
172
+ LLVM_ABI void addAttr (Attribute Attr);
172
173
173
174
// / Remove attributes from an argument.
174
- void removeAttr (Attribute::AttrKind Kind);
175
+ LLVM_ABI void removeAttr (Attribute::AttrKind Kind);
175
176
176
- void removeAttrs (const AttributeMask &AM);
177
+ LLVM_ABI void removeAttrs (const AttributeMask &AM);
177
178
178
179
// / Check if an argument has a given attribute.
179
- bool hasAttribute (Attribute::AttrKind Kind) const ;
180
+ LLVM_ABI bool hasAttribute (Attribute::AttrKind Kind) const ;
180
181
181
- bool hasAttribute (StringRef Kind) const ;
182
+ LLVM_ABI bool hasAttribute (StringRef Kind) const ;
182
183
183
- Attribute getAttribute (Attribute::AttrKind Kind) const ;
184
+ LLVM_ABI Attribute getAttribute (Attribute::AttrKind Kind) const ;
184
185
185
- AttributeSet getAttributes () const ;
186
+ LLVM_ABI AttributeSet getAttributes () const ;
186
187
187
188
// / Method for support type inquiry through isa, cast, and dyn_cast.
188
189
static bool classof (const Value *V) {
0 commit comments