Subversion Repositories QNX 8.QNX8 LLVM/Clang compiler suite

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
14 pmbaty 1
#ifdef GET_ATTR_NAMES
2
#undef GET_ATTR_NAMES
3
#ifndef ATTRIBUTE_ALL
4
#define ATTRIBUTE_ALL(FIRST, SECOND)
5
#endif
6
 
7
#ifndef ATTRIBUTE_ENUM
8
#define ATTRIBUTE_ENUM(FIRST, SECOND) ATTRIBUTE_ALL(FIRST, SECOND)
9
#endif
10
 
11
ATTRIBUTE_ENUM(AllocAlign,allocalign)
12
ATTRIBUTE_ENUM(AllocatedPointer,allocptr)
13
ATTRIBUTE_ENUM(AlwaysInline,alwaysinline)
14
ATTRIBUTE_ENUM(Builtin,builtin)
15
ATTRIBUTE_ENUM(Cold,cold)
16
ATTRIBUTE_ENUM(Convergent,convergent)
17
ATTRIBUTE_ENUM(DisableSanitizerInstrumentation,disable_sanitizer_instrumentation)
18
ATTRIBUTE_ENUM(FnRetThunkExtern,fn_ret_thunk_extern)
19
ATTRIBUTE_ENUM(Hot,hot)
20
ATTRIBUTE_ENUM(ImmArg,immarg)
21
ATTRIBUTE_ENUM(InReg,inreg)
22
ATTRIBUTE_ENUM(InlineHint,inlinehint)
23
ATTRIBUTE_ENUM(JumpTable,jumptable)
24
ATTRIBUTE_ENUM(MinSize,minsize)
25
ATTRIBUTE_ENUM(MustProgress,mustprogress)
26
ATTRIBUTE_ENUM(Naked,naked)
27
ATTRIBUTE_ENUM(Nest,nest)
28
ATTRIBUTE_ENUM(NoAlias,noalias)
29
ATTRIBUTE_ENUM(NoBuiltin,nobuiltin)
30
ATTRIBUTE_ENUM(NoCallback,nocallback)
31
ATTRIBUTE_ENUM(NoCapture,nocapture)
32
ATTRIBUTE_ENUM(NoCfCheck,nocf_check)
33
ATTRIBUTE_ENUM(NoDuplicate,noduplicate)
34
ATTRIBUTE_ENUM(NoFree,nofree)
35
ATTRIBUTE_ENUM(NoImplicitFloat,noimplicitfloat)
36
ATTRIBUTE_ENUM(NoInline,noinline)
37
ATTRIBUTE_ENUM(NoMerge,nomerge)
38
ATTRIBUTE_ENUM(NoProfile,noprofile)
39
ATTRIBUTE_ENUM(NoRecurse,norecurse)
40
ATTRIBUTE_ENUM(NoRedZone,noredzone)
41
ATTRIBUTE_ENUM(NoReturn,noreturn)
42
ATTRIBUTE_ENUM(NoSanitizeBounds,nosanitize_bounds)
43
ATTRIBUTE_ENUM(NoSanitizeCoverage,nosanitize_coverage)
44
ATTRIBUTE_ENUM(NoSync,nosync)
45
ATTRIBUTE_ENUM(NoUndef,noundef)
46
ATTRIBUTE_ENUM(NoUnwind,nounwind)
47
ATTRIBUTE_ENUM(NonLazyBind,nonlazybind)
48
ATTRIBUTE_ENUM(NonNull,nonnull)
49
ATTRIBUTE_ENUM(NullPointerIsValid,null_pointer_is_valid)
50
ATTRIBUTE_ENUM(OptForFuzzing,optforfuzzing)
51
ATTRIBUTE_ENUM(OptimizeForSize,optsize)
52
ATTRIBUTE_ENUM(OptimizeNone,optnone)
53
ATTRIBUTE_ENUM(PresplitCoroutine,presplitcoroutine)
54
ATTRIBUTE_ENUM(ReadNone,readnone)
55
ATTRIBUTE_ENUM(ReadOnly,readonly)
56
ATTRIBUTE_ENUM(Returned,returned)
57
ATTRIBUTE_ENUM(ReturnsTwice,returns_twice)
58
ATTRIBUTE_ENUM(SExt,signext)
59
ATTRIBUTE_ENUM(SafeStack,safestack)
60
ATTRIBUTE_ENUM(SanitizeAddress,sanitize_address)
61
ATTRIBUTE_ENUM(SanitizeHWAddress,sanitize_hwaddress)
62
ATTRIBUTE_ENUM(SanitizeMemTag,sanitize_memtag)
63
ATTRIBUTE_ENUM(SanitizeMemory,sanitize_memory)
64
ATTRIBUTE_ENUM(SanitizeThread,sanitize_thread)
65
ATTRIBUTE_ENUM(ShadowCallStack,shadowcallstack)
66
ATTRIBUTE_ENUM(SkipProfile,skipprofile)
67
ATTRIBUTE_ENUM(Speculatable,speculatable)
68
ATTRIBUTE_ENUM(SpeculativeLoadHardening,speculative_load_hardening)
69
ATTRIBUTE_ENUM(StackProtect,ssp)
70
ATTRIBUTE_ENUM(StackProtectReq,sspreq)
71
ATTRIBUTE_ENUM(StackProtectStrong,sspstrong)
72
ATTRIBUTE_ENUM(StrictFP,strictfp)
73
ATTRIBUTE_ENUM(SwiftAsync,swiftasync)
74
ATTRIBUTE_ENUM(SwiftError,swifterror)
75
ATTRIBUTE_ENUM(SwiftSelf,swiftself)
76
ATTRIBUTE_ENUM(WillReturn,willreturn)
77
ATTRIBUTE_ENUM(WriteOnly,writeonly)
78
ATTRIBUTE_ENUM(ZExt,zeroext)
79
ATTRIBUTE_ENUM(ByRef,byref)
80
ATTRIBUTE_ENUM(ByVal,byval)
81
ATTRIBUTE_ENUM(ElementType,elementtype)
82
ATTRIBUTE_ENUM(InAlloca,inalloca)
83
ATTRIBUTE_ENUM(Preallocated,preallocated)
84
ATTRIBUTE_ENUM(StructRet,sret)
85
ATTRIBUTE_ENUM(Alignment,align)
86
ATTRIBUTE_ENUM(AllocKind,allockind)
87
ATTRIBUTE_ENUM(AllocSize,allocsize)
88
ATTRIBUTE_ENUM(Dereferenceable,dereferenceable)
89
ATTRIBUTE_ENUM(DereferenceableOrNull,dereferenceable_or_null)
90
ATTRIBUTE_ENUM(Memory,memory)
91
ATTRIBUTE_ENUM(StackAlignment,alignstack)
92
ATTRIBUTE_ENUM(UWTable,uwtable)
93
ATTRIBUTE_ENUM(VScaleRange,vscale_range)
94
#undef ATTRIBUTE_ENUM
95
 
96
#ifndef ATTRIBUTE_STRBOOL
97
#define ATTRIBUTE_STRBOOL(FIRST, SECOND) ATTRIBUTE_ALL(FIRST, SECOND)
98
#endif
99
 
100
ATTRIBUTE_STRBOOL(ApproxFuncFPMath,approx-func-fp-math)
101
ATTRIBUTE_STRBOOL(LessPreciseFPMAD,less-precise-fpmad)
102
ATTRIBUTE_STRBOOL(NoInfsFPMath,no-infs-fp-math)
103
ATTRIBUTE_STRBOOL(NoInlineLineTables,no-inline-line-tables)
104
ATTRIBUTE_STRBOOL(NoJumpTables,no-jump-tables)
105
ATTRIBUTE_STRBOOL(NoNansFPMath,no-nans-fp-math)
106
ATTRIBUTE_STRBOOL(NoSignedZerosFPMath,no-signed-zeros-fp-math)
107
ATTRIBUTE_STRBOOL(ProfileSampleAccurate,profile-sample-accurate)
108
ATTRIBUTE_STRBOOL(UnsafeFPMath,unsafe-fp-math)
109
ATTRIBUTE_STRBOOL(UseSampleProfile,use-sample-profile)
110
#undef ATTRIBUTE_STRBOOL
111
 
112
#undef ATTRIBUTE_ALL
113
#endif
114
 
115
#ifdef GET_ATTR_ENUM
116
#undef GET_ATTR_ENUM
117
FirstEnumAttr = 1,
118
AllocAlign = 1,
119
AllocatedPointer = 2,
120
AlwaysInline = 3,
121
Builtin = 4,
122
Cold = 5,
123
Convergent = 6,
124
DisableSanitizerInstrumentation = 7,
125
FnRetThunkExtern = 8,
126
Hot = 9,
127
ImmArg = 10,
128
InReg = 11,
129
InlineHint = 12,
130
JumpTable = 13,
131
MinSize = 14,
132
MustProgress = 15,
133
Naked = 16,
134
Nest = 17,
135
NoAlias = 18,
136
NoBuiltin = 19,
137
NoCallback = 20,
138
NoCapture = 21,
139
NoCfCheck = 22,
140
NoDuplicate = 23,
141
NoFree = 24,
142
NoImplicitFloat = 25,
143
NoInline = 26,
144
NoMerge = 27,
145
NoProfile = 28,
146
NoRecurse = 29,
147
NoRedZone = 30,
148
NoReturn = 31,
149
NoSanitizeBounds = 32,
150
NoSanitizeCoverage = 33,
151
NoSync = 34,
152
NoUndef = 35,
153
NoUnwind = 36,
154
NonLazyBind = 37,
155
NonNull = 38,
156
NullPointerIsValid = 39,
157
OptForFuzzing = 40,
158
OptimizeForSize = 41,
159
OptimizeNone = 42,
160
PresplitCoroutine = 43,
161
ReadNone = 44,
162
ReadOnly = 45,
163
Returned = 46,
164
ReturnsTwice = 47,
165
SExt = 48,
166
SafeStack = 49,
167
SanitizeAddress = 50,
168
SanitizeHWAddress = 51,
169
SanitizeMemTag = 52,
170
SanitizeMemory = 53,
171
SanitizeThread = 54,
172
ShadowCallStack = 55,
173
SkipProfile = 56,
174
Speculatable = 57,
175
SpeculativeLoadHardening = 58,
176
StackProtect = 59,
177
StackProtectReq = 60,
178
StackProtectStrong = 61,
179
StrictFP = 62,
180
SwiftAsync = 63,
181
SwiftError = 64,
182
SwiftSelf = 65,
183
WillReturn = 66,
184
WriteOnly = 67,
185
ZExt = 68,
186
LastEnumAttr = 68,
187
FirstTypeAttr = 69,
188
ByRef = 69,
189
ByVal = 70,
190
ElementType = 71,
191
InAlloca = 72,
192
Preallocated = 73,
193
StructRet = 74,
194
LastTypeAttr = 74,
195
FirstIntAttr = 75,
196
Alignment = 75,
197
AllocKind = 76,
198
AllocSize = 77,
199
Dereferenceable = 78,
200
DereferenceableOrNull = 79,
201
Memory = 80,
202
StackAlignment = 81,
203
UWTable = 82,
204
VScaleRange = 83,
205
LastIntAttr = 83,
206
#endif
207
 
208
#ifdef GET_ATTR_COMPAT_FUNC
209
#undef GET_ATTR_COMPAT_FUNC
210
static inline bool hasCompatibleFnAttrs(const Function &Caller,
211
                                        const Function &Callee) {
212
  bool Ret = true;
213
 
214
  Ret &= isEqual<SanitizeAddressAttr>(Caller, Callee);
215
  Ret &= isEqual<SanitizeThreadAttr>(Caller, Callee);
216
  Ret &= isEqual<SanitizeMemoryAttr>(Caller, Callee);
217
  Ret &= isEqual<SanitizeHWAddressAttr>(Caller, Callee);
218
  Ret &= isEqual<SanitizeMemTagAttr>(Caller, Callee);
219
  Ret &= isEqual<SafeStackAttr>(Caller, Callee);
220
  Ret &= isEqual<ShadowCallStackAttr>(Caller, Callee);
221
  Ret &= isEqual<UseSampleProfileAttr>(Caller, Callee);
222
  Ret &= isEqual<NoProfileAttr>(Caller, Callee);
223
 
224
  return Ret;
225
}
226
 
227
static inline void mergeFnAttrs(Function &Caller,
228
                                const Function &Callee) {
229
  setAND<NoInfsFPMathAttr>(Caller, Callee);
230
  setAND<NoNansFPMathAttr>(Caller, Callee);
231
  setAND<ApproxFuncFPMathAttr>(Caller, Callee);
232
  setAND<NoSignedZerosFPMathAttr>(Caller, Callee);
233
  setAND<UnsafeFPMathAttr>(Caller, Callee);
234
  setOR<NoImplicitFloatAttr>(Caller, Callee);
235
  setOR<NoJumpTablesAttr>(Caller, Callee);
236
  setOR<ProfileSampleAccurateAttr>(Caller, Callee);
237
  setOR<SpeculativeLoadHardeningAttr>(Caller, Callee);
238
  adjustCallerSSPLevel(Caller, Callee);
239
  adjustCallerStackProbes(Caller, Callee);
240
  adjustCallerStackProbeSize(Caller, Callee);
241
  adjustMinLegalVectorWidth(Caller, Callee);
242
  adjustNullPointerValidAttr(Caller, Callee);
243
  setAND<MustProgressAttr>(Caller, Callee);
244
  setAND<LessPreciseFPMADAttr>(Caller, Callee);
245
}
246
 
247
#endif
248
#ifdef GET_ATTR_PROP_TABLE
249
#undef GET_ATTR_PROP_TABLE
250
static const uint8_t AttrPropTable[] = {
251
 
252
 
253
 
254
 
255
 
256
 
257
 
258
 
259
 
260
 
261
 
262
 
263
 
264
 
265
 
266
 
267
 
268
 
269
 
270
 
271
 
272
 
273
 
274
 
275
 
276
 
277
 
278
 
279
 
280
 
281
 
282
 
283
 
284
 
285
 
286
 
287
 
288
 
289
 
290
 
291
 
292
 
293
 
294
 
295
 
296
 
297
 
298
 
299
 
300
 
301
 
302
 
303
 
304
 
305
 
306
 
307
 
308
 
309
 
310
 
311
 
312
 
313
 
314
 
315
 
316
 
317
 
318
 
319
 
320
 
321
 
322
 
323
 
324
 
325
 
326
 
327
 
328
 
329
 
330
 
331
 
332
 
333
 
334
};
335
#endif