1 | /*===- TableGen'erated file -------------------------------------*- C++ -*-===*\ |
2 | |* *| |
3 | |* Attribute classes' definitions *| |
4 | |* *| |
5 | |* Automatically generated file, do not edit! *| |
6 | |* From: Attr.td *| |
7 | |* *| |
8 | \*===----------------------------------------------------------------------===*/ |
9 | |
10 | #ifndef LLVM_CLANG_ATTR_CLASSES_INC |
11 | #define LLVM_CLANG_ATTR_CLASSES_INC |
12 | |
13 | static inline void DelimitAttributeArgument(raw_ostream& OS, bool& IsFirst) { |
14 | if (IsFirst) { |
15 | IsFirst = false; |
16 | OS << "(" ; |
17 | } else |
18 | OS << ", " ; |
19 | } |
20 | class AArch64SVEPcsAttr : public InheritableAttr { |
21 | public: |
22 | enum Spelling { |
23 | GNU_aarch64_sve_pcs = 0, |
24 | CXX11_clang_aarch64_sve_pcs = 1, |
25 | C23_clang_aarch64_sve_pcs = 2, |
26 | SpellingNotCalculated = 15 |
27 | |
28 | }; |
29 | |
30 | // Factory methods |
31 | static AArch64SVEPcsAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
32 | static AArch64SVEPcsAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
33 | static AArch64SVEPcsAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_aarch64_sve_pcs); |
34 | static AArch64SVEPcsAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_aarch64_sve_pcs); |
35 | |
36 | // Constructors |
37 | AArch64SVEPcsAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
38 | ); |
39 | |
40 | AArch64SVEPcsAttr *clone(ASTContext &C) const; |
41 | void printPretty(raw_ostream &OS, |
42 | const PrintingPolicy &Policy) const; |
43 | const char *getSpelling() const; |
44 | |
45 | |
46 | static bool classof(const Attr *A) { return A->getKind() == attr::AArch64SVEPcs; } |
47 | }; |
48 | |
49 | class AArch64VectorPcsAttr : public InheritableAttr { |
50 | public: |
51 | enum Spelling { |
52 | GNU_aarch64_vector_pcs = 0, |
53 | CXX11_clang_aarch64_vector_pcs = 1, |
54 | C23_clang_aarch64_vector_pcs = 2, |
55 | SpellingNotCalculated = 15 |
56 | |
57 | }; |
58 | |
59 | // Factory methods |
60 | static AArch64VectorPcsAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
61 | static AArch64VectorPcsAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
62 | static AArch64VectorPcsAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_aarch64_vector_pcs); |
63 | static AArch64VectorPcsAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_aarch64_vector_pcs); |
64 | |
65 | // Constructors |
66 | AArch64VectorPcsAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
67 | ); |
68 | |
69 | AArch64VectorPcsAttr *clone(ASTContext &C) const; |
70 | void printPretty(raw_ostream &OS, |
71 | const PrintingPolicy &Policy) const; |
72 | const char *getSpelling() const; |
73 | |
74 | |
75 | static bool classof(const Attr *A) { return A->getKind() == attr::AArch64VectorPcs; } |
76 | }; |
77 | |
78 | class AMDGPUFlatWorkGroupSizeAttr : public InheritableAttr { |
79 | Expr * min; |
80 | |
81 | Expr * max; |
82 | |
83 | public: |
84 | enum Spelling { |
85 | GNU_amdgpu_flat_work_group_size = 0, |
86 | CXX11_clang_amdgpu_flat_work_group_size = 1, |
87 | SpellingNotCalculated = 15 |
88 | |
89 | }; |
90 | |
91 | // Factory methods |
92 | static AMDGPUFlatWorkGroupSizeAttr *CreateImplicit(ASTContext &Ctx, Expr * Min, Expr * Max, const AttributeCommonInfo &CommonInfo); |
93 | static AMDGPUFlatWorkGroupSizeAttr *Create(ASTContext &Ctx, Expr * Min, Expr * Max, const AttributeCommonInfo &CommonInfo); |
94 | static AMDGPUFlatWorkGroupSizeAttr *CreateImplicit(ASTContext &Ctx, Expr * Min, Expr * Max, SourceRange Range = {}, Spelling S = GNU_amdgpu_flat_work_group_size); |
95 | static AMDGPUFlatWorkGroupSizeAttr *Create(ASTContext &Ctx, Expr * Min, Expr * Max, SourceRange Range = {}, Spelling S = GNU_amdgpu_flat_work_group_size); |
96 | |
97 | // Constructors |
98 | AMDGPUFlatWorkGroupSizeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
99 | , Expr * Min |
100 | , Expr * Max |
101 | ); |
102 | |
103 | AMDGPUFlatWorkGroupSizeAttr *clone(ASTContext &C) const; |
104 | void printPretty(raw_ostream &OS, |
105 | const PrintingPolicy &Policy) const; |
106 | const char *getSpelling() const; |
107 | Expr * getMin() const { |
108 | return min; |
109 | } |
110 | |
111 | Expr * getMax() const { |
112 | return max; |
113 | } |
114 | |
115 | |
116 | |
117 | static bool classof(const Attr *A) { return A->getKind() == attr::AMDGPUFlatWorkGroupSize; } |
118 | }; |
119 | |
120 | class AMDGPUKernelCallAttr : public InheritableAttr { |
121 | public: |
122 | enum Spelling { |
123 | GNU_amdgpu_kernel = 0, |
124 | CXX11_clang_amdgpu_kernel = 1, |
125 | C23_clang_amdgpu_kernel = 2, |
126 | SpellingNotCalculated = 15 |
127 | |
128 | }; |
129 | |
130 | // Factory methods |
131 | static AMDGPUKernelCallAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
132 | static AMDGPUKernelCallAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
133 | static AMDGPUKernelCallAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_amdgpu_kernel); |
134 | static AMDGPUKernelCallAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_amdgpu_kernel); |
135 | |
136 | // Constructors |
137 | AMDGPUKernelCallAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
138 | ); |
139 | |
140 | AMDGPUKernelCallAttr *clone(ASTContext &C) const; |
141 | void printPretty(raw_ostream &OS, |
142 | const PrintingPolicy &Policy) const; |
143 | const char *getSpelling() const; |
144 | |
145 | |
146 | static bool classof(const Attr *A) { return A->getKind() == attr::AMDGPUKernelCall; } |
147 | }; |
148 | |
149 | class AMDGPUMaxNumWorkGroupsAttr : public InheritableAttr { |
150 | Expr * maxNumWorkGroupsX; |
151 | |
152 | Expr * maxNumWorkGroupsY; |
153 | |
154 | Expr * maxNumWorkGroupsZ; |
155 | |
156 | public: |
157 | enum Spelling { |
158 | GNU_amdgpu_max_num_work_groups = 0, |
159 | CXX11_clang_amdgpu_max_num_work_groups = 1, |
160 | SpellingNotCalculated = 15 |
161 | |
162 | }; |
163 | |
164 | // Factory methods |
165 | static AMDGPUMaxNumWorkGroupsAttr *CreateImplicit(ASTContext &Ctx, Expr * MaxNumWorkGroupsX, Expr * MaxNumWorkGroupsY, Expr * MaxNumWorkGroupsZ, const AttributeCommonInfo &CommonInfo); |
166 | static AMDGPUMaxNumWorkGroupsAttr *Create(ASTContext &Ctx, Expr * MaxNumWorkGroupsX, Expr * MaxNumWorkGroupsY, Expr * MaxNumWorkGroupsZ, const AttributeCommonInfo &CommonInfo); |
167 | static AMDGPUMaxNumWorkGroupsAttr *CreateImplicit(ASTContext &Ctx, Expr * MaxNumWorkGroupsX, Expr * MaxNumWorkGroupsY, Expr * MaxNumWorkGroupsZ, SourceRange Range = {}, Spelling S = GNU_amdgpu_max_num_work_groups); |
168 | static AMDGPUMaxNumWorkGroupsAttr *Create(ASTContext &Ctx, Expr * MaxNumWorkGroupsX, Expr * MaxNumWorkGroupsY, Expr * MaxNumWorkGroupsZ, SourceRange Range = {}, Spelling S = GNU_amdgpu_max_num_work_groups); |
169 | |
170 | // Constructors |
171 | AMDGPUMaxNumWorkGroupsAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
172 | , Expr * MaxNumWorkGroupsX |
173 | , Expr * MaxNumWorkGroupsY |
174 | , Expr * MaxNumWorkGroupsZ |
175 | ); |
176 | AMDGPUMaxNumWorkGroupsAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
177 | , Expr * MaxNumWorkGroupsX |
178 | ); |
179 | |
180 | AMDGPUMaxNumWorkGroupsAttr *clone(ASTContext &C) const; |
181 | void printPretty(raw_ostream &OS, |
182 | const PrintingPolicy &Policy) const; |
183 | const char *getSpelling() const; |
184 | Expr * getMaxNumWorkGroupsX() const { |
185 | return maxNumWorkGroupsX; |
186 | } |
187 | |
188 | Expr * getMaxNumWorkGroupsY() const { |
189 | return maxNumWorkGroupsY; |
190 | } |
191 | |
192 | Expr * getMaxNumWorkGroupsZ() const { |
193 | return maxNumWorkGroupsZ; |
194 | } |
195 | |
196 | |
197 | |
198 | static bool classof(const Attr *A) { return A->getKind() == attr::AMDGPUMaxNumWorkGroups; } |
199 | }; |
200 | |
201 | class AMDGPUNumSGPRAttr : public InheritableAttr { |
202 | unsigned numSGPR; |
203 | |
204 | public: |
205 | enum Spelling { |
206 | GNU_amdgpu_num_sgpr = 0, |
207 | CXX11_clang_amdgpu_num_sgpr = 1, |
208 | SpellingNotCalculated = 15 |
209 | |
210 | }; |
211 | |
212 | // Factory methods |
213 | static AMDGPUNumSGPRAttr *CreateImplicit(ASTContext &Ctx, unsigned NumSGPR, const AttributeCommonInfo &CommonInfo); |
214 | static AMDGPUNumSGPRAttr *Create(ASTContext &Ctx, unsigned NumSGPR, const AttributeCommonInfo &CommonInfo); |
215 | static AMDGPUNumSGPRAttr *CreateImplicit(ASTContext &Ctx, unsigned NumSGPR, SourceRange Range = {}, Spelling S = GNU_amdgpu_num_sgpr); |
216 | static AMDGPUNumSGPRAttr *Create(ASTContext &Ctx, unsigned NumSGPR, SourceRange Range = {}, Spelling S = GNU_amdgpu_num_sgpr); |
217 | |
218 | // Constructors |
219 | AMDGPUNumSGPRAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
220 | , unsigned NumSGPR |
221 | ); |
222 | |
223 | AMDGPUNumSGPRAttr *clone(ASTContext &C) const; |
224 | void printPretty(raw_ostream &OS, |
225 | const PrintingPolicy &Policy) const; |
226 | const char *getSpelling() const; |
227 | unsigned getNumSGPR() const { |
228 | return numSGPR; |
229 | } |
230 | |
231 | |
232 | |
233 | static bool classof(const Attr *A) { return A->getKind() == attr::AMDGPUNumSGPR; } |
234 | }; |
235 | |
236 | class AMDGPUNumVGPRAttr : public InheritableAttr { |
237 | unsigned numVGPR; |
238 | |
239 | public: |
240 | enum Spelling { |
241 | GNU_amdgpu_num_vgpr = 0, |
242 | CXX11_clang_amdgpu_num_vgpr = 1, |
243 | SpellingNotCalculated = 15 |
244 | |
245 | }; |
246 | |
247 | // Factory methods |
248 | static AMDGPUNumVGPRAttr *CreateImplicit(ASTContext &Ctx, unsigned NumVGPR, const AttributeCommonInfo &CommonInfo); |
249 | static AMDGPUNumVGPRAttr *Create(ASTContext &Ctx, unsigned NumVGPR, const AttributeCommonInfo &CommonInfo); |
250 | static AMDGPUNumVGPRAttr *CreateImplicit(ASTContext &Ctx, unsigned NumVGPR, SourceRange Range = {}, Spelling S = GNU_amdgpu_num_vgpr); |
251 | static AMDGPUNumVGPRAttr *Create(ASTContext &Ctx, unsigned NumVGPR, SourceRange Range = {}, Spelling S = GNU_amdgpu_num_vgpr); |
252 | |
253 | // Constructors |
254 | AMDGPUNumVGPRAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
255 | , unsigned NumVGPR |
256 | ); |
257 | |
258 | AMDGPUNumVGPRAttr *clone(ASTContext &C) const; |
259 | void printPretty(raw_ostream &OS, |
260 | const PrintingPolicy &Policy) const; |
261 | const char *getSpelling() const; |
262 | unsigned getNumVGPR() const { |
263 | return numVGPR; |
264 | } |
265 | |
266 | |
267 | |
268 | static bool classof(const Attr *A) { return A->getKind() == attr::AMDGPUNumVGPR; } |
269 | }; |
270 | |
271 | class AMDGPUWavesPerEUAttr : public InheritableAttr { |
272 | Expr * min; |
273 | |
274 | Expr * max; |
275 | |
276 | public: |
277 | enum Spelling { |
278 | GNU_amdgpu_waves_per_eu = 0, |
279 | CXX11_clang_amdgpu_waves_per_eu = 1, |
280 | SpellingNotCalculated = 15 |
281 | |
282 | }; |
283 | |
284 | // Factory methods |
285 | static AMDGPUWavesPerEUAttr *CreateImplicit(ASTContext &Ctx, Expr * Min, Expr * Max, const AttributeCommonInfo &CommonInfo); |
286 | static AMDGPUWavesPerEUAttr *Create(ASTContext &Ctx, Expr * Min, Expr * Max, const AttributeCommonInfo &CommonInfo); |
287 | static AMDGPUWavesPerEUAttr *CreateImplicit(ASTContext &Ctx, Expr * Min, Expr * Max, SourceRange Range = {}, Spelling S = GNU_amdgpu_waves_per_eu); |
288 | static AMDGPUWavesPerEUAttr *Create(ASTContext &Ctx, Expr * Min, Expr * Max, SourceRange Range = {}, Spelling S = GNU_amdgpu_waves_per_eu); |
289 | |
290 | // Constructors |
291 | AMDGPUWavesPerEUAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
292 | , Expr * Min |
293 | , Expr * Max |
294 | ); |
295 | AMDGPUWavesPerEUAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
296 | , Expr * Min |
297 | ); |
298 | |
299 | AMDGPUWavesPerEUAttr *clone(ASTContext &C) const; |
300 | void printPretty(raw_ostream &OS, |
301 | const PrintingPolicy &Policy) const; |
302 | const char *getSpelling() const; |
303 | Expr * getMin() const { |
304 | return min; |
305 | } |
306 | |
307 | Expr * getMax() const { |
308 | return max; |
309 | } |
310 | |
311 | |
312 | |
313 | static bool classof(const Attr *A) { return A->getKind() == attr::AMDGPUWavesPerEU; } |
314 | }; |
315 | |
316 | class ARMInterruptAttr : public InheritableAttr { |
317 | public: |
318 | enum InterruptType { |
319 | IRQ, |
320 | FIQ, |
321 | SWI, |
322 | ABORT, |
323 | UNDEF, |
324 | Generic |
325 | }; |
326 | private: |
327 | ARMInterruptAttr::InterruptType interrupt; |
328 | |
329 | public: |
330 | enum Spelling { |
331 | GNU_interrupt = 0, |
332 | CXX11_gnu_interrupt = 1, |
333 | C23_gnu_interrupt = 2, |
334 | SpellingNotCalculated = 15 |
335 | |
336 | }; |
337 | |
338 | // Factory methods |
339 | static ARMInterruptAttr *CreateImplicit(ASTContext &Ctx, ARMInterruptAttr::InterruptType Interrupt, const AttributeCommonInfo &CommonInfo); |
340 | static ARMInterruptAttr *Create(ASTContext &Ctx, ARMInterruptAttr::InterruptType Interrupt, const AttributeCommonInfo &CommonInfo); |
341 | static ARMInterruptAttr *CreateImplicit(ASTContext &Ctx, ARMInterruptAttr::InterruptType Interrupt, SourceRange Range = {}, Spelling S = GNU_interrupt); |
342 | static ARMInterruptAttr *Create(ASTContext &Ctx, ARMInterruptAttr::InterruptType Interrupt, SourceRange Range = {}, Spelling S = GNU_interrupt); |
343 | |
344 | // Constructors |
345 | ARMInterruptAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
346 | , ARMInterruptAttr::InterruptType Interrupt |
347 | ); |
348 | ARMInterruptAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
349 | ); |
350 | |
351 | ARMInterruptAttr *clone(ASTContext &C) const; |
352 | void printPretty(raw_ostream &OS, |
353 | const PrintingPolicy &Policy) const; |
354 | const char *getSpelling() const; |
355 | ARMInterruptAttr::InterruptType getInterrupt() const { |
356 | return interrupt; |
357 | } |
358 | |
359 | static bool ConvertStrToInterruptType(StringRef Val, ARMInterruptAttr::InterruptType &Out); |
360 | static const char *ConvertInterruptTypeToStr(ARMInterruptAttr::InterruptType Val); |
361 | |
362 | |
363 | static bool classof(const Attr *A) { return A->getKind() == attr::ARMInterrupt; } |
364 | }; |
365 | |
366 | class AVRInterruptAttr : public InheritableAttr { |
367 | public: |
368 | enum Spelling { |
369 | GNU_interrupt = 0, |
370 | CXX11_gnu_interrupt = 1, |
371 | C23_gnu_interrupt = 2, |
372 | SpellingNotCalculated = 15 |
373 | |
374 | }; |
375 | |
376 | // Factory methods |
377 | static AVRInterruptAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
378 | static AVRInterruptAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
379 | static AVRInterruptAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_interrupt); |
380 | static AVRInterruptAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_interrupt); |
381 | |
382 | // Constructors |
383 | AVRInterruptAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
384 | ); |
385 | |
386 | AVRInterruptAttr *clone(ASTContext &C) const; |
387 | void printPretty(raw_ostream &OS, |
388 | const PrintingPolicy &Policy) const; |
389 | const char *getSpelling() const; |
390 | |
391 | |
392 | static bool classof(const Attr *A) { return A->getKind() == attr::AVRInterrupt; } |
393 | }; |
394 | |
395 | class AVRSignalAttr : public InheritableAttr { |
396 | public: |
397 | enum Spelling { |
398 | GNU_signal = 0, |
399 | CXX11_gnu_signal = 1, |
400 | C23_gnu_signal = 2, |
401 | SpellingNotCalculated = 15 |
402 | |
403 | }; |
404 | |
405 | // Factory methods |
406 | static AVRSignalAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
407 | static AVRSignalAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
408 | static AVRSignalAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_signal); |
409 | static AVRSignalAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_signal); |
410 | |
411 | // Constructors |
412 | AVRSignalAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
413 | ); |
414 | |
415 | AVRSignalAttr *clone(ASTContext &C) const; |
416 | void printPretty(raw_ostream &OS, |
417 | const PrintingPolicy &Policy) const; |
418 | const char *getSpelling() const; |
419 | |
420 | |
421 | static bool classof(const Attr *A) { return A->getKind() == attr::AVRSignal; } |
422 | }; |
423 | |
424 | class AbiTagAttr : public Attr { |
425 | unsigned tags_Size; |
426 | StringRef *tags_; |
427 | |
428 | public: |
429 | enum Spelling { |
430 | GNU_abi_tag = 0, |
431 | CXX11_gnu_abi_tag = 1, |
432 | SpellingNotCalculated = 15 |
433 | |
434 | }; |
435 | |
436 | // Factory methods |
437 | static AbiTagAttr *CreateImplicit(ASTContext &Ctx, StringRef *Tags, unsigned TagsSize, const AttributeCommonInfo &CommonInfo); |
438 | static AbiTagAttr *Create(ASTContext &Ctx, StringRef *Tags, unsigned TagsSize, const AttributeCommonInfo &CommonInfo); |
439 | static AbiTagAttr *CreateImplicit(ASTContext &Ctx, StringRef *Tags, unsigned TagsSize, SourceRange Range = {}, Spelling S = GNU_abi_tag); |
440 | static AbiTagAttr *Create(ASTContext &Ctx, StringRef *Tags, unsigned TagsSize, SourceRange Range = {}, Spelling S = GNU_abi_tag); |
441 | |
442 | // Constructors |
443 | AbiTagAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
444 | , StringRef *Tags, unsigned TagsSize |
445 | ); |
446 | AbiTagAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
447 | ); |
448 | |
449 | AbiTagAttr *clone(ASTContext &C) const; |
450 | void printPretty(raw_ostream &OS, |
451 | const PrintingPolicy &Policy) const; |
452 | const char *getSpelling() const; |
453 | typedef StringRef* tags_iterator; |
454 | tags_iterator tags_begin() const { return tags_; } |
455 | tags_iterator tags_end() const { return tags_ + tags_Size; } |
456 | unsigned tags_size() const { return tags_Size; } |
457 | llvm::iterator_range<tags_iterator> tags() const { return llvm::make_range(x: tags_begin(), y: tags_end()); } |
458 | |
459 | |
460 | |
461 | |
462 | static bool classof(const Attr *A) { return A->getKind() == attr::AbiTag; } |
463 | }; |
464 | |
465 | class AcquireCapabilityAttr : public InheritableAttr { |
466 | unsigned args_Size; |
467 | Expr * *args_; |
468 | |
469 | public: |
470 | enum Spelling { |
471 | GNU_acquire_capability = 0, |
472 | CXX11_clang_acquire_capability = 1, |
473 | GNU_acquire_shared_capability = 2, |
474 | CXX11_clang_acquire_shared_capability = 3, |
475 | GNU_exclusive_lock_function = 4, |
476 | GNU_shared_lock_function = 5, |
477 | SpellingNotCalculated = 15 |
478 | |
479 | }; |
480 | |
481 | // Factory methods |
482 | static AcquireCapabilityAttr *CreateImplicit(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo); |
483 | static AcquireCapabilityAttr *Create(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo); |
484 | static AcquireCapabilityAttr *CreateImplicit(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, SourceRange Range = {}, Spelling S = GNU_acquire_capability); |
485 | static AcquireCapabilityAttr *Create(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, SourceRange Range = {}, Spelling S = GNU_acquire_capability); |
486 | |
487 | // Constructors |
488 | AcquireCapabilityAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
489 | , Expr * *Args, unsigned ArgsSize |
490 | ); |
491 | AcquireCapabilityAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
492 | ); |
493 | |
494 | AcquireCapabilityAttr *clone(ASTContext &C) const; |
495 | void printPretty(raw_ostream &OS, |
496 | const PrintingPolicy &Policy) const; |
497 | const char *getSpelling() const; |
498 | Spelling getSemanticSpelling() const; |
499 | bool isShared() const { return getAttributeSpellingListIndex() == 2 || |
500 | getAttributeSpellingListIndex() == 3 || |
501 | getAttributeSpellingListIndex() == 5; } |
502 | typedef Expr ** args_iterator; |
503 | args_iterator args_begin() const { return args_; } |
504 | args_iterator args_end() const { return args_ + args_Size; } |
505 | unsigned args_size() const { return args_Size; } |
506 | llvm::iterator_range<args_iterator> args() const { return llvm::make_range(x: args_begin(), y: args_end()); } |
507 | |
508 | |
509 | |
510 | |
511 | static bool classof(const Attr *A) { return A->getKind() == attr::AcquireCapability; } |
512 | }; |
513 | |
514 | class AcquireHandleAttr : public InheritableAttr { |
515 | unsigned handleTypeLength; |
516 | char *handleType; |
517 | |
518 | public: |
519 | enum Spelling { |
520 | GNU_acquire_handle = 0, |
521 | CXX11_clang_acquire_handle = 1, |
522 | C23_clang_acquire_handle = 2, |
523 | SpellingNotCalculated = 15 |
524 | |
525 | }; |
526 | |
527 | // Factory methods |
528 | static AcquireHandleAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef HandleType, const AttributeCommonInfo &CommonInfo); |
529 | static AcquireHandleAttr *Create(ASTContext &Ctx, llvm::StringRef HandleType, const AttributeCommonInfo &CommonInfo); |
530 | static AcquireHandleAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef HandleType, SourceRange Range = {}, Spelling S = GNU_acquire_handle); |
531 | static AcquireHandleAttr *Create(ASTContext &Ctx, llvm::StringRef HandleType, SourceRange Range = {}, Spelling S = GNU_acquire_handle); |
532 | |
533 | // Constructors |
534 | AcquireHandleAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
535 | , llvm::StringRef HandleType |
536 | ); |
537 | |
538 | AcquireHandleAttr *clone(ASTContext &C) const; |
539 | void printPretty(raw_ostream &OS, |
540 | const PrintingPolicy &Policy) const; |
541 | const char *getSpelling() const; |
542 | llvm::StringRef getHandleType() const { |
543 | return llvm::StringRef(handleType, handleTypeLength); |
544 | } |
545 | unsigned getHandleTypeLength() const { |
546 | return handleTypeLength; |
547 | } |
548 | void setHandleType(ASTContext &C, llvm::StringRef S) { |
549 | handleTypeLength = S.size(); |
550 | this->handleType = new (C, 1) char [handleTypeLength]; |
551 | if (!S.empty()) |
552 | std::memcpy(dest: this->handleType, src: S.data(), n: handleTypeLength); |
553 | } |
554 | |
555 | |
556 | |
557 | static bool classof(const Attr *A) { return A->getKind() == attr::AcquireHandle; } |
558 | }; |
559 | |
560 | class AcquiredAfterAttr : public InheritableAttr { |
561 | unsigned args_Size; |
562 | Expr * *args_; |
563 | |
564 | public: |
565 | // Factory methods |
566 | static AcquiredAfterAttr *CreateImplicit(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo); |
567 | static AcquiredAfterAttr *Create(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo); |
568 | static AcquiredAfterAttr *CreateImplicit(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, SourceRange Range = {}); |
569 | static AcquiredAfterAttr *Create(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, SourceRange Range = {}); |
570 | |
571 | // Constructors |
572 | AcquiredAfterAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
573 | , Expr * *Args, unsigned ArgsSize |
574 | ); |
575 | AcquiredAfterAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
576 | ); |
577 | |
578 | AcquiredAfterAttr *clone(ASTContext &C) const; |
579 | void printPretty(raw_ostream &OS, |
580 | const PrintingPolicy &Policy) const; |
581 | const char *getSpelling() const; |
582 | typedef Expr ** args_iterator; |
583 | args_iterator args_begin() const { return args_; } |
584 | args_iterator args_end() const { return args_ + args_Size; } |
585 | unsigned args_size() const { return args_Size; } |
586 | llvm::iterator_range<args_iterator> args() const { return llvm::make_range(x: args_begin(), y: args_end()); } |
587 | |
588 | |
589 | |
590 | |
591 | static bool classof(const Attr *A) { return A->getKind() == attr::AcquiredAfter; } |
592 | }; |
593 | |
594 | class AcquiredBeforeAttr : public InheritableAttr { |
595 | unsigned args_Size; |
596 | Expr * *args_; |
597 | |
598 | public: |
599 | // Factory methods |
600 | static AcquiredBeforeAttr *CreateImplicit(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo); |
601 | static AcquiredBeforeAttr *Create(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo); |
602 | static AcquiredBeforeAttr *CreateImplicit(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, SourceRange Range = {}); |
603 | static AcquiredBeforeAttr *Create(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, SourceRange Range = {}); |
604 | |
605 | // Constructors |
606 | AcquiredBeforeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
607 | , Expr * *Args, unsigned ArgsSize |
608 | ); |
609 | AcquiredBeforeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
610 | ); |
611 | |
612 | AcquiredBeforeAttr *clone(ASTContext &C) const; |
613 | void printPretty(raw_ostream &OS, |
614 | const PrintingPolicy &Policy) const; |
615 | const char *getSpelling() const; |
616 | typedef Expr ** args_iterator; |
617 | args_iterator args_begin() const { return args_; } |
618 | args_iterator args_end() const { return args_ + args_Size; } |
619 | unsigned args_size() const { return args_Size; } |
620 | llvm::iterator_range<args_iterator> args() const { return llvm::make_range(x: args_begin(), y: args_end()); } |
621 | |
622 | |
623 | |
624 | |
625 | static bool classof(const Attr *A) { return A->getKind() == attr::AcquiredBefore; } |
626 | }; |
627 | |
628 | class AddressSpaceAttr : public TypeAttr { |
629 | int addressSpace; |
630 | |
631 | public: |
632 | enum Spelling { |
633 | GNU_address_space = 0, |
634 | CXX11_clang_address_space = 1, |
635 | C23_clang_address_space = 2, |
636 | SpellingNotCalculated = 15 |
637 | |
638 | }; |
639 | |
640 | // Factory methods |
641 | static AddressSpaceAttr *CreateImplicit(ASTContext &Ctx, int AddressSpace, const AttributeCommonInfo &CommonInfo); |
642 | static AddressSpaceAttr *Create(ASTContext &Ctx, int AddressSpace, const AttributeCommonInfo &CommonInfo); |
643 | static AddressSpaceAttr *CreateImplicit(ASTContext &Ctx, int AddressSpace, SourceRange Range = {}, Spelling S = GNU_address_space); |
644 | static AddressSpaceAttr *Create(ASTContext &Ctx, int AddressSpace, SourceRange Range = {}, Spelling S = GNU_address_space); |
645 | |
646 | // Constructors |
647 | AddressSpaceAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
648 | , int AddressSpace |
649 | ); |
650 | |
651 | AddressSpaceAttr *clone(ASTContext &C) const; |
652 | void printPretty(raw_ostream &OS, |
653 | const PrintingPolicy &Policy) const; |
654 | const char *getSpelling() const; |
655 | int getAddressSpace() const { |
656 | return addressSpace; |
657 | } |
658 | |
659 | |
660 | |
661 | static bool classof(const Attr *A) { return A->getKind() == attr::AddressSpace; } |
662 | }; |
663 | |
664 | class AliasAttr : public Attr { |
665 | unsigned aliaseeLength; |
666 | char *aliasee; |
667 | |
668 | public: |
669 | enum Spelling { |
670 | GNU_alias = 0, |
671 | CXX11_gnu_alias = 1, |
672 | C23_gnu_alias = 2, |
673 | SpellingNotCalculated = 15 |
674 | |
675 | }; |
676 | |
677 | // Factory methods |
678 | static AliasAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Aliasee, const AttributeCommonInfo &CommonInfo); |
679 | static AliasAttr *Create(ASTContext &Ctx, llvm::StringRef Aliasee, const AttributeCommonInfo &CommonInfo); |
680 | static AliasAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Aliasee, SourceRange Range = {}, Spelling S = GNU_alias); |
681 | static AliasAttr *Create(ASTContext &Ctx, llvm::StringRef Aliasee, SourceRange Range = {}, Spelling S = GNU_alias); |
682 | |
683 | // Constructors |
684 | AliasAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
685 | , llvm::StringRef Aliasee |
686 | ); |
687 | |
688 | AliasAttr *clone(ASTContext &C) const; |
689 | void printPretty(raw_ostream &OS, |
690 | const PrintingPolicy &Policy) const; |
691 | const char *getSpelling() const; |
692 | llvm::StringRef getAliasee() const { |
693 | return llvm::StringRef(aliasee, aliaseeLength); |
694 | } |
695 | unsigned getAliaseeLength() const { |
696 | return aliaseeLength; |
697 | } |
698 | void setAliasee(ASTContext &C, llvm::StringRef S) { |
699 | aliaseeLength = S.size(); |
700 | this->aliasee = new (C, 1) char [aliaseeLength]; |
701 | if (!S.empty()) |
702 | std::memcpy(dest: this->aliasee, src: S.data(), n: aliaseeLength); |
703 | } |
704 | |
705 | |
706 | |
707 | static bool classof(const Attr *A) { return A->getKind() == attr::Alias; } |
708 | }; |
709 | |
710 | class AlignMac68kAttr : public InheritableAttr { |
711 | public: |
712 | // Factory methods |
713 | static AlignMac68kAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
714 | static AlignMac68kAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
715 | static AlignMac68kAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
716 | static AlignMac68kAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
717 | |
718 | // Constructors |
719 | AlignMac68kAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
720 | ); |
721 | |
722 | AlignMac68kAttr *clone(ASTContext &C) const; |
723 | void printPretty(raw_ostream &OS, |
724 | const PrintingPolicy &Policy) const; |
725 | const char *getSpelling() const; |
726 | |
727 | |
728 | static bool classof(const Attr *A) { return A->getKind() == attr::AlignMac68k; } |
729 | }; |
730 | |
731 | class AlignNaturalAttr : public InheritableAttr { |
732 | public: |
733 | // Factory methods |
734 | static AlignNaturalAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
735 | static AlignNaturalAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
736 | static AlignNaturalAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
737 | static AlignNaturalAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
738 | |
739 | // Constructors |
740 | AlignNaturalAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
741 | ); |
742 | |
743 | AlignNaturalAttr *clone(ASTContext &C) const; |
744 | void printPretty(raw_ostream &OS, |
745 | const PrintingPolicy &Policy) const; |
746 | const char *getSpelling() const; |
747 | |
748 | |
749 | static bool classof(const Attr *A) { return A->getKind() == attr::AlignNatural; } |
750 | }; |
751 | |
752 | class AlignValueAttr : public Attr { |
753 | Expr * alignment; |
754 | |
755 | public: |
756 | // Factory methods |
757 | static AlignValueAttr *CreateImplicit(ASTContext &Ctx, Expr * Alignment, const AttributeCommonInfo &CommonInfo); |
758 | static AlignValueAttr *Create(ASTContext &Ctx, Expr * Alignment, const AttributeCommonInfo &CommonInfo); |
759 | static AlignValueAttr *CreateImplicit(ASTContext &Ctx, Expr * Alignment, SourceRange Range = {}); |
760 | static AlignValueAttr *Create(ASTContext &Ctx, Expr * Alignment, SourceRange Range = {}); |
761 | |
762 | // Constructors |
763 | AlignValueAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
764 | , Expr * Alignment |
765 | ); |
766 | |
767 | AlignValueAttr *clone(ASTContext &C) const; |
768 | void printPretty(raw_ostream &OS, |
769 | const PrintingPolicy &Policy) const; |
770 | const char *getSpelling() const; |
771 | Expr * getAlignment() const { |
772 | return alignment; |
773 | } |
774 | |
775 | |
776 | |
777 | static bool classof(const Attr *A) { return A->getKind() == attr::AlignValue; } |
778 | }; |
779 | |
780 | class AlignedAttr : public InheritableAttr { |
781 | bool isalignmentExpr; |
782 | union { |
783 | Expr *alignmentExpr; |
784 | TypeSourceInfo *alignmentType; |
785 | }; |
786 | std::optional<unsigned> alignmentCache; |
787 | |
788 | |
789 | public: |
790 | enum Spelling { |
791 | GNU_aligned = 0, |
792 | CXX11_gnu_aligned = 1, |
793 | C23_gnu_aligned = 2, |
794 | Declspec_align = 3, |
795 | Keyword_alignas = 4, |
796 | Keyword_Alignas = 5, |
797 | SpellingNotCalculated = 15 |
798 | |
799 | }; |
800 | |
801 | // Factory methods |
802 | static AlignedAttr *CreateImplicit(ASTContext &Ctx, bool IsAlignmentExpr, void *Alignment, const AttributeCommonInfo &CommonInfo); |
803 | static AlignedAttr *Create(ASTContext &Ctx, bool IsAlignmentExpr, void *Alignment, const AttributeCommonInfo &CommonInfo); |
804 | static AlignedAttr *CreateImplicit(ASTContext &Ctx, bool IsAlignmentExpr, void *Alignment, SourceRange Range = {}, Spelling S = GNU_aligned); |
805 | static AlignedAttr *Create(ASTContext &Ctx, bool IsAlignmentExpr, void *Alignment, SourceRange Range = {}, Spelling S = GNU_aligned); |
806 | |
807 | // Constructors |
808 | AlignedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
809 | , bool IsAlignmentExpr, void *Alignment |
810 | ); |
811 | AlignedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
812 | ); |
813 | |
814 | AlignedAttr *clone(ASTContext &C) const; |
815 | void printPretty(raw_ostream &OS, |
816 | const PrintingPolicy &Policy) const; |
817 | const char *getSpelling() const; |
818 | Spelling getSemanticSpelling() const; |
819 | bool isGNU() const { return getAttributeSpellingListIndex() == 0 || |
820 | getAttributeSpellingListIndex() == 1 || |
821 | getAttributeSpellingListIndex() == 2; } |
822 | bool isC11() const { return getAttributeSpellingListIndex() == 5; } |
823 | bool isAlignas() const { return getAttributeSpellingListIndex() == 4 || |
824 | getAttributeSpellingListIndex() == 5; } |
825 | bool isDeclspec() const { return getAttributeSpellingListIndex() == 3; } |
826 | bool isAlignmentDependent() const; |
827 | bool isAlignmentErrorDependent() const; |
828 | unsigned getAlignment(ASTContext &Ctx) const; |
829 | bool isAlignmentExpr() const { |
830 | return isalignmentExpr; |
831 | } |
832 | Expr *getAlignmentExpr() const { |
833 | assert(isalignmentExpr); |
834 | return alignmentExpr; |
835 | } |
836 | TypeSourceInfo *getAlignmentType() const { |
837 | assert(!isalignmentExpr); |
838 | return alignmentType; |
839 | } std::optional<unsigned> getCachedAlignmentValue() const { |
840 | return alignmentCache; |
841 | } void setCachedAlignmentValue(unsigned AlignVal) { |
842 | alignmentCache = AlignVal; |
843 | } |
844 | |
845 | |
846 | |
847 | static bool classof(const Attr *A) { return A->getKind() == attr::Aligned; } |
848 | }; |
849 | |
850 | class AllocAlignAttr : public InheritableAttr { |
851 | ParamIdx paramIndex; |
852 | |
853 | public: |
854 | enum Spelling { |
855 | GNU_alloc_align = 0, |
856 | CXX11_gnu_alloc_align = 1, |
857 | C23_gnu_alloc_align = 2, |
858 | SpellingNotCalculated = 15 |
859 | |
860 | }; |
861 | |
862 | // Factory methods |
863 | static AllocAlignAttr *CreateImplicit(ASTContext &Ctx, ParamIdx ParamIndex, const AttributeCommonInfo &CommonInfo); |
864 | static AllocAlignAttr *Create(ASTContext &Ctx, ParamIdx ParamIndex, const AttributeCommonInfo &CommonInfo); |
865 | static AllocAlignAttr *CreateImplicit(ASTContext &Ctx, ParamIdx ParamIndex, SourceRange Range = {}, Spelling S = GNU_alloc_align); |
866 | static AllocAlignAttr *Create(ASTContext &Ctx, ParamIdx ParamIndex, SourceRange Range = {}, Spelling S = GNU_alloc_align); |
867 | |
868 | // Constructors |
869 | AllocAlignAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
870 | , ParamIdx ParamIndex |
871 | ); |
872 | |
873 | AllocAlignAttr *clone(ASTContext &C) const; |
874 | void printPretty(raw_ostream &OS, |
875 | const PrintingPolicy &Policy) const; |
876 | const char *getSpelling() const; |
877 | ParamIdx getParamIndex() const { |
878 | return paramIndex; |
879 | } |
880 | |
881 | |
882 | |
883 | static bool classof(const Attr *A) { return A->getKind() == attr::AllocAlign; } |
884 | }; |
885 | |
886 | class AllocSizeAttr : public InheritableAttr { |
887 | ParamIdx elemSizeParam; |
888 | |
889 | ParamIdx numElemsParam; |
890 | |
891 | public: |
892 | enum Spelling { |
893 | GNU_alloc_size = 0, |
894 | CXX11_gnu_alloc_size = 1, |
895 | C23_gnu_alloc_size = 2, |
896 | SpellingNotCalculated = 15 |
897 | |
898 | }; |
899 | |
900 | // Factory methods |
901 | static AllocSizeAttr *CreateImplicit(ASTContext &Ctx, ParamIdx ElemSizeParam, ParamIdx NumElemsParam, const AttributeCommonInfo &CommonInfo); |
902 | static AllocSizeAttr *Create(ASTContext &Ctx, ParamIdx ElemSizeParam, ParamIdx NumElemsParam, const AttributeCommonInfo &CommonInfo); |
903 | static AllocSizeAttr *CreateImplicit(ASTContext &Ctx, ParamIdx ElemSizeParam, ParamIdx NumElemsParam, SourceRange Range = {}, Spelling S = GNU_alloc_size); |
904 | static AllocSizeAttr *Create(ASTContext &Ctx, ParamIdx ElemSizeParam, ParamIdx NumElemsParam, SourceRange Range = {}, Spelling S = GNU_alloc_size); |
905 | |
906 | // Constructors |
907 | AllocSizeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
908 | , ParamIdx ElemSizeParam |
909 | , ParamIdx NumElemsParam |
910 | ); |
911 | AllocSizeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
912 | , ParamIdx ElemSizeParam |
913 | ); |
914 | |
915 | AllocSizeAttr *clone(ASTContext &C) const; |
916 | void printPretty(raw_ostream &OS, |
917 | const PrintingPolicy &Policy) const; |
918 | const char *getSpelling() const; |
919 | ParamIdx getElemSizeParam() const { |
920 | return elemSizeParam; |
921 | } |
922 | |
923 | ParamIdx getNumElemsParam() const { |
924 | return numElemsParam; |
925 | } |
926 | |
927 | |
928 | |
929 | static bool classof(const Attr *A) { return A->getKind() == attr::AllocSize; } |
930 | }; |
931 | |
932 | class AllocatingAttr : public TypeAttr { |
933 | public: |
934 | enum Spelling { |
935 | GNU_allocating = 0, |
936 | CXX11_clang_allocating = 1, |
937 | C23_clang_allocating = 2, |
938 | SpellingNotCalculated = 15 |
939 | |
940 | }; |
941 | |
942 | // Factory methods |
943 | static AllocatingAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
944 | static AllocatingAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
945 | static AllocatingAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_allocating); |
946 | static AllocatingAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_allocating); |
947 | |
948 | // Constructors |
949 | AllocatingAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
950 | ); |
951 | |
952 | AllocatingAttr *clone(ASTContext &C) const; |
953 | void printPretty(raw_ostream &OS, |
954 | const PrintingPolicy &Policy) const; |
955 | const char *getSpelling() const; |
956 | |
957 | |
958 | static bool classof(const Attr *A) { return A->getKind() == attr::Allocating; } |
959 | }; |
960 | |
961 | class AlwaysDestroyAttr : public InheritableAttr { |
962 | public: |
963 | enum Spelling { |
964 | GNU_always_destroy = 0, |
965 | CXX11_clang_always_destroy = 1, |
966 | SpellingNotCalculated = 15 |
967 | |
968 | }; |
969 | |
970 | // Factory methods |
971 | static AlwaysDestroyAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
972 | static AlwaysDestroyAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
973 | static AlwaysDestroyAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_always_destroy); |
974 | static AlwaysDestroyAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_always_destroy); |
975 | |
976 | // Constructors |
977 | AlwaysDestroyAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
978 | ); |
979 | |
980 | AlwaysDestroyAttr *clone(ASTContext &C) const; |
981 | void printPretty(raw_ostream &OS, |
982 | const PrintingPolicy &Policy) const; |
983 | const char *getSpelling() const; |
984 | |
985 | |
986 | static bool classof(const Attr *A) { return A->getKind() == attr::AlwaysDestroy; } |
987 | }; |
988 | |
989 | class AlwaysInlineAttr : public DeclOrStmtAttr { |
990 | public: |
991 | enum Spelling { |
992 | GNU_always_inline = 0, |
993 | CXX11_gnu_always_inline = 1, |
994 | C23_gnu_always_inline = 2, |
995 | CXX11_clang_always_inline = 3, |
996 | C23_clang_always_inline = 4, |
997 | Keyword_forceinline = 5, |
998 | SpellingNotCalculated = 15 |
999 | |
1000 | }; |
1001 | |
1002 | // Factory methods |
1003 | static AlwaysInlineAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
1004 | static AlwaysInlineAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
1005 | static AlwaysInlineAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_always_inline); |
1006 | static AlwaysInlineAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_always_inline); |
1007 | |
1008 | // Constructors |
1009 | AlwaysInlineAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1010 | ); |
1011 | |
1012 | AlwaysInlineAttr *clone(ASTContext &C) const; |
1013 | void printPretty(raw_ostream &OS, |
1014 | const PrintingPolicy &Policy) const; |
1015 | const char *getSpelling() const; |
1016 | Spelling getSemanticSpelling() const; |
1017 | bool isClangAlwaysInline() const { return getAttributeSpellingListIndex() == 3 || |
1018 | getAttributeSpellingListIndex() == 4; } |
1019 | |
1020 | |
1021 | static bool classof(const Attr *A) { return A->getKind() == attr::AlwaysInline; } |
1022 | }; |
1023 | |
1024 | class AnalyzerNoReturnAttr : public InheritableAttr { |
1025 | public: |
1026 | // Factory methods |
1027 | static AnalyzerNoReturnAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
1028 | static AnalyzerNoReturnAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
1029 | static AnalyzerNoReturnAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
1030 | static AnalyzerNoReturnAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
1031 | |
1032 | // Constructors |
1033 | AnalyzerNoReturnAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1034 | ); |
1035 | |
1036 | AnalyzerNoReturnAttr *clone(ASTContext &C) const; |
1037 | void printPretty(raw_ostream &OS, |
1038 | const PrintingPolicy &Policy) const; |
1039 | const char *getSpelling() const; |
1040 | |
1041 | |
1042 | static bool classof(const Attr *A) { return A->getKind() == attr::AnalyzerNoReturn; } |
1043 | }; |
1044 | |
1045 | class AnnotateAttr : public InheritableParamAttr { |
1046 | unsigned annotationLength; |
1047 | char *annotation; |
1048 | |
1049 | unsigned args_Size; |
1050 | Expr * *args_; |
1051 | |
1052 | unsigned delayedArgs_Size; |
1053 | Expr * *delayedArgs_; |
1054 | |
1055 | public: |
1056 | enum Spelling { |
1057 | GNU_annotate = 0, |
1058 | CXX11_clang_annotate = 1, |
1059 | C23_clang_annotate = 2, |
1060 | SpellingNotCalculated = 15 |
1061 | |
1062 | }; |
1063 | |
1064 | // Factory methods |
1065 | static AnnotateAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Annotation, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo); |
1066 | static AnnotateAttr *Create(ASTContext &Ctx, llvm::StringRef Annotation, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo); |
1067 | static AnnotateAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Annotation, Expr * *Args, unsigned ArgsSize, SourceRange Range = {}, Spelling S = GNU_annotate); |
1068 | static AnnotateAttr *Create(ASTContext &Ctx, llvm::StringRef Annotation, Expr * *Args, unsigned ArgsSize, SourceRange Range = {}, Spelling S = GNU_annotate); |
1069 | static AnnotateAttr *CreateImplicitWithDelayedArgs(ASTContext &Ctx, Expr * *DelayedArgs, unsigned DelayedArgsSize, const AttributeCommonInfo &CommonInfo); |
1070 | static AnnotateAttr *CreateWithDelayedArgs(ASTContext &Ctx, Expr * *DelayedArgs, unsigned DelayedArgsSize, const AttributeCommonInfo &CommonInfo); |
1071 | static AnnotateAttr *CreateImplicitWithDelayedArgs(ASTContext &Ctx, Expr * *DelayedArgs, unsigned DelayedArgsSize, SourceRange Range = {}, Spelling S = GNU_annotate); |
1072 | static AnnotateAttr *CreateWithDelayedArgs(ASTContext &Ctx, Expr * *DelayedArgs, unsigned DelayedArgsSize, SourceRange Range = {}, Spelling S = GNU_annotate); |
1073 | |
1074 | // Constructors |
1075 | AnnotateAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1076 | , llvm::StringRef Annotation |
1077 | , Expr * *Args, unsigned ArgsSize |
1078 | ); |
1079 | AnnotateAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1080 | , llvm::StringRef Annotation |
1081 | ); |
1082 | AnnotateAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1083 | ); |
1084 | |
1085 | AnnotateAttr *clone(ASTContext &C) const; |
1086 | void printPretty(raw_ostream &OS, |
1087 | const PrintingPolicy &Policy) const; |
1088 | const char *getSpelling() const; |
1089 | llvm::StringRef getAnnotation() const { |
1090 | return llvm::StringRef(annotation, annotationLength); |
1091 | } |
1092 | unsigned getAnnotationLength() const { |
1093 | return annotationLength; |
1094 | } |
1095 | void setAnnotation(ASTContext &C, llvm::StringRef S) { |
1096 | annotationLength = S.size(); |
1097 | this->annotation = new (C, 1) char [annotationLength]; |
1098 | if (!S.empty()) |
1099 | std::memcpy(dest: this->annotation, src: S.data(), n: annotationLength); |
1100 | } |
1101 | |
1102 | typedef Expr ** args_iterator; |
1103 | args_iterator args_begin() const { return args_; } |
1104 | args_iterator args_end() const { return args_ + args_Size; } |
1105 | unsigned args_size() const { return args_Size; } |
1106 | llvm::iterator_range<args_iterator> args() const { return llvm::make_range(x: args_begin(), y: args_end()); } |
1107 | |
1108 | |
1109 | typedef Expr ** delayedArgs_iterator; |
1110 | delayedArgs_iterator delayedArgs_begin() const { return delayedArgs_; } |
1111 | delayedArgs_iterator delayedArgs_end() const { return delayedArgs_ + delayedArgs_Size; } |
1112 | unsigned delayedArgs_size() const { return delayedArgs_Size; } |
1113 | llvm::iterator_range<delayedArgs_iterator> delayedArgs() const { return llvm::make_range(x: delayedArgs_begin(), y: delayedArgs_end()); } |
1114 | void setDelayedArgs(ASTContext &Ctx, Expr * *DelayedArgs, unsigned DelayedArgsSize) { |
1115 | delayedArgs_Size = DelayedArgsSize; |
1116 | delayedArgs_ = new (Ctx, 16) Expr *[delayedArgs_Size]; |
1117 | std::copy(DelayedArgs, DelayedArgs + delayedArgs_Size, delayedArgs_); |
1118 | } |
1119 | |
1120 | static AnnotateAttr *Create(ASTContext &Ctx, llvm::StringRef Annotation, \ |
1121 | const AttributeCommonInfo &CommonInfo) { |
1122 | return AnnotateAttr::Create(Ctx, Annotation, Args: nullptr, ArgsSize: 0, CommonInfo); |
1123 | } |
1124 | static AnnotateAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Annotation, \ |
1125 | const AttributeCommonInfo &CommonInfo) { |
1126 | return AnnotateAttr::CreateImplicit(Ctx, Annotation, Args: nullptr, ArgsSize: 0, CommonInfo); |
1127 | } |
1128 | |
1129 | |
1130 | static bool classof(const Attr *A) { return A->getKind() == attr::Annotate; } |
1131 | }; |
1132 | |
1133 | class AnnotateTypeAttr : public TypeAttr { |
1134 | unsigned annotationLength; |
1135 | char *annotation; |
1136 | |
1137 | unsigned args_Size; |
1138 | Expr * *args_; |
1139 | |
1140 | unsigned delayedArgs_Size; |
1141 | Expr * *delayedArgs_; |
1142 | |
1143 | public: |
1144 | enum Spelling { |
1145 | CXX11_clang_annotate_type = 0, |
1146 | C23_clang_annotate_type = 1, |
1147 | SpellingNotCalculated = 15 |
1148 | |
1149 | }; |
1150 | |
1151 | // Factory methods |
1152 | static AnnotateTypeAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Annotation, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo); |
1153 | static AnnotateTypeAttr *Create(ASTContext &Ctx, llvm::StringRef Annotation, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo); |
1154 | static AnnotateTypeAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Annotation, Expr * *Args, unsigned ArgsSize, SourceRange Range = {}, Spelling S = CXX11_clang_annotate_type); |
1155 | static AnnotateTypeAttr *Create(ASTContext &Ctx, llvm::StringRef Annotation, Expr * *Args, unsigned ArgsSize, SourceRange Range = {}, Spelling S = CXX11_clang_annotate_type); |
1156 | static AnnotateTypeAttr *CreateImplicitWithDelayedArgs(ASTContext &Ctx, Expr * *DelayedArgs, unsigned DelayedArgsSize, const AttributeCommonInfo &CommonInfo); |
1157 | static AnnotateTypeAttr *CreateWithDelayedArgs(ASTContext &Ctx, Expr * *DelayedArgs, unsigned DelayedArgsSize, const AttributeCommonInfo &CommonInfo); |
1158 | static AnnotateTypeAttr *CreateImplicitWithDelayedArgs(ASTContext &Ctx, Expr * *DelayedArgs, unsigned DelayedArgsSize, SourceRange Range = {}, Spelling S = CXX11_clang_annotate_type); |
1159 | static AnnotateTypeAttr *CreateWithDelayedArgs(ASTContext &Ctx, Expr * *DelayedArgs, unsigned DelayedArgsSize, SourceRange Range = {}, Spelling S = CXX11_clang_annotate_type); |
1160 | |
1161 | // Constructors |
1162 | AnnotateTypeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1163 | , llvm::StringRef Annotation |
1164 | , Expr * *Args, unsigned ArgsSize |
1165 | ); |
1166 | AnnotateTypeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1167 | , llvm::StringRef Annotation |
1168 | ); |
1169 | AnnotateTypeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1170 | ); |
1171 | |
1172 | AnnotateTypeAttr *clone(ASTContext &C) const; |
1173 | void printPretty(raw_ostream &OS, |
1174 | const PrintingPolicy &Policy) const; |
1175 | const char *getSpelling() const; |
1176 | llvm::StringRef getAnnotation() const { |
1177 | return llvm::StringRef(annotation, annotationLength); |
1178 | } |
1179 | unsigned getAnnotationLength() const { |
1180 | return annotationLength; |
1181 | } |
1182 | void setAnnotation(ASTContext &C, llvm::StringRef S) { |
1183 | annotationLength = S.size(); |
1184 | this->annotation = new (C, 1) char [annotationLength]; |
1185 | if (!S.empty()) |
1186 | std::memcpy(dest: this->annotation, src: S.data(), n: annotationLength); |
1187 | } |
1188 | |
1189 | typedef Expr ** args_iterator; |
1190 | args_iterator args_begin() const { return args_; } |
1191 | args_iterator args_end() const { return args_ + args_Size; } |
1192 | unsigned args_size() const { return args_Size; } |
1193 | llvm::iterator_range<args_iterator> args() const { return llvm::make_range(x: args_begin(), y: args_end()); } |
1194 | |
1195 | |
1196 | typedef Expr ** delayedArgs_iterator; |
1197 | delayedArgs_iterator delayedArgs_begin() const { return delayedArgs_; } |
1198 | delayedArgs_iterator delayedArgs_end() const { return delayedArgs_ + delayedArgs_Size; } |
1199 | unsigned delayedArgs_size() const { return delayedArgs_Size; } |
1200 | llvm::iterator_range<delayedArgs_iterator> delayedArgs() const { return llvm::make_range(x: delayedArgs_begin(), y: delayedArgs_end()); } |
1201 | void setDelayedArgs(ASTContext &Ctx, Expr * *DelayedArgs, unsigned DelayedArgsSize) { |
1202 | delayedArgs_Size = DelayedArgsSize; |
1203 | delayedArgs_ = new (Ctx, 16) Expr *[delayedArgs_Size]; |
1204 | std::copy(DelayedArgs, DelayedArgs + delayedArgs_Size, delayedArgs_); |
1205 | } |
1206 | |
1207 | |
1208 | static bool classof(const Attr *A) { return A->getKind() == attr::AnnotateType; } |
1209 | }; |
1210 | |
1211 | class AnyX86InterruptAttr : public InheritableAttr { |
1212 | public: |
1213 | enum Spelling { |
1214 | GNU_interrupt = 0, |
1215 | CXX11_gnu_interrupt = 1, |
1216 | C23_gnu_interrupt = 2, |
1217 | SpellingNotCalculated = 15 |
1218 | |
1219 | }; |
1220 | |
1221 | // Factory methods |
1222 | static AnyX86InterruptAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
1223 | static AnyX86InterruptAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
1224 | static AnyX86InterruptAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_interrupt); |
1225 | static AnyX86InterruptAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_interrupt); |
1226 | |
1227 | // Constructors |
1228 | AnyX86InterruptAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1229 | ); |
1230 | |
1231 | AnyX86InterruptAttr *clone(ASTContext &C) const; |
1232 | void printPretty(raw_ostream &OS, |
1233 | const PrintingPolicy &Policy) const; |
1234 | const char *getSpelling() const; |
1235 | |
1236 | |
1237 | static bool classof(const Attr *A) { return A->getKind() == attr::AnyX86Interrupt; } |
1238 | }; |
1239 | |
1240 | class AnyX86NoCallerSavedRegistersAttr : public InheritableAttr { |
1241 | public: |
1242 | enum Spelling { |
1243 | GNU_no_caller_saved_registers = 0, |
1244 | CXX11_gnu_no_caller_saved_registers = 1, |
1245 | C23_gnu_no_caller_saved_registers = 2, |
1246 | SpellingNotCalculated = 15 |
1247 | |
1248 | }; |
1249 | |
1250 | // Factory methods |
1251 | static AnyX86NoCallerSavedRegistersAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
1252 | static AnyX86NoCallerSavedRegistersAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
1253 | static AnyX86NoCallerSavedRegistersAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_no_caller_saved_registers); |
1254 | static AnyX86NoCallerSavedRegistersAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_no_caller_saved_registers); |
1255 | |
1256 | // Constructors |
1257 | AnyX86NoCallerSavedRegistersAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1258 | ); |
1259 | |
1260 | AnyX86NoCallerSavedRegistersAttr *clone(ASTContext &C) const; |
1261 | void printPretty(raw_ostream &OS, |
1262 | const PrintingPolicy &Policy) const; |
1263 | const char *getSpelling() const; |
1264 | |
1265 | |
1266 | static bool classof(const Attr *A) { return A->getKind() == attr::AnyX86NoCallerSavedRegisters; } |
1267 | }; |
1268 | |
1269 | class AnyX86NoCfCheckAttr : public InheritableAttr { |
1270 | public: |
1271 | enum Spelling { |
1272 | GNU_nocf_check = 0, |
1273 | CXX11_gnu_nocf_check = 1, |
1274 | C23_gnu_nocf_check = 2, |
1275 | SpellingNotCalculated = 15 |
1276 | |
1277 | }; |
1278 | |
1279 | // Factory methods |
1280 | static AnyX86NoCfCheckAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
1281 | static AnyX86NoCfCheckAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
1282 | static AnyX86NoCfCheckAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_nocf_check); |
1283 | static AnyX86NoCfCheckAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_nocf_check); |
1284 | |
1285 | // Constructors |
1286 | AnyX86NoCfCheckAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1287 | ); |
1288 | |
1289 | AnyX86NoCfCheckAttr *clone(ASTContext &C) const; |
1290 | void printPretty(raw_ostream &OS, |
1291 | const PrintingPolicy &Policy) const; |
1292 | const char *getSpelling() const; |
1293 | |
1294 | |
1295 | static bool classof(const Attr *A) { return A->getKind() == attr::AnyX86NoCfCheck; } |
1296 | }; |
1297 | |
1298 | class ArcWeakrefUnavailableAttr : public InheritableAttr { |
1299 | public: |
1300 | enum Spelling { |
1301 | GNU_objc_arc_weak_reference_unavailable = 0, |
1302 | CXX11_clang_objc_arc_weak_reference_unavailable = 1, |
1303 | C23_clang_objc_arc_weak_reference_unavailable = 2, |
1304 | SpellingNotCalculated = 15 |
1305 | |
1306 | }; |
1307 | |
1308 | // Factory methods |
1309 | static ArcWeakrefUnavailableAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
1310 | static ArcWeakrefUnavailableAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
1311 | static ArcWeakrefUnavailableAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_objc_arc_weak_reference_unavailable); |
1312 | static ArcWeakrefUnavailableAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_objc_arc_weak_reference_unavailable); |
1313 | |
1314 | // Constructors |
1315 | ArcWeakrefUnavailableAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1316 | ); |
1317 | |
1318 | ArcWeakrefUnavailableAttr *clone(ASTContext &C) const; |
1319 | void printPretty(raw_ostream &OS, |
1320 | const PrintingPolicy &Policy) const; |
1321 | const char *getSpelling() const; |
1322 | |
1323 | |
1324 | static bool classof(const Attr *A) { return A->getKind() == attr::ArcWeakrefUnavailable; } |
1325 | }; |
1326 | |
1327 | class ArgumentWithTypeTagAttr : public InheritableAttr { |
1328 | IdentifierInfo * argumentKind; |
1329 | |
1330 | ParamIdx argumentIdx; |
1331 | |
1332 | ParamIdx typeTagIdx; |
1333 | |
1334 | bool isPointer; |
1335 | |
1336 | public: |
1337 | enum Spelling { |
1338 | GNU_argument_with_type_tag = 0, |
1339 | CXX11_clang_argument_with_type_tag = 1, |
1340 | C23_clang_argument_with_type_tag = 2, |
1341 | GNU_pointer_with_type_tag = 3, |
1342 | CXX11_clang_pointer_with_type_tag = 4, |
1343 | C23_clang_pointer_with_type_tag = 5, |
1344 | SpellingNotCalculated = 15 |
1345 | |
1346 | }; |
1347 | |
1348 | // Factory methods |
1349 | static ArgumentWithTypeTagAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * ArgumentKind, ParamIdx ArgumentIdx, ParamIdx TypeTagIdx, bool IsPointer, const AttributeCommonInfo &CommonInfo); |
1350 | static ArgumentWithTypeTagAttr *Create(ASTContext &Ctx, IdentifierInfo * ArgumentKind, ParamIdx ArgumentIdx, ParamIdx TypeTagIdx, bool IsPointer, const AttributeCommonInfo &CommonInfo); |
1351 | static ArgumentWithTypeTagAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * ArgumentKind, ParamIdx ArgumentIdx, ParamIdx TypeTagIdx, bool IsPointer, SourceRange Range = {}, Spelling S = GNU_argument_with_type_tag); |
1352 | static ArgumentWithTypeTagAttr *Create(ASTContext &Ctx, IdentifierInfo * ArgumentKind, ParamIdx ArgumentIdx, ParamIdx TypeTagIdx, bool IsPointer, SourceRange Range = {}, Spelling S = GNU_argument_with_type_tag); |
1353 | static ArgumentWithTypeTagAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * ArgumentKind, ParamIdx ArgumentIdx, ParamIdx TypeTagIdx, const AttributeCommonInfo &CommonInfo); |
1354 | static ArgumentWithTypeTagAttr *Create(ASTContext &Ctx, IdentifierInfo * ArgumentKind, ParamIdx ArgumentIdx, ParamIdx TypeTagIdx, const AttributeCommonInfo &CommonInfo); |
1355 | static ArgumentWithTypeTagAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * ArgumentKind, ParamIdx ArgumentIdx, ParamIdx TypeTagIdx, SourceRange Range = {}, Spelling S = GNU_argument_with_type_tag); |
1356 | static ArgumentWithTypeTagAttr *Create(ASTContext &Ctx, IdentifierInfo * ArgumentKind, ParamIdx ArgumentIdx, ParamIdx TypeTagIdx, SourceRange Range = {}, Spelling S = GNU_argument_with_type_tag); |
1357 | |
1358 | // Constructors |
1359 | ArgumentWithTypeTagAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1360 | , IdentifierInfo * ArgumentKind |
1361 | , ParamIdx ArgumentIdx |
1362 | , ParamIdx TypeTagIdx |
1363 | , bool IsPointer |
1364 | ); |
1365 | ArgumentWithTypeTagAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1366 | , IdentifierInfo * ArgumentKind |
1367 | , ParamIdx ArgumentIdx |
1368 | , ParamIdx TypeTagIdx |
1369 | ); |
1370 | |
1371 | ArgumentWithTypeTagAttr *clone(ASTContext &C) const; |
1372 | void printPretty(raw_ostream &OS, |
1373 | const PrintingPolicy &Policy) const; |
1374 | const char *getSpelling() const; |
1375 | Spelling getSemanticSpelling() const; |
1376 | IdentifierInfo * getArgumentKind() const { |
1377 | return argumentKind; |
1378 | } |
1379 | |
1380 | ParamIdx getArgumentIdx() const { |
1381 | return argumentIdx; |
1382 | } |
1383 | |
1384 | ParamIdx getTypeTagIdx() const { |
1385 | return typeTagIdx; |
1386 | } |
1387 | |
1388 | bool getIsPointer() const { |
1389 | return isPointer; |
1390 | } |
1391 | |
1392 | |
1393 | |
1394 | static bool classof(const Attr *A) { return A->getKind() == attr::ArgumentWithTypeTag; } |
1395 | }; |
1396 | |
1397 | class ArmBuiltinAliasAttr : public InheritableAttr { |
1398 | IdentifierInfo * builtinName; |
1399 | |
1400 | public: |
1401 | enum Spelling { |
1402 | GNU_clang_arm_builtin_alias = 0, |
1403 | CXX11_clang_clang_arm_builtin_alias = 1, |
1404 | C23_clang_clang_arm_builtin_alias = 2, |
1405 | SpellingNotCalculated = 15 |
1406 | |
1407 | }; |
1408 | |
1409 | // Factory methods |
1410 | static ArmBuiltinAliasAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * BuiltinName, const AttributeCommonInfo &CommonInfo); |
1411 | static ArmBuiltinAliasAttr *Create(ASTContext &Ctx, IdentifierInfo * BuiltinName, const AttributeCommonInfo &CommonInfo); |
1412 | static ArmBuiltinAliasAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * BuiltinName, SourceRange Range = {}, Spelling S = GNU_clang_arm_builtin_alias); |
1413 | static ArmBuiltinAliasAttr *Create(ASTContext &Ctx, IdentifierInfo * BuiltinName, SourceRange Range = {}, Spelling S = GNU_clang_arm_builtin_alias); |
1414 | |
1415 | // Constructors |
1416 | ArmBuiltinAliasAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1417 | , IdentifierInfo * BuiltinName |
1418 | ); |
1419 | |
1420 | ArmBuiltinAliasAttr *clone(ASTContext &C) const; |
1421 | void printPretty(raw_ostream &OS, |
1422 | const PrintingPolicy &Policy) const; |
1423 | const char *getSpelling() const; |
1424 | IdentifierInfo * getBuiltinName() const { |
1425 | return builtinName; |
1426 | } |
1427 | |
1428 | |
1429 | |
1430 | static bool classof(const Attr *A) { return A->getKind() == attr::ArmBuiltinAlias; } |
1431 | }; |
1432 | |
1433 | class ArmInAttr : public TypeAttr { |
1434 | unsigned inArgs_Size; |
1435 | StringRef *inArgs_; |
1436 | |
1437 | public: |
1438 | // Factory methods |
1439 | static ArmInAttr *CreateImplicit(ASTContext &Ctx, StringRef *InArgs, unsigned InArgsSize, const AttributeCommonInfo &CommonInfo); |
1440 | static ArmInAttr *Create(ASTContext &Ctx, StringRef *InArgs, unsigned InArgsSize, const AttributeCommonInfo &CommonInfo); |
1441 | static ArmInAttr *CreateImplicit(ASTContext &Ctx, StringRef *InArgs, unsigned InArgsSize, SourceRange Range = {}); |
1442 | static ArmInAttr *Create(ASTContext &Ctx, StringRef *InArgs, unsigned InArgsSize, SourceRange Range = {}); |
1443 | |
1444 | // Constructors |
1445 | ArmInAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1446 | , StringRef *InArgs, unsigned InArgsSize |
1447 | ); |
1448 | ArmInAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1449 | ); |
1450 | |
1451 | ArmInAttr *clone(ASTContext &C) const; |
1452 | void printPretty(raw_ostream &OS, |
1453 | const PrintingPolicy &Policy) const; |
1454 | const char *getSpelling() const; |
1455 | typedef StringRef* inArgs_iterator; |
1456 | inArgs_iterator inArgs_begin() const { return inArgs_; } |
1457 | inArgs_iterator inArgs_end() const { return inArgs_ + inArgs_Size; } |
1458 | unsigned inArgs_size() const { return inArgs_Size; } |
1459 | llvm::iterator_range<inArgs_iterator> inArgs() const { return llvm::make_range(x: inArgs_begin(), y: inArgs_end()); } |
1460 | |
1461 | |
1462 | |
1463 | |
1464 | static bool classof(const Attr *A) { return A->getKind() == attr::ArmIn; } |
1465 | }; |
1466 | |
1467 | class ArmInOutAttr : public TypeAttr { |
1468 | unsigned inOutArgs_Size; |
1469 | StringRef *inOutArgs_; |
1470 | |
1471 | public: |
1472 | // Factory methods |
1473 | static ArmInOutAttr *CreateImplicit(ASTContext &Ctx, StringRef *InOutArgs, unsigned InOutArgsSize, const AttributeCommonInfo &CommonInfo); |
1474 | static ArmInOutAttr *Create(ASTContext &Ctx, StringRef *InOutArgs, unsigned InOutArgsSize, const AttributeCommonInfo &CommonInfo); |
1475 | static ArmInOutAttr *CreateImplicit(ASTContext &Ctx, StringRef *InOutArgs, unsigned InOutArgsSize, SourceRange Range = {}); |
1476 | static ArmInOutAttr *Create(ASTContext &Ctx, StringRef *InOutArgs, unsigned InOutArgsSize, SourceRange Range = {}); |
1477 | |
1478 | // Constructors |
1479 | ArmInOutAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1480 | , StringRef *InOutArgs, unsigned InOutArgsSize |
1481 | ); |
1482 | ArmInOutAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1483 | ); |
1484 | |
1485 | ArmInOutAttr *clone(ASTContext &C) const; |
1486 | void printPretty(raw_ostream &OS, |
1487 | const PrintingPolicy &Policy) const; |
1488 | const char *getSpelling() const; |
1489 | typedef StringRef* inOutArgs_iterator; |
1490 | inOutArgs_iterator inOutArgs_begin() const { return inOutArgs_; } |
1491 | inOutArgs_iterator inOutArgs_end() const { return inOutArgs_ + inOutArgs_Size; } |
1492 | unsigned inOutArgs_size() const { return inOutArgs_Size; } |
1493 | llvm::iterator_range<inOutArgs_iterator> inOutArgs() const { return llvm::make_range(x: inOutArgs_begin(), y: inOutArgs_end()); } |
1494 | |
1495 | |
1496 | |
1497 | |
1498 | static bool classof(const Attr *A) { return A->getKind() == attr::ArmInOut; } |
1499 | }; |
1500 | |
1501 | class ArmLocallyStreamingAttr : public InheritableAttr { |
1502 | public: |
1503 | // Factory methods |
1504 | static ArmLocallyStreamingAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
1505 | static ArmLocallyStreamingAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
1506 | static ArmLocallyStreamingAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
1507 | static ArmLocallyStreamingAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
1508 | |
1509 | // Constructors |
1510 | ArmLocallyStreamingAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1511 | ); |
1512 | |
1513 | ArmLocallyStreamingAttr *clone(ASTContext &C) const; |
1514 | void printPretty(raw_ostream &OS, |
1515 | const PrintingPolicy &Policy) const; |
1516 | const char *getSpelling() const; |
1517 | |
1518 | |
1519 | static bool classof(const Attr *A) { return A->getKind() == attr::ArmLocallyStreaming; } |
1520 | }; |
1521 | |
1522 | class ArmMveStrictPolymorphismAttr : public TypeAttr { |
1523 | public: |
1524 | enum Spelling { |
1525 | GNU_clang_arm_mve_strict_polymorphism = 0, |
1526 | CXX11_clang_clang_arm_mve_strict_polymorphism = 1, |
1527 | C23_clang_clang_arm_mve_strict_polymorphism = 2, |
1528 | SpellingNotCalculated = 15 |
1529 | |
1530 | }; |
1531 | |
1532 | // Factory methods |
1533 | static ArmMveStrictPolymorphismAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
1534 | static ArmMveStrictPolymorphismAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
1535 | static ArmMveStrictPolymorphismAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_clang_arm_mve_strict_polymorphism); |
1536 | static ArmMveStrictPolymorphismAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_clang_arm_mve_strict_polymorphism); |
1537 | |
1538 | // Constructors |
1539 | ArmMveStrictPolymorphismAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1540 | ); |
1541 | |
1542 | ArmMveStrictPolymorphismAttr *clone(ASTContext &C) const; |
1543 | void printPretty(raw_ostream &OS, |
1544 | const PrintingPolicy &Policy) const; |
1545 | const char *getSpelling() const; |
1546 | |
1547 | |
1548 | static bool classof(const Attr *A) { return A->getKind() == attr::ArmMveStrictPolymorphism; } |
1549 | }; |
1550 | |
1551 | class ArmNewAttr : public InheritableAttr { |
1552 | unsigned newArgs_Size; |
1553 | StringRef *newArgs_; |
1554 | |
1555 | public: |
1556 | // Factory methods |
1557 | static ArmNewAttr *CreateImplicit(ASTContext &Ctx, StringRef *NewArgs, unsigned NewArgsSize, const AttributeCommonInfo &CommonInfo); |
1558 | static ArmNewAttr *Create(ASTContext &Ctx, StringRef *NewArgs, unsigned NewArgsSize, const AttributeCommonInfo &CommonInfo); |
1559 | static ArmNewAttr *CreateImplicit(ASTContext &Ctx, StringRef *NewArgs, unsigned NewArgsSize, SourceRange Range = {}); |
1560 | static ArmNewAttr *Create(ASTContext &Ctx, StringRef *NewArgs, unsigned NewArgsSize, SourceRange Range = {}); |
1561 | |
1562 | // Constructors |
1563 | ArmNewAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1564 | , StringRef *NewArgs, unsigned NewArgsSize |
1565 | ); |
1566 | ArmNewAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1567 | ); |
1568 | |
1569 | ArmNewAttr *clone(ASTContext &C) const; |
1570 | void printPretty(raw_ostream &OS, |
1571 | const PrintingPolicy &Policy) const; |
1572 | const char *getSpelling() const; |
1573 | typedef StringRef* newArgs_iterator; |
1574 | newArgs_iterator newArgs_begin() const { return newArgs_; } |
1575 | newArgs_iterator newArgs_end() const { return newArgs_ + newArgs_Size; } |
1576 | unsigned newArgs_size() const { return newArgs_Size; } |
1577 | llvm::iterator_range<newArgs_iterator> newArgs() const { return llvm::make_range(x: newArgs_begin(), y: newArgs_end()); } |
1578 | |
1579 | |
1580 | |
1581 | bool isNewZA() const { |
1582 | return llvm::is_contained(Range: newArgs(), Element: "za" ); |
1583 | } |
1584 | bool isNewZT0() const { |
1585 | return llvm::is_contained(Range: newArgs(), Element: "zt0" ); |
1586 | } |
1587 | |
1588 | |
1589 | static bool classof(const Attr *A) { return A->getKind() == attr::ArmNew; } |
1590 | }; |
1591 | |
1592 | class ArmOutAttr : public TypeAttr { |
1593 | unsigned outArgs_Size; |
1594 | StringRef *outArgs_; |
1595 | |
1596 | public: |
1597 | // Factory methods |
1598 | static ArmOutAttr *CreateImplicit(ASTContext &Ctx, StringRef *OutArgs, unsigned OutArgsSize, const AttributeCommonInfo &CommonInfo); |
1599 | static ArmOutAttr *Create(ASTContext &Ctx, StringRef *OutArgs, unsigned OutArgsSize, const AttributeCommonInfo &CommonInfo); |
1600 | static ArmOutAttr *CreateImplicit(ASTContext &Ctx, StringRef *OutArgs, unsigned OutArgsSize, SourceRange Range = {}); |
1601 | static ArmOutAttr *Create(ASTContext &Ctx, StringRef *OutArgs, unsigned OutArgsSize, SourceRange Range = {}); |
1602 | |
1603 | // Constructors |
1604 | ArmOutAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1605 | , StringRef *OutArgs, unsigned OutArgsSize |
1606 | ); |
1607 | ArmOutAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1608 | ); |
1609 | |
1610 | ArmOutAttr *clone(ASTContext &C) const; |
1611 | void printPretty(raw_ostream &OS, |
1612 | const PrintingPolicy &Policy) const; |
1613 | const char *getSpelling() const; |
1614 | typedef StringRef* outArgs_iterator; |
1615 | outArgs_iterator outArgs_begin() const { return outArgs_; } |
1616 | outArgs_iterator outArgs_end() const { return outArgs_ + outArgs_Size; } |
1617 | unsigned outArgs_size() const { return outArgs_Size; } |
1618 | llvm::iterator_range<outArgs_iterator> outArgs() const { return llvm::make_range(x: outArgs_begin(), y: outArgs_end()); } |
1619 | |
1620 | |
1621 | |
1622 | |
1623 | static bool classof(const Attr *A) { return A->getKind() == attr::ArmOut; } |
1624 | }; |
1625 | |
1626 | class ArmPreservesAttr : public TypeAttr { |
1627 | unsigned preserveArgs_Size; |
1628 | StringRef *preserveArgs_; |
1629 | |
1630 | public: |
1631 | // Factory methods |
1632 | static ArmPreservesAttr *CreateImplicit(ASTContext &Ctx, StringRef *PreserveArgs, unsigned PreserveArgsSize, const AttributeCommonInfo &CommonInfo); |
1633 | static ArmPreservesAttr *Create(ASTContext &Ctx, StringRef *PreserveArgs, unsigned PreserveArgsSize, const AttributeCommonInfo &CommonInfo); |
1634 | static ArmPreservesAttr *CreateImplicit(ASTContext &Ctx, StringRef *PreserveArgs, unsigned PreserveArgsSize, SourceRange Range = {}); |
1635 | static ArmPreservesAttr *Create(ASTContext &Ctx, StringRef *PreserveArgs, unsigned PreserveArgsSize, SourceRange Range = {}); |
1636 | |
1637 | // Constructors |
1638 | ArmPreservesAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1639 | , StringRef *PreserveArgs, unsigned PreserveArgsSize |
1640 | ); |
1641 | ArmPreservesAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1642 | ); |
1643 | |
1644 | ArmPreservesAttr *clone(ASTContext &C) const; |
1645 | void printPretty(raw_ostream &OS, |
1646 | const PrintingPolicy &Policy) const; |
1647 | const char *getSpelling() const; |
1648 | typedef StringRef* preserveArgs_iterator; |
1649 | preserveArgs_iterator preserveArgs_begin() const { return preserveArgs_; } |
1650 | preserveArgs_iterator preserveArgs_end() const { return preserveArgs_ + preserveArgs_Size; } |
1651 | unsigned preserveArgs_size() const { return preserveArgs_Size; } |
1652 | llvm::iterator_range<preserveArgs_iterator> preserveArgs() const { return llvm::make_range(x: preserveArgs_begin(), y: preserveArgs_end()); } |
1653 | |
1654 | |
1655 | |
1656 | |
1657 | static bool classof(const Attr *A) { return A->getKind() == attr::ArmPreserves; } |
1658 | }; |
1659 | |
1660 | class ArmStreamingAttr : public TypeAttr { |
1661 | public: |
1662 | // Factory methods |
1663 | static ArmStreamingAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
1664 | static ArmStreamingAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
1665 | static ArmStreamingAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
1666 | static ArmStreamingAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
1667 | |
1668 | // Constructors |
1669 | ArmStreamingAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1670 | ); |
1671 | |
1672 | ArmStreamingAttr *clone(ASTContext &C) const; |
1673 | void printPretty(raw_ostream &OS, |
1674 | const PrintingPolicy &Policy) const; |
1675 | const char *getSpelling() const; |
1676 | |
1677 | |
1678 | static bool classof(const Attr *A) { return A->getKind() == attr::ArmStreaming; } |
1679 | }; |
1680 | |
1681 | class ArmStreamingCompatibleAttr : public TypeAttr { |
1682 | public: |
1683 | // Factory methods |
1684 | static ArmStreamingCompatibleAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
1685 | static ArmStreamingCompatibleAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
1686 | static ArmStreamingCompatibleAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
1687 | static ArmStreamingCompatibleAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
1688 | |
1689 | // Constructors |
1690 | ArmStreamingCompatibleAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1691 | ); |
1692 | |
1693 | ArmStreamingCompatibleAttr *clone(ASTContext &C) const; |
1694 | void printPretty(raw_ostream &OS, |
1695 | const PrintingPolicy &Policy) const; |
1696 | const char *getSpelling() const; |
1697 | |
1698 | |
1699 | static bool classof(const Attr *A) { return A->getKind() == attr::ArmStreamingCompatible; } |
1700 | }; |
1701 | |
1702 | class ArtificialAttr : public InheritableAttr { |
1703 | public: |
1704 | enum Spelling { |
1705 | GNU_artificial = 0, |
1706 | CXX11_gnu_artificial = 1, |
1707 | C23_gnu_artificial = 2, |
1708 | SpellingNotCalculated = 15 |
1709 | |
1710 | }; |
1711 | |
1712 | // Factory methods |
1713 | static ArtificialAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
1714 | static ArtificialAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
1715 | static ArtificialAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_artificial); |
1716 | static ArtificialAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_artificial); |
1717 | |
1718 | // Constructors |
1719 | ArtificialAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1720 | ); |
1721 | |
1722 | ArtificialAttr *clone(ASTContext &C) const; |
1723 | void printPretty(raw_ostream &OS, |
1724 | const PrintingPolicy &Policy) const; |
1725 | const char *getSpelling() const; |
1726 | |
1727 | |
1728 | static bool classof(const Attr *A) { return A->getKind() == attr::Artificial; } |
1729 | }; |
1730 | |
1731 | class AsmLabelAttr : public InheritableAttr { |
1732 | unsigned labelLength; |
1733 | char *label; |
1734 | |
1735 | bool isLiteralLabel; |
1736 | |
1737 | public: |
1738 | enum Spelling { |
1739 | Keyword_asm = 0, |
1740 | SpellingNotCalculated = 15 |
1741 | |
1742 | }; |
1743 | |
1744 | // Factory methods |
1745 | static AsmLabelAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Label, bool IsLiteralLabel, const AttributeCommonInfo &CommonInfo); |
1746 | static AsmLabelAttr *Create(ASTContext &Ctx, llvm::StringRef Label, bool IsLiteralLabel, const AttributeCommonInfo &CommonInfo); |
1747 | static AsmLabelAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Label, bool IsLiteralLabel, SourceRange Range = {}, Spelling S = Keyword_asm); |
1748 | static AsmLabelAttr *Create(ASTContext &Ctx, llvm::StringRef Label, bool IsLiteralLabel, SourceRange Range = {}, Spelling S = Keyword_asm); |
1749 | static AsmLabelAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Label, const AttributeCommonInfo &CommonInfo); |
1750 | static AsmLabelAttr *Create(ASTContext &Ctx, llvm::StringRef Label, const AttributeCommonInfo &CommonInfo); |
1751 | static AsmLabelAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Label, SourceRange Range = {}, Spelling S = Keyword_asm); |
1752 | static AsmLabelAttr *Create(ASTContext &Ctx, llvm::StringRef Label, SourceRange Range = {}, Spelling S = Keyword_asm); |
1753 | |
1754 | // Constructors |
1755 | AsmLabelAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1756 | , llvm::StringRef Label |
1757 | , bool IsLiteralLabel |
1758 | ); |
1759 | AsmLabelAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1760 | , llvm::StringRef Label |
1761 | ); |
1762 | |
1763 | AsmLabelAttr *clone(ASTContext &C) const; |
1764 | void printPretty(raw_ostream &OS, |
1765 | const PrintingPolicy &Policy) const; |
1766 | const char *getSpelling() const; |
1767 | llvm::StringRef getLabel() const { |
1768 | return llvm::StringRef(label, labelLength); |
1769 | } |
1770 | unsigned getLabelLength() const { |
1771 | return labelLength; |
1772 | } |
1773 | void setLabel(ASTContext &C, llvm::StringRef S) { |
1774 | labelLength = S.size(); |
1775 | this->label = new (C, 1) char [labelLength]; |
1776 | if (!S.empty()) |
1777 | std::memcpy(dest: this->label, src: S.data(), n: labelLength); |
1778 | } |
1779 | |
1780 | bool getIsLiteralLabel() const { |
1781 | return isLiteralLabel; |
1782 | } |
1783 | |
1784 | |
1785 | bool isEquivalent(AsmLabelAttr *Other) const { |
1786 | return getLabel() == Other->getLabel() && getIsLiteralLabel() == Other->getIsLiteralLabel(); |
1787 | } |
1788 | |
1789 | |
1790 | static bool classof(const Attr *A) { return A->getKind() == attr::AsmLabel; } |
1791 | }; |
1792 | |
1793 | class AssertCapabilityAttr : public InheritableAttr { |
1794 | unsigned args_Size; |
1795 | Expr * *args_; |
1796 | |
1797 | public: |
1798 | enum Spelling { |
1799 | GNU_assert_capability = 0, |
1800 | CXX11_clang_assert_capability = 1, |
1801 | GNU_assert_shared_capability = 2, |
1802 | CXX11_clang_assert_shared_capability = 3, |
1803 | SpellingNotCalculated = 15 |
1804 | |
1805 | }; |
1806 | |
1807 | // Factory methods |
1808 | static AssertCapabilityAttr *CreateImplicit(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo); |
1809 | static AssertCapabilityAttr *Create(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo); |
1810 | static AssertCapabilityAttr *CreateImplicit(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, SourceRange Range = {}, Spelling S = GNU_assert_capability); |
1811 | static AssertCapabilityAttr *Create(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, SourceRange Range = {}, Spelling S = GNU_assert_capability); |
1812 | |
1813 | // Constructors |
1814 | AssertCapabilityAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1815 | , Expr * *Args, unsigned ArgsSize |
1816 | ); |
1817 | AssertCapabilityAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1818 | ); |
1819 | |
1820 | AssertCapabilityAttr *clone(ASTContext &C) const; |
1821 | void printPretty(raw_ostream &OS, |
1822 | const PrintingPolicy &Policy) const; |
1823 | const char *getSpelling() const; |
1824 | Spelling getSemanticSpelling() const; |
1825 | bool isShared() const { return getAttributeSpellingListIndex() == 2 || |
1826 | getAttributeSpellingListIndex() == 3; } |
1827 | typedef Expr ** args_iterator; |
1828 | args_iterator args_begin() const { return args_; } |
1829 | args_iterator args_end() const { return args_ + args_Size; } |
1830 | unsigned args_size() const { return args_Size; } |
1831 | llvm::iterator_range<args_iterator> args() const { return llvm::make_range(x: args_begin(), y: args_end()); } |
1832 | |
1833 | |
1834 | |
1835 | |
1836 | static bool classof(const Attr *A) { return A->getKind() == attr::AssertCapability; } |
1837 | }; |
1838 | |
1839 | class AssertExclusiveLockAttr : public InheritableAttr { |
1840 | unsigned args_Size; |
1841 | Expr * *args_; |
1842 | |
1843 | public: |
1844 | // Factory methods |
1845 | static AssertExclusiveLockAttr *CreateImplicit(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo); |
1846 | static AssertExclusiveLockAttr *Create(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo); |
1847 | static AssertExclusiveLockAttr *CreateImplicit(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, SourceRange Range = {}); |
1848 | static AssertExclusiveLockAttr *Create(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, SourceRange Range = {}); |
1849 | |
1850 | // Constructors |
1851 | AssertExclusiveLockAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1852 | , Expr * *Args, unsigned ArgsSize |
1853 | ); |
1854 | AssertExclusiveLockAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1855 | ); |
1856 | |
1857 | AssertExclusiveLockAttr *clone(ASTContext &C) const; |
1858 | void printPretty(raw_ostream &OS, |
1859 | const PrintingPolicy &Policy) const; |
1860 | const char *getSpelling() const; |
1861 | typedef Expr ** args_iterator; |
1862 | args_iterator args_begin() const { return args_; } |
1863 | args_iterator args_end() const { return args_ + args_Size; } |
1864 | unsigned args_size() const { return args_Size; } |
1865 | llvm::iterator_range<args_iterator> args() const { return llvm::make_range(x: args_begin(), y: args_end()); } |
1866 | |
1867 | |
1868 | |
1869 | |
1870 | static bool classof(const Attr *A) { return A->getKind() == attr::AssertExclusiveLock; } |
1871 | }; |
1872 | |
1873 | class AssertSharedLockAttr : public InheritableAttr { |
1874 | unsigned args_Size; |
1875 | Expr * *args_; |
1876 | |
1877 | public: |
1878 | // Factory methods |
1879 | static AssertSharedLockAttr *CreateImplicit(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo); |
1880 | static AssertSharedLockAttr *Create(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo); |
1881 | static AssertSharedLockAttr *CreateImplicit(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, SourceRange Range = {}); |
1882 | static AssertSharedLockAttr *Create(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, SourceRange Range = {}); |
1883 | |
1884 | // Constructors |
1885 | AssertSharedLockAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1886 | , Expr * *Args, unsigned ArgsSize |
1887 | ); |
1888 | AssertSharedLockAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1889 | ); |
1890 | |
1891 | AssertSharedLockAttr *clone(ASTContext &C) const; |
1892 | void printPretty(raw_ostream &OS, |
1893 | const PrintingPolicy &Policy) const; |
1894 | const char *getSpelling() const; |
1895 | typedef Expr ** args_iterator; |
1896 | args_iterator args_begin() const { return args_; } |
1897 | args_iterator args_end() const { return args_ + args_Size; } |
1898 | unsigned args_size() const { return args_Size; } |
1899 | llvm::iterator_range<args_iterator> args() const { return llvm::make_range(x: args_begin(), y: args_end()); } |
1900 | |
1901 | |
1902 | |
1903 | |
1904 | static bool classof(const Attr *A) { return A->getKind() == attr::AssertSharedLock; } |
1905 | }; |
1906 | |
1907 | class AssumeAlignedAttr : public InheritableAttr { |
1908 | Expr * alignment; |
1909 | |
1910 | Expr * offset; |
1911 | |
1912 | public: |
1913 | enum Spelling { |
1914 | GNU_assume_aligned = 0, |
1915 | CXX11_gnu_assume_aligned = 1, |
1916 | C23_gnu_assume_aligned = 2, |
1917 | SpellingNotCalculated = 15 |
1918 | |
1919 | }; |
1920 | |
1921 | // Factory methods |
1922 | static AssumeAlignedAttr *CreateImplicit(ASTContext &Ctx, Expr * Alignment, Expr * Offset, const AttributeCommonInfo &CommonInfo); |
1923 | static AssumeAlignedAttr *Create(ASTContext &Ctx, Expr * Alignment, Expr * Offset, const AttributeCommonInfo &CommonInfo); |
1924 | static AssumeAlignedAttr *CreateImplicit(ASTContext &Ctx, Expr * Alignment, Expr * Offset, SourceRange Range = {}, Spelling S = GNU_assume_aligned); |
1925 | static AssumeAlignedAttr *Create(ASTContext &Ctx, Expr * Alignment, Expr * Offset, SourceRange Range = {}, Spelling S = GNU_assume_aligned); |
1926 | |
1927 | // Constructors |
1928 | AssumeAlignedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1929 | , Expr * Alignment |
1930 | , Expr * Offset |
1931 | ); |
1932 | AssumeAlignedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1933 | , Expr * Alignment |
1934 | ); |
1935 | |
1936 | AssumeAlignedAttr *clone(ASTContext &C) const; |
1937 | void printPretty(raw_ostream &OS, |
1938 | const PrintingPolicy &Policy) const; |
1939 | const char *getSpelling() const; |
1940 | Expr * getAlignment() const { |
1941 | return alignment; |
1942 | } |
1943 | |
1944 | Expr * getOffset() const { |
1945 | return offset; |
1946 | } |
1947 | |
1948 | |
1949 | |
1950 | static bool classof(const Attr *A) { return A->getKind() == attr::AssumeAligned; } |
1951 | }; |
1952 | |
1953 | class AvailabilityAttr : public InheritableAttr { |
1954 | IdentifierInfo * platform; |
1955 | |
1956 | VersionTuple introduced; |
1957 | |
1958 | |
1959 | VersionTuple deprecated; |
1960 | |
1961 | |
1962 | VersionTuple obsoleted; |
1963 | |
1964 | |
1965 | bool unavailable; |
1966 | |
1967 | unsigned messageLength; |
1968 | char *message; |
1969 | |
1970 | bool strict; |
1971 | |
1972 | unsigned replacementLength; |
1973 | char *replacement; |
1974 | |
1975 | int priority; |
1976 | |
1977 | IdentifierInfo * environment; |
1978 | |
1979 | public: |
1980 | enum Spelling { |
1981 | GNU_availability = 0, |
1982 | CXX11_clang_availability = 1, |
1983 | C23_clang_availability = 2, |
1984 | SpellingNotCalculated = 15 |
1985 | |
1986 | }; |
1987 | |
1988 | // Factory methods |
1989 | static AvailabilityAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * Platform, VersionTuple Introduced, VersionTuple Deprecated, VersionTuple Obsoleted, bool Unavailable, llvm::StringRef Message, bool Strict, llvm::StringRef Replacement, int Priority, IdentifierInfo * Environment, const AttributeCommonInfo &CommonInfo); |
1990 | static AvailabilityAttr *Create(ASTContext &Ctx, IdentifierInfo * Platform, VersionTuple Introduced, VersionTuple Deprecated, VersionTuple Obsoleted, bool Unavailable, llvm::StringRef Message, bool Strict, llvm::StringRef Replacement, int Priority, IdentifierInfo * Environment, const AttributeCommonInfo &CommonInfo); |
1991 | static AvailabilityAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * Platform, VersionTuple Introduced, VersionTuple Deprecated, VersionTuple Obsoleted, bool Unavailable, llvm::StringRef Message, bool Strict, llvm::StringRef Replacement, int Priority, IdentifierInfo * Environment, SourceRange Range = {}, Spelling S = GNU_availability); |
1992 | static AvailabilityAttr *Create(ASTContext &Ctx, IdentifierInfo * Platform, VersionTuple Introduced, VersionTuple Deprecated, VersionTuple Obsoleted, bool Unavailable, llvm::StringRef Message, bool Strict, llvm::StringRef Replacement, int Priority, IdentifierInfo * Environment, SourceRange Range = {}, Spelling S = GNU_availability); |
1993 | |
1994 | // Constructors |
1995 | AvailabilityAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
1996 | , IdentifierInfo * Platform |
1997 | , VersionTuple Introduced |
1998 | , VersionTuple Deprecated |
1999 | , VersionTuple Obsoleted |
2000 | , bool Unavailable |
2001 | , llvm::StringRef Message |
2002 | , bool Strict |
2003 | , llvm::StringRef Replacement |
2004 | , int Priority |
2005 | , IdentifierInfo * Environment |
2006 | ); |
2007 | |
2008 | AvailabilityAttr *clone(ASTContext &C) const; |
2009 | void printPretty(raw_ostream &OS, |
2010 | const PrintingPolicy &Policy) const; |
2011 | const char *getSpelling() const; |
2012 | IdentifierInfo * getPlatform() const { |
2013 | return platform; |
2014 | } |
2015 | |
2016 | VersionTuple getIntroduced() const { |
2017 | return introduced; |
2018 | } |
2019 | void setIntroduced(ASTContext &C, VersionTuple V) { |
2020 | introduced = V; |
2021 | } |
2022 | |
2023 | VersionTuple getDeprecated() const { |
2024 | return deprecated; |
2025 | } |
2026 | void setDeprecated(ASTContext &C, VersionTuple V) { |
2027 | deprecated = V; |
2028 | } |
2029 | |
2030 | VersionTuple getObsoleted() const { |
2031 | return obsoleted; |
2032 | } |
2033 | void setObsoleted(ASTContext &C, VersionTuple V) { |
2034 | obsoleted = V; |
2035 | } |
2036 | |
2037 | bool getUnavailable() const { |
2038 | return unavailable; |
2039 | } |
2040 | |
2041 | llvm::StringRef getMessage() const { |
2042 | return llvm::StringRef(message, messageLength); |
2043 | } |
2044 | unsigned getMessageLength() const { |
2045 | return messageLength; |
2046 | } |
2047 | void setMessage(ASTContext &C, llvm::StringRef S) { |
2048 | messageLength = S.size(); |
2049 | this->message = new (C, 1) char [messageLength]; |
2050 | if (!S.empty()) |
2051 | std::memcpy(dest: this->message, src: S.data(), n: messageLength); |
2052 | } |
2053 | |
2054 | bool getStrict() const { |
2055 | return strict; |
2056 | } |
2057 | |
2058 | llvm::StringRef getReplacement() const { |
2059 | return llvm::StringRef(replacement, replacementLength); |
2060 | } |
2061 | unsigned getReplacementLength() const { |
2062 | return replacementLength; |
2063 | } |
2064 | void setReplacement(ASTContext &C, llvm::StringRef S) { |
2065 | replacementLength = S.size(); |
2066 | this->replacement = new (C, 1) char [replacementLength]; |
2067 | if (!S.empty()) |
2068 | std::memcpy(dest: this->replacement, src: S.data(), n: replacementLength); |
2069 | } |
2070 | |
2071 | int getPriority() const { |
2072 | return priority; |
2073 | } |
2074 | |
2075 | IdentifierInfo * getEnvironment() const { |
2076 | return environment; |
2077 | } |
2078 | |
2079 | static llvm::StringRef getPrettyPlatformName(llvm::StringRef Platform) { |
2080 | return llvm::StringSwitch<llvm::StringRef>(Platform) |
2081 | .Case(S: "android" , Value: "Android" ) |
2082 | .Case(S: "fuchsia" , Value: "Fuchsia" ) |
2083 | .Case(S: "ios" , Value: "iOS" ) |
2084 | .Case(S: "macos" , Value: "macOS" ) |
2085 | .Case(S: "tvos" , Value: "tvOS" ) |
2086 | .Case(S: "watchos" , Value: "watchOS" ) |
2087 | .Case(S: "driverkit" , Value: "DriverKit" ) |
2088 | .Case(S: "ios_app_extension" , Value: "iOS (App Extension)" ) |
2089 | .Case(S: "macos_app_extension" , Value: "macOS (App Extension)" ) |
2090 | .Case(S: "tvos_app_extension" , Value: "tvOS (App Extension)" ) |
2091 | .Case(S: "watchos_app_extension" , Value: "watchOS (App Extension)" ) |
2092 | .Case(S: "maccatalyst" , Value: "macCatalyst" ) |
2093 | .Case(S: "maccatalyst_app_extension" , Value: "macCatalyst (App Extension)" ) |
2094 | .Case(S: "xros" , Value: "visionOS" ) |
2095 | .Case(S: "xros_app_extension" , Value: "visionOS (App Extension)" ) |
2096 | .Case(S: "swift" , Value: "Swift" ) |
2097 | .Case(S: "shadermodel" , Value: "Shader Model" ) |
2098 | .Case(S: "ohos" , Value: "OpenHarmony OS" ) |
2099 | .Default(Value: llvm::StringRef()); |
2100 | } |
2101 | static llvm::StringRef getPlatformNameSourceSpelling(llvm::StringRef Platform) { |
2102 | return llvm::StringSwitch<llvm::StringRef>(Platform) |
2103 | .Case(S: "ios" , Value: "iOS" ) |
2104 | .Case(S: "macos" , Value: "macOS" ) |
2105 | .Case(S: "tvos" , Value: "tvOS" ) |
2106 | .Case(S: "watchos" , Value: "watchOS" ) |
2107 | .Case(S: "ios_app_extension" , Value: "iOSApplicationExtension" ) |
2108 | .Case(S: "macos_app_extension" , Value: "macOSApplicationExtension" ) |
2109 | .Case(S: "tvos_app_extension" , Value: "tvOSApplicationExtension" ) |
2110 | .Case(S: "watchos_app_extension" , Value: "watchOSApplicationExtension" ) |
2111 | .Case(S: "maccatalyst" , Value: "macCatalyst" ) |
2112 | .Case(S: "maccatalyst_app_extension" , Value: "macCatalystApplicationExtension" ) |
2113 | .Case(S: "xros" , Value: "visionOS" ) |
2114 | .Case(S: "xros_app_extension" , Value: "visionOSApplicationExtension" ) |
2115 | .Case(S: "zos" , Value: "z/OS" ) |
2116 | .Case(S: "shadermodel" , Value: "ShaderModel" ) |
2117 | .Default(Value: Platform); |
2118 | } |
2119 | static llvm::StringRef canonicalizePlatformName(llvm::StringRef Platform) { |
2120 | return llvm::StringSwitch<llvm::StringRef>(Platform) |
2121 | .Case(S: "iOS" , Value: "ios" ) |
2122 | .Case(S: "macOS" , Value: "macos" ) |
2123 | .Case(S: "tvOS" , Value: "tvos" ) |
2124 | .Case(S: "watchOS" , Value: "watchos" ) |
2125 | .Case(S: "iOSApplicationExtension" , Value: "ios_app_extension" ) |
2126 | .Case(S: "macOSApplicationExtension" , Value: "macos_app_extension" ) |
2127 | .Case(S: "tvOSApplicationExtension" , Value: "tvos_app_extension" ) |
2128 | .Case(S: "watchOSApplicationExtension" , Value: "watchos_app_extension" ) |
2129 | .Case(S: "macCatalyst" , Value: "maccatalyst" ) |
2130 | .Case(S: "macCatalystApplicationExtension" , Value: "maccatalyst_app_extension" ) |
2131 | .Case(S: "visionOS" , Value: "xros" ) |
2132 | .Case(S: "visionOSApplicationExtension" , Value: "xros_app_extension" ) |
2133 | .Case(S: "visionos" , Value: "xros" ) |
2134 | .Case(S: "visionos_app_extension" , Value: "xros_app_extension" ) |
2135 | .Case(S: "ShaderModel" , Value: "shadermodel" ) |
2136 | .Default(Value: Platform); |
2137 | } |
2138 | static llvm::Triple::EnvironmentType getEnvironmentType(llvm::StringRef Environment) { |
2139 | return llvm::StringSwitch<llvm::Triple::EnvironmentType>(Environment) |
2140 | .Case(S: "pixel" , Value: llvm::Triple::Pixel) |
2141 | .Case(S: "vertex" , Value: llvm::Triple::Vertex) |
2142 | .Case(S: "geometry" , Value: llvm::Triple::Geometry) |
2143 | .Case(S: "hull" , Value: llvm::Triple::Hull) |
2144 | .Case(S: "domain" , Value: llvm::Triple::Domain) |
2145 | .Case(S: "compute" , Value: llvm::Triple::Compute) |
2146 | .Case(S: "raygeneration" , Value: llvm::Triple::RayGeneration) |
2147 | .Case(S: "intersection" , Value: llvm::Triple::Intersection) |
2148 | .Case(S: "anyhit" , Value: llvm::Triple::AnyHit) |
2149 | .Case(S: "closesthit" , Value: llvm::Triple::ClosestHit) |
2150 | .Case(S: "miss" , Value: llvm::Triple::Miss) |
2151 | .Case(S: "callable" , Value: llvm::Triple::Callable) |
2152 | .Case(S: "mesh" , Value: llvm::Triple::Mesh) |
2153 | .Case(S: "amplification" , Value: llvm::Triple::Amplification) |
2154 | .Case(S: "library" , Value: llvm::Triple::Library) |
2155 | .Default(Value: llvm::Triple::UnknownEnvironment); |
2156 | } |
2157 | |
2158 | |
2159 | static bool classof(const Attr *A) { return A->getKind() == attr::Availability; } |
2160 | }; |
2161 | |
2162 | class AvailableOnlyInDefaultEvalMethodAttr : public InheritableAttr { |
2163 | public: |
2164 | enum Spelling { |
2165 | GNU_available_only_in_default_eval_method = 0, |
2166 | CXX11_clang_available_only_in_default_eval_method = 1, |
2167 | C23_clang_available_only_in_default_eval_method = 2, |
2168 | SpellingNotCalculated = 15 |
2169 | |
2170 | }; |
2171 | |
2172 | // Factory methods |
2173 | static AvailableOnlyInDefaultEvalMethodAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
2174 | static AvailableOnlyInDefaultEvalMethodAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
2175 | static AvailableOnlyInDefaultEvalMethodAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_available_only_in_default_eval_method); |
2176 | static AvailableOnlyInDefaultEvalMethodAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_available_only_in_default_eval_method); |
2177 | |
2178 | // Constructors |
2179 | AvailableOnlyInDefaultEvalMethodAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
2180 | ); |
2181 | |
2182 | AvailableOnlyInDefaultEvalMethodAttr *clone(ASTContext &C) const; |
2183 | void printPretty(raw_ostream &OS, |
2184 | const PrintingPolicy &Policy) const; |
2185 | const char *getSpelling() const; |
2186 | |
2187 | |
2188 | static bool classof(const Attr *A) { return A->getKind() == attr::AvailableOnlyInDefaultEvalMethod; } |
2189 | }; |
2190 | |
2191 | class BPFPreserveAccessIndexAttr : public InheritableAttr { |
2192 | public: |
2193 | enum Spelling { |
2194 | GNU_preserve_access_index = 0, |
2195 | CXX11_clang_preserve_access_index = 1, |
2196 | C23_clang_preserve_access_index = 2, |
2197 | SpellingNotCalculated = 15 |
2198 | |
2199 | }; |
2200 | |
2201 | // Factory methods |
2202 | static BPFPreserveAccessIndexAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
2203 | static BPFPreserveAccessIndexAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
2204 | static BPFPreserveAccessIndexAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_preserve_access_index); |
2205 | static BPFPreserveAccessIndexAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_preserve_access_index); |
2206 | |
2207 | // Constructors |
2208 | BPFPreserveAccessIndexAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
2209 | ); |
2210 | |
2211 | BPFPreserveAccessIndexAttr *clone(ASTContext &C) const; |
2212 | void printPretty(raw_ostream &OS, |
2213 | const PrintingPolicy &Policy) const; |
2214 | const char *getSpelling() const; |
2215 | |
2216 | |
2217 | static bool classof(const Attr *A) { return A->getKind() == attr::BPFPreserveAccessIndex; } |
2218 | }; |
2219 | |
2220 | class BPFPreserveStaticOffsetAttr : public InheritableAttr { |
2221 | public: |
2222 | enum Spelling { |
2223 | GNU_preserve_static_offset = 0, |
2224 | CXX11_clang_preserve_static_offset = 1, |
2225 | C23_clang_preserve_static_offset = 2, |
2226 | SpellingNotCalculated = 15 |
2227 | |
2228 | }; |
2229 | |
2230 | // Factory methods |
2231 | static BPFPreserveStaticOffsetAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
2232 | static BPFPreserveStaticOffsetAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
2233 | static BPFPreserveStaticOffsetAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_preserve_static_offset); |
2234 | static BPFPreserveStaticOffsetAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_preserve_static_offset); |
2235 | |
2236 | // Constructors |
2237 | BPFPreserveStaticOffsetAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
2238 | ); |
2239 | |
2240 | BPFPreserveStaticOffsetAttr *clone(ASTContext &C) const; |
2241 | void printPretty(raw_ostream &OS, |
2242 | const PrintingPolicy &Policy) const; |
2243 | const char *getSpelling() const; |
2244 | |
2245 | |
2246 | static bool classof(const Attr *A) { return A->getKind() == attr::BPFPreserveStaticOffset; } |
2247 | }; |
2248 | |
2249 | class BTFDeclTagAttr : public InheritableAttr { |
2250 | unsigned bTFDeclTagLength; |
2251 | char *bTFDeclTag; |
2252 | |
2253 | public: |
2254 | enum Spelling { |
2255 | GNU_btf_decl_tag = 0, |
2256 | CXX11_clang_btf_decl_tag = 1, |
2257 | C23_clang_btf_decl_tag = 2, |
2258 | SpellingNotCalculated = 15 |
2259 | |
2260 | }; |
2261 | |
2262 | // Factory methods |
2263 | static BTFDeclTagAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef BTFDeclTag, const AttributeCommonInfo &CommonInfo); |
2264 | static BTFDeclTagAttr *Create(ASTContext &Ctx, llvm::StringRef BTFDeclTag, const AttributeCommonInfo &CommonInfo); |
2265 | static BTFDeclTagAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef BTFDeclTag, SourceRange Range = {}, Spelling S = GNU_btf_decl_tag); |
2266 | static BTFDeclTagAttr *Create(ASTContext &Ctx, llvm::StringRef BTFDeclTag, SourceRange Range = {}, Spelling S = GNU_btf_decl_tag); |
2267 | |
2268 | // Constructors |
2269 | BTFDeclTagAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
2270 | , llvm::StringRef BTFDeclTag |
2271 | ); |
2272 | |
2273 | BTFDeclTagAttr *clone(ASTContext &C) const; |
2274 | void printPretty(raw_ostream &OS, |
2275 | const PrintingPolicy &Policy) const; |
2276 | const char *getSpelling() const; |
2277 | llvm::StringRef getBTFDeclTag() const { |
2278 | return llvm::StringRef(bTFDeclTag, bTFDeclTagLength); |
2279 | } |
2280 | unsigned getBTFDeclTagLength() const { |
2281 | return bTFDeclTagLength; |
2282 | } |
2283 | void setBTFDeclTag(ASTContext &C, llvm::StringRef S) { |
2284 | bTFDeclTagLength = S.size(); |
2285 | this->bTFDeclTag = new (C, 1) char [bTFDeclTagLength]; |
2286 | if (!S.empty()) |
2287 | std::memcpy(dest: this->bTFDeclTag, src: S.data(), n: bTFDeclTagLength); |
2288 | } |
2289 | |
2290 | |
2291 | |
2292 | static bool classof(const Attr *A) { return A->getKind() == attr::BTFDeclTag; } |
2293 | }; |
2294 | |
2295 | class BTFTypeTagAttr : public TypeAttr { |
2296 | unsigned bTFTypeTagLength; |
2297 | char *bTFTypeTag; |
2298 | |
2299 | public: |
2300 | enum Spelling { |
2301 | GNU_btf_type_tag = 0, |
2302 | CXX11_clang_btf_type_tag = 1, |
2303 | C23_clang_btf_type_tag = 2, |
2304 | SpellingNotCalculated = 15 |
2305 | |
2306 | }; |
2307 | |
2308 | // Factory methods |
2309 | static BTFTypeTagAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef BTFTypeTag, const AttributeCommonInfo &CommonInfo); |
2310 | static BTFTypeTagAttr *Create(ASTContext &Ctx, llvm::StringRef BTFTypeTag, const AttributeCommonInfo &CommonInfo); |
2311 | static BTFTypeTagAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef BTFTypeTag, SourceRange Range = {}, Spelling S = GNU_btf_type_tag); |
2312 | static BTFTypeTagAttr *Create(ASTContext &Ctx, llvm::StringRef BTFTypeTag, SourceRange Range = {}, Spelling S = GNU_btf_type_tag); |
2313 | |
2314 | // Constructors |
2315 | BTFTypeTagAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
2316 | , llvm::StringRef BTFTypeTag |
2317 | ); |
2318 | |
2319 | BTFTypeTagAttr *clone(ASTContext &C) const; |
2320 | void printPretty(raw_ostream &OS, |
2321 | const PrintingPolicy &Policy) const; |
2322 | const char *getSpelling() const; |
2323 | llvm::StringRef getBTFTypeTag() const { |
2324 | return llvm::StringRef(bTFTypeTag, bTFTypeTagLength); |
2325 | } |
2326 | unsigned getBTFTypeTagLength() const { |
2327 | return bTFTypeTagLength; |
2328 | } |
2329 | void setBTFTypeTag(ASTContext &C, llvm::StringRef S) { |
2330 | bTFTypeTagLength = S.size(); |
2331 | this->bTFTypeTag = new (C, 1) char [bTFTypeTagLength]; |
2332 | if (!S.empty()) |
2333 | std::memcpy(dest: this->bTFTypeTag, src: S.data(), n: bTFTypeTagLength); |
2334 | } |
2335 | |
2336 | |
2337 | |
2338 | static bool classof(const Attr *A) { return A->getKind() == attr::BTFTypeTag; } |
2339 | }; |
2340 | |
2341 | class BlockingAttr : public TypeAttr { |
2342 | public: |
2343 | enum Spelling { |
2344 | GNU_blocking = 0, |
2345 | CXX11_clang_blocking = 1, |
2346 | C23_clang_blocking = 2, |
2347 | SpellingNotCalculated = 15 |
2348 | |
2349 | }; |
2350 | |
2351 | // Factory methods |
2352 | static BlockingAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
2353 | static BlockingAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
2354 | static BlockingAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_blocking); |
2355 | static BlockingAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_blocking); |
2356 | |
2357 | // Constructors |
2358 | BlockingAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
2359 | ); |
2360 | |
2361 | BlockingAttr *clone(ASTContext &C) const; |
2362 | void printPretty(raw_ostream &OS, |
2363 | const PrintingPolicy &Policy) const; |
2364 | const char *getSpelling() const; |
2365 | |
2366 | |
2367 | static bool classof(const Attr *A) { return A->getKind() == attr::Blocking; } |
2368 | }; |
2369 | |
2370 | class BlocksAttr : public InheritableAttr { |
2371 | public: |
2372 | enum BlockType { |
2373 | ByRef |
2374 | }; |
2375 | private: |
2376 | BlocksAttr::BlockType type; |
2377 | |
2378 | public: |
2379 | enum Spelling { |
2380 | GNU_blocks = 0, |
2381 | CXX11_clang_blocks = 1, |
2382 | C23_clang_blocks = 2, |
2383 | SpellingNotCalculated = 15 |
2384 | |
2385 | }; |
2386 | |
2387 | // Factory methods |
2388 | static BlocksAttr *CreateImplicit(ASTContext &Ctx, BlocksAttr::BlockType Type, const AttributeCommonInfo &CommonInfo); |
2389 | static BlocksAttr *Create(ASTContext &Ctx, BlocksAttr::BlockType Type, const AttributeCommonInfo &CommonInfo); |
2390 | static BlocksAttr *CreateImplicit(ASTContext &Ctx, BlocksAttr::BlockType Type, SourceRange Range = {}, Spelling S = GNU_blocks); |
2391 | static BlocksAttr *Create(ASTContext &Ctx, BlocksAttr::BlockType Type, SourceRange Range = {}, Spelling S = GNU_blocks); |
2392 | |
2393 | // Constructors |
2394 | BlocksAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
2395 | , BlocksAttr::BlockType Type |
2396 | ); |
2397 | |
2398 | BlocksAttr *clone(ASTContext &C) const; |
2399 | void printPretty(raw_ostream &OS, |
2400 | const PrintingPolicy &Policy) const; |
2401 | const char *getSpelling() const; |
2402 | BlocksAttr::BlockType getType() const { |
2403 | return type; |
2404 | } |
2405 | |
2406 | static bool ConvertStrToBlockType(StringRef Val, BlocksAttr::BlockType &Out); |
2407 | static const char *ConvertBlockTypeToStr(BlocksAttr::BlockType Val); |
2408 | |
2409 | |
2410 | static bool classof(const Attr *A) { return A->getKind() == attr::Blocks; } |
2411 | }; |
2412 | |
2413 | class BuiltinAttr : public InheritableAttr { |
2414 | unsigned iD; |
2415 | |
2416 | public: |
2417 | // Factory methods |
2418 | static BuiltinAttr *CreateImplicit(ASTContext &Ctx, unsigned ID, const AttributeCommonInfo &CommonInfo); |
2419 | static BuiltinAttr *Create(ASTContext &Ctx, unsigned ID, const AttributeCommonInfo &CommonInfo); |
2420 | static BuiltinAttr *CreateImplicit(ASTContext &Ctx, unsigned ID, SourceRange Range = {}); |
2421 | static BuiltinAttr *Create(ASTContext &Ctx, unsigned ID, SourceRange Range = {}); |
2422 | |
2423 | // Constructors |
2424 | BuiltinAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
2425 | , unsigned ID |
2426 | ); |
2427 | |
2428 | BuiltinAttr *clone(ASTContext &C) const; |
2429 | void printPretty(raw_ostream &OS, |
2430 | const PrintingPolicy &Policy) const; |
2431 | const char *getSpelling() const; |
2432 | unsigned getID() const { |
2433 | return iD; |
2434 | } |
2435 | |
2436 | |
2437 | |
2438 | static bool classof(const Attr *A) { return A->getKind() == attr::Builtin; } |
2439 | }; |
2440 | |
2441 | class BuiltinAliasAttr : public Attr { |
2442 | IdentifierInfo * builtinName; |
2443 | |
2444 | public: |
2445 | enum Spelling { |
2446 | CXX11_clang_builtin_alias = 0, |
2447 | C23_clang_builtin_alias = 1, |
2448 | GNU_clang_builtin_alias = 2, |
2449 | SpellingNotCalculated = 15 |
2450 | |
2451 | }; |
2452 | |
2453 | // Factory methods |
2454 | static BuiltinAliasAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * BuiltinName, const AttributeCommonInfo &CommonInfo); |
2455 | static BuiltinAliasAttr *Create(ASTContext &Ctx, IdentifierInfo * BuiltinName, const AttributeCommonInfo &CommonInfo); |
2456 | static BuiltinAliasAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * BuiltinName, SourceRange Range = {}, Spelling S = CXX11_clang_builtin_alias); |
2457 | static BuiltinAliasAttr *Create(ASTContext &Ctx, IdentifierInfo * BuiltinName, SourceRange Range = {}, Spelling S = CXX11_clang_builtin_alias); |
2458 | |
2459 | // Constructors |
2460 | BuiltinAliasAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
2461 | , IdentifierInfo * BuiltinName |
2462 | ); |
2463 | |
2464 | BuiltinAliasAttr *clone(ASTContext &C) const; |
2465 | void printPretty(raw_ostream &OS, |
2466 | const PrintingPolicy &Policy) const; |
2467 | const char *getSpelling() const; |
2468 | Spelling getSemanticSpelling() const; |
2469 | IdentifierInfo * getBuiltinName() const { |
2470 | return builtinName; |
2471 | } |
2472 | |
2473 | |
2474 | |
2475 | static bool classof(const Attr *A) { return A->getKind() == attr::BuiltinAlias; } |
2476 | }; |
2477 | |
2478 | class C11NoReturnAttr : public InheritableAttr { |
2479 | public: |
2480 | // Factory methods |
2481 | static C11NoReturnAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
2482 | static C11NoReturnAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
2483 | static C11NoReturnAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
2484 | static C11NoReturnAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
2485 | |
2486 | // Constructors |
2487 | C11NoReturnAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
2488 | ); |
2489 | |
2490 | C11NoReturnAttr *clone(ASTContext &C) const; |
2491 | void printPretty(raw_ostream &OS, |
2492 | const PrintingPolicy &Policy) const; |
2493 | const char *getSpelling() const; |
2494 | |
2495 | |
2496 | static bool classof(const Attr *A) { return A->getKind() == attr::C11NoReturn; } |
2497 | }; |
2498 | |
2499 | class CDeclAttr : public InheritableAttr { |
2500 | public: |
2501 | enum Spelling { |
2502 | GNU_cdecl = 0, |
2503 | CXX11_gnu_cdecl = 1, |
2504 | C23_gnu_cdecl = 2, |
2505 | Keyword_cdecl = 3, |
2506 | SpellingNotCalculated = 15 |
2507 | |
2508 | }; |
2509 | |
2510 | // Factory methods |
2511 | static CDeclAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
2512 | static CDeclAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
2513 | static CDeclAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_cdecl); |
2514 | static CDeclAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_cdecl); |
2515 | |
2516 | // Constructors |
2517 | CDeclAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
2518 | ); |
2519 | |
2520 | CDeclAttr *clone(ASTContext &C) const; |
2521 | void printPretty(raw_ostream &OS, |
2522 | const PrintingPolicy &Policy) const; |
2523 | const char *getSpelling() const; |
2524 | |
2525 | |
2526 | static bool classof(const Attr *A) { return A->getKind() == attr::CDecl; } |
2527 | }; |
2528 | |
2529 | class CFAuditedTransferAttr : public InheritableAttr { |
2530 | public: |
2531 | enum Spelling { |
2532 | GNU_cf_audited_transfer = 0, |
2533 | CXX11_clang_cf_audited_transfer = 1, |
2534 | C23_clang_cf_audited_transfer = 2, |
2535 | SpellingNotCalculated = 15 |
2536 | |
2537 | }; |
2538 | |
2539 | // Factory methods |
2540 | static CFAuditedTransferAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
2541 | static CFAuditedTransferAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
2542 | static CFAuditedTransferAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_cf_audited_transfer); |
2543 | static CFAuditedTransferAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_cf_audited_transfer); |
2544 | |
2545 | // Constructors |
2546 | CFAuditedTransferAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
2547 | ); |
2548 | |
2549 | CFAuditedTransferAttr *clone(ASTContext &C) const; |
2550 | void printPretty(raw_ostream &OS, |
2551 | const PrintingPolicy &Policy) const; |
2552 | const char *getSpelling() const; |
2553 | |
2554 | |
2555 | static bool classof(const Attr *A) { return A->getKind() == attr::CFAuditedTransfer; } |
2556 | }; |
2557 | |
2558 | class CFConsumedAttr : public InheritableParamAttr { |
2559 | public: |
2560 | enum Spelling { |
2561 | GNU_cf_consumed = 0, |
2562 | CXX11_clang_cf_consumed = 1, |
2563 | C23_clang_cf_consumed = 2, |
2564 | SpellingNotCalculated = 15 |
2565 | |
2566 | }; |
2567 | |
2568 | // Factory methods |
2569 | static CFConsumedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
2570 | static CFConsumedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
2571 | static CFConsumedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_cf_consumed); |
2572 | static CFConsumedAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_cf_consumed); |
2573 | |
2574 | // Constructors |
2575 | CFConsumedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
2576 | ); |
2577 | |
2578 | CFConsumedAttr *clone(ASTContext &C) const; |
2579 | void printPretty(raw_ostream &OS, |
2580 | const PrintingPolicy &Policy) const; |
2581 | const char *getSpelling() const; |
2582 | |
2583 | |
2584 | static bool classof(const Attr *A) { return A->getKind() == attr::CFConsumed; } |
2585 | }; |
2586 | |
2587 | class CFGuardAttr : public InheritableAttr { |
2588 | public: |
2589 | enum GuardArg { |
2590 | nocf |
2591 | }; |
2592 | private: |
2593 | CFGuardAttr::GuardArg guard; |
2594 | |
2595 | public: |
2596 | enum Spelling { |
2597 | Declspec_guard = 0, |
2598 | GNU_guard = 1, |
2599 | CXX11_clang_guard = 2, |
2600 | C23_clang_guard = 3, |
2601 | SpellingNotCalculated = 15 |
2602 | |
2603 | }; |
2604 | |
2605 | // Factory methods |
2606 | static CFGuardAttr *CreateImplicit(ASTContext &Ctx, CFGuardAttr::GuardArg Guard, const AttributeCommonInfo &CommonInfo); |
2607 | static CFGuardAttr *Create(ASTContext &Ctx, CFGuardAttr::GuardArg Guard, const AttributeCommonInfo &CommonInfo); |
2608 | static CFGuardAttr *CreateImplicit(ASTContext &Ctx, CFGuardAttr::GuardArg Guard, SourceRange Range = {}, Spelling S = Declspec_guard); |
2609 | static CFGuardAttr *Create(ASTContext &Ctx, CFGuardAttr::GuardArg Guard, SourceRange Range = {}, Spelling S = Declspec_guard); |
2610 | |
2611 | // Constructors |
2612 | CFGuardAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
2613 | , CFGuardAttr::GuardArg Guard |
2614 | ); |
2615 | |
2616 | CFGuardAttr *clone(ASTContext &C) const; |
2617 | void printPretty(raw_ostream &OS, |
2618 | const PrintingPolicy &Policy) const; |
2619 | const char *getSpelling() const; |
2620 | CFGuardAttr::GuardArg getGuard() const { |
2621 | return guard; |
2622 | } |
2623 | |
2624 | static bool ConvertStrToGuardArg(StringRef Val, CFGuardAttr::GuardArg &Out); |
2625 | static const char *ConvertGuardArgToStr(CFGuardAttr::GuardArg Val); |
2626 | |
2627 | |
2628 | static bool classof(const Attr *A) { return A->getKind() == attr::CFGuard; } |
2629 | }; |
2630 | |
2631 | class CFICanonicalJumpTableAttr : public InheritableAttr { |
2632 | public: |
2633 | enum Spelling { |
2634 | GNU_cfi_canonical_jump_table = 0, |
2635 | CXX11_clang_cfi_canonical_jump_table = 1, |
2636 | C23_clang_cfi_canonical_jump_table = 2, |
2637 | SpellingNotCalculated = 15 |
2638 | |
2639 | }; |
2640 | |
2641 | // Factory methods |
2642 | static CFICanonicalJumpTableAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
2643 | static CFICanonicalJumpTableAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
2644 | static CFICanonicalJumpTableAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_cfi_canonical_jump_table); |
2645 | static CFICanonicalJumpTableAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_cfi_canonical_jump_table); |
2646 | |
2647 | // Constructors |
2648 | CFICanonicalJumpTableAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
2649 | ); |
2650 | |
2651 | CFICanonicalJumpTableAttr *clone(ASTContext &C) const; |
2652 | void printPretty(raw_ostream &OS, |
2653 | const PrintingPolicy &Policy) const; |
2654 | const char *getSpelling() const; |
2655 | |
2656 | |
2657 | static bool classof(const Attr *A) { return A->getKind() == attr::CFICanonicalJumpTable; } |
2658 | }; |
2659 | |
2660 | class CFReturnsNotRetainedAttr : public InheritableAttr { |
2661 | public: |
2662 | enum Spelling { |
2663 | GNU_cf_returns_not_retained = 0, |
2664 | CXX11_clang_cf_returns_not_retained = 1, |
2665 | C23_clang_cf_returns_not_retained = 2, |
2666 | SpellingNotCalculated = 15 |
2667 | |
2668 | }; |
2669 | |
2670 | // Factory methods |
2671 | static CFReturnsNotRetainedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
2672 | static CFReturnsNotRetainedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
2673 | static CFReturnsNotRetainedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_cf_returns_not_retained); |
2674 | static CFReturnsNotRetainedAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_cf_returns_not_retained); |
2675 | |
2676 | // Constructors |
2677 | CFReturnsNotRetainedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
2678 | ); |
2679 | |
2680 | CFReturnsNotRetainedAttr *clone(ASTContext &C) const; |
2681 | void printPretty(raw_ostream &OS, |
2682 | const PrintingPolicy &Policy) const; |
2683 | const char *getSpelling() const; |
2684 | |
2685 | |
2686 | static bool classof(const Attr *A) { return A->getKind() == attr::CFReturnsNotRetained; } |
2687 | }; |
2688 | |
2689 | class CFReturnsRetainedAttr : public InheritableAttr { |
2690 | public: |
2691 | enum Spelling { |
2692 | GNU_cf_returns_retained = 0, |
2693 | CXX11_clang_cf_returns_retained = 1, |
2694 | C23_clang_cf_returns_retained = 2, |
2695 | SpellingNotCalculated = 15 |
2696 | |
2697 | }; |
2698 | |
2699 | // Factory methods |
2700 | static CFReturnsRetainedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
2701 | static CFReturnsRetainedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
2702 | static CFReturnsRetainedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_cf_returns_retained); |
2703 | static CFReturnsRetainedAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_cf_returns_retained); |
2704 | |
2705 | // Constructors |
2706 | CFReturnsRetainedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
2707 | ); |
2708 | |
2709 | CFReturnsRetainedAttr *clone(ASTContext &C) const; |
2710 | void printPretty(raw_ostream &OS, |
2711 | const PrintingPolicy &Policy) const; |
2712 | const char *getSpelling() const; |
2713 | |
2714 | |
2715 | static bool classof(const Attr *A) { return A->getKind() == attr::CFReturnsRetained; } |
2716 | }; |
2717 | |
2718 | class CFUnknownTransferAttr : public InheritableAttr { |
2719 | public: |
2720 | enum Spelling { |
2721 | GNU_cf_unknown_transfer = 0, |
2722 | CXX11_clang_cf_unknown_transfer = 1, |
2723 | C23_clang_cf_unknown_transfer = 2, |
2724 | SpellingNotCalculated = 15 |
2725 | |
2726 | }; |
2727 | |
2728 | // Factory methods |
2729 | static CFUnknownTransferAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
2730 | static CFUnknownTransferAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
2731 | static CFUnknownTransferAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_cf_unknown_transfer); |
2732 | static CFUnknownTransferAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_cf_unknown_transfer); |
2733 | |
2734 | // Constructors |
2735 | CFUnknownTransferAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
2736 | ); |
2737 | |
2738 | CFUnknownTransferAttr *clone(ASTContext &C) const; |
2739 | void printPretty(raw_ostream &OS, |
2740 | const PrintingPolicy &Policy) const; |
2741 | const char *getSpelling() const; |
2742 | |
2743 | |
2744 | static bool classof(const Attr *A) { return A->getKind() == attr::CFUnknownTransfer; } |
2745 | }; |
2746 | |
2747 | class CPUDispatchAttr : public InheritableAttr { |
2748 | unsigned cpus_Size; |
2749 | IdentifierInfo * *cpus_; |
2750 | |
2751 | public: |
2752 | enum Spelling { |
2753 | GNU_cpu_dispatch = 0, |
2754 | CXX11_clang_cpu_dispatch = 1, |
2755 | C23_clang_cpu_dispatch = 2, |
2756 | Declspec_cpu_dispatch = 3, |
2757 | SpellingNotCalculated = 15 |
2758 | |
2759 | }; |
2760 | |
2761 | // Factory methods |
2762 | static CPUDispatchAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * *Cpus, unsigned CpusSize, const AttributeCommonInfo &CommonInfo); |
2763 | static CPUDispatchAttr *Create(ASTContext &Ctx, IdentifierInfo * *Cpus, unsigned CpusSize, const AttributeCommonInfo &CommonInfo); |
2764 | static CPUDispatchAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * *Cpus, unsigned CpusSize, SourceRange Range = {}, Spelling S = GNU_cpu_dispatch); |
2765 | static CPUDispatchAttr *Create(ASTContext &Ctx, IdentifierInfo * *Cpus, unsigned CpusSize, SourceRange Range = {}, Spelling S = GNU_cpu_dispatch); |
2766 | |
2767 | // Constructors |
2768 | CPUDispatchAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
2769 | , IdentifierInfo * *Cpus, unsigned CpusSize |
2770 | ); |
2771 | CPUDispatchAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
2772 | ); |
2773 | |
2774 | CPUDispatchAttr *clone(ASTContext &C) const; |
2775 | void printPretty(raw_ostream &OS, |
2776 | const PrintingPolicy &Policy) const; |
2777 | const char *getSpelling() const; |
2778 | typedef IdentifierInfo ** cpus_iterator; |
2779 | cpus_iterator cpus_begin() const { return cpus_; } |
2780 | cpus_iterator cpus_end() const { return cpus_ + cpus_Size; } |
2781 | unsigned cpus_size() const { return cpus_Size; } |
2782 | llvm::iterator_range<cpus_iterator> cpus() const { return llvm::make_range(x: cpus_begin(), y: cpus_end()); } |
2783 | |
2784 | |
2785 | |
2786 | |
2787 | static bool classof(const Attr *A) { return A->getKind() == attr::CPUDispatch; } |
2788 | }; |
2789 | |
2790 | class CPUSpecificAttr : public InheritableAttr { |
2791 | unsigned cpus_Size; |
2792 | IdentifierInfo * *cpus_; |
2793 | |
2794 | public: |
2795 | enum Spelling { |
2796 | GNU_cpu_specific = 0, |
2797 | CXX11_clang_cpu_specific = 1, |
2798 | C23_clang_cpu_specific = 2, |
2799 | Declspec_cpu_specific = 3, |
2800 | SpellingNotCalculated = 15 |
2801 | |
2802 | }; |
2803 | |
2804 | // Factory methods |
2805 | static CPUSpecificAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * *Cpus, unsigned CpusSize, const AttributeCommonInfo &CommonInfo); |
2806 | static CPUSpecificAttr *Create(ASTContext &Ctx, IdentifierInfo * *Cpus, unsigned CpusSize, const AttributeCommonInfo &CommonInfo); |
2807 | static CPUSpecificAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * *Cpus, unsigned CpusSize, SourceRange Range = {}, Spelling S = GNU_cpu_specific); |
2808 | static CPUSpecificAttr *Create(ASTContext &Ctx, IdentifierInfo * *Cpus, unsigned CpusSize, SourceRange Range = {}, Spelling S = GNU_cpu_specific); |
2809 | |
2810 | // Constructors |
2811 | CPUSpecificAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
2812 | , IdentifierInfo * *Cpus, unsigned CpusSize |
2813 | ); |
2814 | CPUSpecificAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
2815 | ); |
2816 | |
2817 | CPUSpecificAttr *clone(ASTContext &C) const; |
2818 | void printPretty(raw_ostream &OS, |
2819 | const PrintingPolicy &Policy) const; |
2820 | const char *getSpelling() const; |
2821 | typedef IdentifierInfo ** cpus_iterator; |
2822 | cpus_iterator cpus_begin() const { return cpus_; } |
2823 | cpus_iterator cpus_end() const { return cpus_ + cpus_Size; } |
2824 | unsigned cpus_size() const { return cpus_Size; } |
2825 | llvm::iterator_range<cpus_iterator> cpus() const { return llvm::make_range(x: cpus_begin(), y: cpus_end()); } |
2826 | |
2827 | |
2828 | |
2829 | IdentifierInfo *getCPUName(unsigned Index) const { |
2830 | return *(cpus_begin() + Index); |
2831 | } |
2832 | |
2833 | |
2834 | static bool classof(const Attr *A) { return A->getKind() == attr::CPUSpecific; } |
2835 | }; |
2836 | |
2837 | class CUDAConstantAttr : public InheritableAttr { |
2838 | public: |
2839 | enum Spelling { |
2840 | GNU_constant = 0, |
2841 | Declspec_constant = 1, |
2842 | SpellingNotCalculated = 15 |
2843 | |
2844 | }; |
2845 | |
2846 | // Factory methods |
2847 | static CUDAConstantAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
2848 | static CUDAConstantAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
2849 | static CUDAConstantAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_constant); |
2850 | static CUDAConstantAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_constant); |
2851 | |
2852 | // Constructors |
2853 | CUDAConstantAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
2854 | ); |
2855 | |
2856 | CUDAConstantAttr *clone(ASTContext &C) const; |
2857 | void printPretty(raw_ostream &OS, |
2858 | const PrintingPolicy &Policy) const; |
2859 | const char *getSpelling() const; |
2860 | |
2861 | |
2862 | static bool classof(const Attr *A) { return A->getKind() == attr::CUDAConstant; } |
2863 | }; |
2864 | |
2865 | class CUDADeviceAttr : public InheritableAttr { |
2866 | public: |
2867 | enum Spelling { |
2868 | GNU_device = 0, |
2869 | Declspec_device = 1, |
2870 | SpellingNotCalculated = 15 |
2871 | |
2872 | }; |
2873 | |
2874 | // Factory methods |
2875 | static CUDADeviceAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
2876 | static CUDADeviceAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
2877 | static CUDADeviceAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_device); |
2878 | static CUDADeviceAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_device); |
2879 | |
2880 | // Constructors |
2881 | CUDADeviceAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
2882 | ); |
2883 | |
2884 | CUDADeviceAttr *clone(ASTContext &C) const; |
2885 | void printPretty(raw_ostream &OS, |
2886 | const PrintingPolicy &Policy) const; |
2887 | const char *getSpelling() const; |
2888 | |
2889 | |
2890 | static bool classof(const Attr *A) { return A->getKind() == attr::CUDADevice; } |
2891 | }; |
2892 | |
2893 | class CUDADeviceBuiltinSurfaceTypeAttr : public InheritableAttr { |
2894 | public: |
2895 | enum Spelling { |
2896 | GNU_device_builtin_surface_type = 0, |
2897 | Declspec_device_builtin_surface_type = 1, |
2898 | SpellingNotCalculated = 15 |
2899 | |
2900 | }; |
2901 | |
2902 | // Factory methods |
2903 | static CUDADeviceBuiltinSurfaceTypeAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
2904 | static CUDADeviceBuiltinSurfaceTypeAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
2905 | static CUDADeviceBuiltinSurfaceTypeAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_device_builtin_surface_type); |
2906 | static CUDADeviceBuiltinSurfaceTypeAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_device_builtin_surface_type); |
2907 | |
2908 | // Constructors |
2909 | CUDADeviceBuiltinSurfaceTypeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
2910 | ); |
2911 | |
2912 | CUDADeviceBuiltinSurfaceTypeAttr *clone(ASTContext &C) const; |
2913 | void printPretty(raw_ostream &OS, |
2914 | const PrintingPolicy &Policy) const; |
2915 | const char *getSpelling() const; |
2916 | |
2917 | |
2918 | static bool classof(const Attr *A) { return A->getKind() == attr::CUDADeviceBuiltinSurfaceType; } |
2919 | }; |
2920 | |
2921 | class CUDADeviceBuiltinTextureTypeAttr : public InheritableAttr { |
2922 | public: |
2923 | enum Spelling { |
2924 | GNU_device_builtin_texture_type = 0, |
2925 | Declspec_device_builtin_texture_type = 1, |
2926 | SpellingNotCalculated = 15 |
2927 | |
2928 | }; |
2929 | |
2930 | // Factory methods |
2931 | static CUDADeviceBuiltinTextureTypeAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
2932 | static CUDADeviceBuiltinTextureTypeAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
2933 | static CUDADeviceBuiltinTextureTypeAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_device_builtin_texture_type); |
2934 | static CUDADeviceBuiltinTextureTypeAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_device_builtin_texture_type); |
2935 | |
2936 | // Constructors |
2937 | CUDADeviceBuiltinTextureTypeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
2938 | ); |
2939 | |
2940 | CUDADeviceBuiltinTextureTypeAttr *clone(ASTContext &C) const; |
2941 | void printPretty(raw_ostream &OS, |
2942 | const PrintingPolicy &Policy) const; |
2943 | const char *getSpelling() const; |
2944 | |
2945 | |
2946 | static bool classof(const Attr *A) { return A->getKind() == attr::CUDADeviceBuiltinTextureType; } |
2947 | }; |
2948 | |
2949 | class CUDAGlobalAttr : public InheritableAttr { |
2950 | public: |
2951 | enum Spelling { |
2952 | GNU_global = 0, |
2953 | Declspec_global = 1, |
2954 | SpellingNotCalculated = 15 |
2955 | |
2956 | }; |
2957 | |
2958 | // Factory methods |
2959 | static CUDAGlobalAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
2960 | static CUDAGlobalAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
2961 | static CUDAGlobalAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_global); |
2962 | static CUDAGlobalAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_global); |
2963 | |
2964 | // Constructors |
2965 | CUDAGlobalAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
2966 | ); |
2967 | |
2968 | CUDAGlobalAttr *clone(ASTContext &C) const; |
2969 | void printPretty(raw_ostream &OS, |
2970 | const PrintingPolicy &Policy) const; |
2971 | const char *getSpelling() const; |
2972 | |
2973 | |
2974 | static bool classof(const Attr *A) { return A->getKind() == attr::CUDAGlobal; } |
2975 | }; |
2976 | |
2977 | class CUDAHostAttr : public InheritableAttr { |
2978 | public: |
2979 | enum Spelling { |
2980 | GNU_host = 0, |
2981 | Declspec_host = 1, |
2982 | SpellingNotCalculated = 15 |
2983 | |
2984 | }; |
2985 | |
2986 | // Factory methods |
2987 | static CUDAHostAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
2988 | static CUDAHostAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
2989 | static CUDAHostAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_host); |
2990 | static CUDAHostAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_host); |
2991 | |
2992 | // Constructors |
2993 | CUDAHostAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
2994 | ); |
2995 | |
2996 | CUDAHostAttr *clone(ASTContext &C) const; |
2997 | void printPretty(raw_ostream &OS, |
2998 | const PrintingPolicy &Policy) const; |
2999 | const char *getSpelling() const; |
3000 | |
3001 | |
3002 | static bool classof(const Attr *A) { return A->getKind() == attr::CUDAHost; } |
3003 | }; |
3004 | |
3005 | class CUDAInvalidTargetAttr : public InheritableAttr { |
3006 | public: |
3007 | // Factory methods |
3008 | static CUDAInvalidTargetAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
3009 | static CUDAInvalidTargetAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
3010 | static CUDAInvalidTargetAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
3011 | static CUDAInvalidTargetAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
3012 | |
3013 | // Constructors |
3014 | CUDAInvalidTargetAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
3015 | ); |
3016 | |
3017 | CUDAInvalidTargetAttr *clone(ASTContext &C) const; |
3018 | void printPretty(raw_ostream &OS, |
3019 | const PrintingPolicy &Policy) const; |
3020 | const char *getSpelling() const; |
3021 | |
3022 | |
3023 | static bool classof(const Attr *A) { return A->getKind() == attr::CUDAInvalidTarget; } |
3024 | }; |
3025 | |
3026 | class CUDALaunchBoundsAttr : public InheritableAttr { |
3027 | Expr * maxThreads; |
3028 | |
3029 | Expr * minBlocks; |
3030 | |
3031 | Expr * maxBlocks; |
3032 | |
3033 | public: |
3034 | enum Spelling { |
3035 | GNU_launch_bounds = 0, |
3036 | Declspec_launch_bounds = 1, |
3037 | SpellingNotCalculated = 15 |
3038 | |
3039 | }; |
3040 | |
3041 | // Factory methods |
3042 | static CUDALaunchBoundsAttr *CreateImplicit(ASTContext &Ctx, Expr * MaxThreads, Expr * MinBlocks, Expr * MaxBlocks, const AttributeCommonInfo &CommonInfo); |
3043 | static CUDALaunchBoundsAttr *Create(ASTContext &Ctx, Expr * MaxThreads, Expr * MinBlocks, Expr * MaxBlocks, const AttributeCommonInfo &CommonInfo); |
3044 | static CUDALaunchBoundsAttr *CreateImplicit(ASTContext &Ctx, Expr * MaxThreads, Expr * MinBlocks, Expr * MaxBlocks, SourceRange Range = {}, Spelling S = GNU_launch_bounds); |
3045 | static CUDALaunchBoundsAttr *Create(ASTContext &Ctx, Expr * MaxThreads, Expr * MinBlocks, Expr * MaxBlocks, SourceRange Range = {}, Spelling S = GNU_launch_bounds); |
3046 | |
3047 | // Constructors |
3048 | CUDALaunchBoundsAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
3049 | , Expr * MaxThreads |
3050 | , Expr * MinBlocks |
3051 | , Expr * MaxBlocks |
3052 | ); |
3053 | CUDALaunchBoundsAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
3054 | , Expr * MaxThreads |
3055 | ); |
3056 | |
3057 | CUDALaunchBoundsAttr *clone(ASTContext &C) const; |
3058 | void printPretty(raw_ostream &OS, |
3059 | const PrintingPolicy &Policy) const; |
3060 | const char *getSpelling() const; |
3061 | Expr * getMaxThreads() const { |
3062 | return maxThreads; |
3063 | } |
3064 | |
3065 | Expr * getMinBlocks() const { |
3066 | return minBlocks; |
3067 | } |
3068 | |
3069 | Expr * getMaxBlocks() const { |
3070 | return maxBlocks; |
3071 | } |
3072 | |
3073 | |
3074 | |
3075 | static bool classof(const Attr *A) { return A->getKind() == attr::CUDALaunchBounds; } |
3076 | }; |
3077 | |
3078 | class CUDASharedAttr : public InheritableAttr { |
3079 | public: |
3080 | enum Spelling { |
3081 | GNU_shared = 0, |
3082 | Declspec_shared = 1, |
3083 | SpellingNotCalculated = 15 |
3084 | |
3085 | }; |
3086 | |
3087 | // Factory methods |
3088 | static CUDASharedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
3089 | static CUDASharedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
3090 | static CUDASharedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_shared); |
3091 | static CUDASharedAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_shared); |
3092 | |
3093 | // Constructors |
3094 | CUDASharedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
3095 | ); |
3096 | |
3097 | CUDASharedAttr *clone(ASTContext &C) const; |
3098 | void printPretty(raw_ostream &OS, |
3099 | const PrintingPolicy &Policy) const; |
3100 | const char *getSpelling() const; |
3101 | |
3102 | |
3103 | static bool classof(const Attr *A) { return A->getKind() == attr::CUDAShared; } |
3104 | }; |
3105 | |
3106 | class CXX11NoReturnAttr : public InheritableAttr { |
3107 | public: |
3108 | enum Spelling { |
3109 | CXX11_noreturn = 0, |
3110 | C23_noreturn = 1, |
3111 | C23_Noreturn = 2, |
3112 | SpellingNotCalculated = 15 |
3113 | |
3114 | }; |
3115 | |
3116 | // Factory methods |
3117 | static CXX11NoReturnAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
3118 | static CXX11NoReturnAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
3119 | static CXX11NoReturnAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = CXX11_noreturn); |
3120 | static CXX11NoReturnAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = CXX11_noreturn); |
3121 | |
3122 | // Constructors |
3123 | CXX11NoReturnAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
3124 | ); |
3125 | |
3126 | CXX11NoReturnAttr *clone(ASTContext &C) const; |
3127 | void printPretty(raw_ostream &OS, |
3128 | const PrintingPolicy &Policy) const; |
3129 | const char *getSpelling() const; |
3130 | Spelling getSemanticSpelling() const; |
3131 | |
3132 | |
3133 | static bool classof(const Attr *A) { return A->getKind() == attr::CXX11NoReturn; } |
3134 | }; |
3135 | |
3136 | class CXXAssumeAttr : public StmtAttr { |
3137 | Expr * assumption; |
3138 | |
3139 | public: |
3140 | enum Spelling { |
3141 | CXX11_assume = 0, |
3142 | GNU_assume = 1, |
3143 | CXX11_clang_assume = 2, |
3144 | C23_clang_assume = 3, |
3145 | SpellingNotCalculated = 15 |
3146 | |
3147 | }; |
3148 | |
3149 | // Factory methods |
3150 | static CXXAssumeAttr *CreateImplicit(ASTContext &Ctx, Expr * Assumption, const AttributeCommonInfo &CommonInfo); |
3151 | static CXXAssumeAttr *Create(ASTContext &Ctx, Expr * Assumption, const AttributeCommonInfo &CommonInfo); |
3152 | static CXXAssumeAttr *CreateImplicit(ASTContext &Ctx, Expr * Assumption, SourceRange Range = {}, Spelling S = CXX11_assume); |
3153 | static CXXAssumeAttr *Create(ASTContext &Ctx, Expr * Assumption, SourceRange Range = {}, Spelling S = CXX11_assume); |
3154 | |
3155 | // Constructors |
3156 | CXXAssumeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
3157 | , Expr * Assumption |
3158 | ); |
3159 | |
3160 | CXXAssumeAttr *clone(ASTContext &C) const; |
3161 | void printPretty(raw_ostream &OS, |
3162 | const PrintingPolicy &Policy) const; |
3163 | const char *getSpelling() const; |
3164 | Expr * getAssumption() const { |
3165 | return assumption; |
3166 | } |
3167 | |
3168 | |
3169 | |
3170 | static bool classof(const Attr *A) { return A->getKind() == attr::CXXAssume; } |
3171 | }; |
3172 | |
3173 | class CallableWhenAttr : public InheritableAttr { |
3174 | public: |
3175 | enum ConsumedState { |
3176 | Unknown, |
3177 | Consumed, |
3178 | Unconsumed |
3179 | }; |
3180 | private: |
3181 | unsigned callableStates_Size; |
3182 | ConsumedState *callableStates_; |
3183 | |
3184 | public: |
3185 | enum Spelling { |
3186 | GNU_callable_when = 0, |
3187 | CXX11_clang_callable_when = 1, |
3188 | SpellingNotCalculated = 15 |
3189 | |
3190 | }; |
3191 | |
3192 | // Factory methods |
3193 | static CallableWhenAttr *CreateImplicit(ASTContext &Ctx, ConsumedState *CallableStates, unsigned CallableStatesSize, const AttributeCommonInfo &CommonInfo); |
3194 | static CallableWhenAttr *Create(ASTContext &Ctx, ConsumedState *CallableStates, unsigned CallableStatesSize, const AttributeCommonInfo &CommonInfo); |
3195 | static CallableWhenAttr *CreateImplicit(ASTContext &Ctx, ConsumedState *CallableStates, unsigned CallableStatesSize, SourceRange Range = {}, Spelling S = GNU_callable_when); |
3196 | static CallableWhenAttr *Create(ASTContext &Ctx, ConsumedState *CallableStates, unsigned CallableStatesSize, SourceRange Range = {}, Spelling S = GNU_callable_when); |
3197 | |
3198 | // Constructors |
3199 | CallableWhenAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
3200 | , ConsumedState *CallableStates, unsigned CallableStatesSize |
3201 | ); |
3202 | CallableWhenAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
3203 | ); |
3204 | |
3205 | CallableWhenAttr *clone(ASTContext &C) const; |
3206 | void printPretty(raw_ostream &OS, |
3207 | const PrintingPolicy &Policy) const; |
3208 | const char *getSpelling() const; |
3209 | typedef ConsumedState* callableStates_iterator; |
3210 | callableStates_iterator callableStates_begin() const { return callableStates_; } |
3211 | callableStates_iterator callableStates_end() const { return callableStates_ + callableStates_Size; } |
3212 | unsigned callableStates_size() const { return callableStates_Size; } |
3213 | llvm::iterator_range<callableStates_iterator> callableStates() const { return llvm::make_range(x: callableStates_begin(), y: callableStates_end()); } |
3214 | |
3215 | |
3216 | static bool ConvertStrToConsumedState(StringRef Val, CallableWhenAttr::ConsumedState &Out); |
3217 | static const char *ConvertConsumedStateToStr(CallableWhenAttr::ConsumedState Val); |
3218 | |
3219 | |
3220 | static bool classof(const Attr *A) { return A->getKind() == attr::CallableWhen; } |
3221 | }; |
3222 | |
3223 | class CallbackAttr : public InheritableAttr { |
3224 | unsigned encoding_Size; |
3225 | int *encoding_; |
3226 | |
3227 | public: |
3228 | enum Spelling { |
3229 | GNU_callback = 0, |
3230 | CXX11_clang_callback = 1, |
3231 | C23_clang_callback = 2, |
3232 | SpellingNotCalculated = 15 |
3233 | |
3234 | }; |
3235 | |
3236 | // Factory methods |
3237 | static CallbackAttr *CreateImplicit(ASTContext &Ctx, int *Encoding, unsigned EncodingSize, const AttributeCommonInfo &CommonInfo); |
3238 | static CallbackAttr *Create(ASTContext &Ctx, int *Encoding, unsigned EncodingSize, const AttributeCommonInfo &CommonInfo); |
3239 | static CallbackAttr *CreateImplicit(ASTContext &Ctx, int *Encoding, unsigned EncodingSize, SourceRange Range = {}, Spelling S = GNU_callback); |
3240 | static CallbackAttr *Create(ASTContext &Ctx, int *Encoding, unsigned EncodingSize, SourceRange Range = {}, Spelling S = GNU_callback); |
3241 | |
3242 | // Constructors |
3243 | CallbackAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
3244 | , int *Encoding, unsigned EncodingSize |
3245 | ); |
3246 | CallbackAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
3247 | ); |
3248 | |
3249 | CallbackAttr *clone(ASTContext &C) const; |
3250 | void printPretty(raw_ostream &OS, |
3251 | const PrintingPolicy &Policy) const; |
3252 | const char *getSpelling() const; |
3253 | typedef int* encoding_iterator; |
3254 | encoding_iterator encoding_begin() const { return encoding_; } |
3255 | encoding_iterator encoding_end() const { return encoding_ + encoding_Size; } |
3256 | unsigned encoding_size() const { return encoding_Size; } |
3257 | llvm::iterator_range<encoding_iterator> encoding() const { return llvm::make_range(x: encoding_begin(), y: encoding_end()); } |
3258 | |
3259 | |
3260 | |
3261 | |
3262 | static bool classof(const Attr *A) { return A->getKind() == attr::Callback; } |
3263 | }; |
3264 | |
3265 | class CalledOnceAttr : public Attr { |
3266 | public: |
3267 | enum Spelling { |
3268 | GNU_called_once = 0, |
3269 | CXX11_clang_called_once = 1, |
3270 | C23_clang_called_once = 2, |
3271 | SpellingNotCalculated = 15 |
3272 | |
3273 | }; |
3274 | |
3275 | // Factory methods |
3276 | static CalledOnceAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
3277 | static CalledOnceAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
3278 | static CalledOnceAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_called_once); |
3279 | static CalledOnceAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_called_once); |
3280 | |
3281 | // Constructors |
3282 | CalledOnceAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
3283 | ); |
3284 | |
3285 | CalledOnceAttr *clone(ASTContext &C) const; |
3286 | void printPretty(raw_ostream &OS, |
3287 | const PrintingPolicy &Policy) const; |
3288 | const char *getSpelling() const; |
3289 | |
3290 | |
3291 | static bool classof(const Attr *A) { return A->getKind() == attr::CalledOnce; } |
3292 | }; |
3293 | |
3294 | class CapabilityAttr : public InheritableAttr { |
3295 | unsigned nameLength; |
3296 | char *name; |
3297 | |
3298 | public: |
3299 | enum Spelling { |
3300 | GNU_capability = 0, |
3301 | CXX11_clang_capability = 1, |
3302 | GNU_shared_capability = 2, |
3303 | CXX11_clang_shared_capability = 3, |
3304 | SpellingNotCalculated = 15 |
3305 | |
3306 | }; |
3307 | |
3308 | // Factory methods |
3309 | static CapabilityAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Name, const AttributeCommonInfo &CommonInfo); |
3310 | static CapabilityAttr *Create(ASTContext &Ctx, llvm::StringRef Name, const AttributeCommonInfo &CommonInfo); |
3311 | static CapabilityAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Name, SourceRange Range = {}, Spelling S = GNU_capability); |
3312 | static CapabilityAttr *Create(ASTContext &Ctx, llvm::StringRef Name, SourceRange Range = {}, Spelling S = GNU_capability); |
3313 | |
3314 | // Constructors |
3315 | CapabilityAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
3316 | , llvm::StringRef Name |
3317 | ); |
3318 | |
3319 | CapabilityAttr *clone(ASTContext &C) const; |
3320 | void printPretty(raw_ostream &OS, |
3321 | const PrintingPolicy &Policy) const; |
3322 | const char *getSpelling() const; |
3323 | Spelling getSemanticSpelling() const; |
3324 | bool isShared() const { return getAttributeSpellingListIndex() == 2 || |
3325 | getAttributeSpellingListIndex() == 3; } |
3326 | llvm::StringRef getName() const { |
3327 | return llvm::StringRef(name, nameLength); |
3328 | } |
3329 | unsigned getNameLength() const { |
3330 | return nameLength; |
3331 | } |
3332 | void setName(ASTContext &C, llvm::StringRef S) { |
3333 | nameLength = S.size(); |
3334 | this->name = new (C, 1) char [nameLength]; |
3335 | if (!S.empty()) |
3336 | std::memcpy(dest: this->name, src: S.data(), n: nameLength); |
3337 | } |
3338 | |
3339 | |
3340 | |
3341 | static bool classof(const Attr *A) { return A->getKind() == attr::Capability; } |
3342 | }; |
3343 | |
3344 | class CapturedRecordAttr : public InheritableAttr { |
3345 | public: |
3346 | // Factory methods |
3347 | static CapturedRecordAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
3348 | static CapturedRecordAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
3349 | static CapturedRecordAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
3350 | static CapturedRecordAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
3351 | |
3352 | // Constructors |
3353 | CapturedRecordAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
3354 | ); |
3355 | |
3356 | CapturedRecordAttr *clone(ASTContext &C) const; |
3357 | void printPretty(raw_ostream &OS, |
3358 | const PrintingPolicy &Policy) const; |
3359 | const char *getSpelling() const; |
3360 | |
3361 | |
3362 | static bool classof(const Attr *A) { return A->getKind() == attr::CapturedRecord; } |
3363 | }; |
3364 | |
3365 | class CarriesDependencyAttr : public InheritableParamAttr { |
3366 | public: |
3367 | enum Spelling { |
3368 | GNU_carries_dependency = 0, |
3369 | CXX11_carries_dependency = 1, |
3370 | SpellingNotCalculated = 15 |
3371 | |
3372 | }; |
3373 | |
3374 | // Factory methods |
3375 | static CarriesDependencyAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
3376 | static CarriesDependencyAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
3377 | static CarriesDependencyAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_carries_dependency); |
3378 | static CarriesDependencyAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_carries_dependency); |
3379 | |
3380 | // Constructors |
3381 | CarriesDependencyAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
3382 | ); |
3383 | |
3384 | CarriesDependencyAttr *clone(ASTContext &C) const; |
3385 | void printPretty(raw_ostream &OS, |
3386 | const PrintingPolicy &Policy) const; |
3387 | const char *getSpelling() const; |
3388 | |
3389 | |
3390 | static bool classof(const Attr *A) { return A->getKind() == attr::CarriesDependency; } |
3391 | }; |
3392 | |
3393 | class CleanupAttr : public InheritableAttr { |
3394 | FunctionDecl * functionDecl; |
3395 | |
3396 | public: |
3397 | enum Spelling { |
3398 | GNU_cleanup = 0, |
3399 | CXX11_gnu_cleanup = 1, |
3400 | C23_gnu_cleanup = 2, |
3401 | SpellingNotCalculated = 15 |
3402 | |
3403 | }; |
3404 | |
3405 | // Factory methods |
3406 | static CleanupAttr *CreateImplicit(ASTContext &Ctx, FunctionDecl * FunctionDecl, const AttributeCommonInfo &CommonInfo); |
3407 | static CleanupAttr *Create(ASTContext &Ctx, FunctionDecl * FunctionDecl, const AttributeCommonInfo &CommonInfo); |
3408 | static CleanupAttr *CreateImplicit(ASTContext &Ctx, FunctionDecl * FunctionDecl, SourceRange Range = {}, Spelling S = GNU_cleanup); |
3409 | static CleanupAttr *Create(ASTContext &Ctx, FunctionDecl * FunctionDecl, SourceRange Range = {}, Spelling S = GNU_cleanup); |
3410 | |
3411 | // Constructors |
3412 | CleanupAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
3413 | , FunctionDecl * FunctionDecl |
3414 | ); |
3415 | |
3416 | CleanupAttr *clone(ASTContext &C) const; |
3417 | void printPretty(raw_ostream &OS, |
3418 | const PrintingPolicy &Policy) const; |
3419 | const char *getSpelling() const; |
3420 | FunctionDecl * getFunctionDecl() const { |
3421 | return functionDecl; |
3422 | } |
3423 | |
3424 | |
3425 | |
3426 | static bool classof(const Attr *A) { return A->getKind() == attr::Cleanup; } |
3427 | }; |
3428 | |
3429 | class ClspvLibclcBuiltinAttr : public InheritableAttr { |
3430 | public: |
3431 | enum Spelling { |
3432 | GNU_clspv_libclc_builtin = 0, |
3433 | CXX11_clang_clspv_libclc_builtin = 1, |
3434 | C23_clang_clspv_libclc_builtin = 2, |
3435 | SpellingNotCalculated = 15 |
3436 | |
3437 | }; |
3438 | |
3439 | // Factory methods |
3440 | static ClspvLibclcBuiltinAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
3441 | static ClspvLibclcBuiltinAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
3442 | static ClspvLibclcBuiltinAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_clspv_libclc_builtin); |
3443 | static ClspvLibclcBuiltinAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_clspv_libclc_builtin); |
3444 | |
3445 | // Constructors |
3446 | ClspvLibclcBuiltinAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
3447 | ); |
3448 | |
3449 | ClspvLibclcBuiltinAttr *clone(ASTContext &C) const; |
3450 | void printPretty(raw_ostream &OS, |
3451 | const PrintingPolicy &Policy) const; |
3452 | const char *getSpelling() const; |
3453 | |
3454 | |
3455 | static bool classof(const Attr *A) { return A->getKind() == attr::ClspvLibclcBuiltin; } |
3456 | }; |
3457 | |
3458 | class CmseNSCallAttr : public TypeAttr { |
3459 | public: |
3460 | // Factory methods |
3461 | static CmseNSCallAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
3462 | static CmseNSCallAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
3463 | static CmseNSCallAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
3464 | static CmseNSCallAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
3465 | |
3466 | // Constructors |
3467 | CmseNSCallAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
3468 | ); |
3469 | |
3470 | CmseNSCallAttr *clone(ASTContext &C) const; |
3471 | void printPretty(raw_ostream &OS, |
3472 | const PrintingPolicy &Policy) const; |
3473 | const char *getSpelling() const; |
3474 | |
3475 | |
3476 | static bool classof(const Attr *A) { return A->getKind() == attr::CmseNSCall; } |
3477 | }; |
3478 | |
3479 | class CmseNSEntryAttr : public InheritableAttr { |
3480 | public: |
3481 | // Factory methods |
3482 | static CmseNSEntryAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
3483 | static CmseNSEntryAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
3484 | static CmseNSEntryAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
3485 | static CmseNSEntryAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
3486 | |
3487 | // Constructors |
3488 | CmseNSEntryAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
3489 | ); |
3490 | |
3491 | CmseNSEntryAttr *clone(ASTContext &C) const; |
3492 | void printPretty(raw_ostream &OS, |
3493 | const PrintingPolicy &Policy) const; |
3494 | const char *getSpelling() const; |
3495 | |
3496 | |
3497 | static bool classof(const Attr *A) { return A->getKind() == attr::CmseNSEntry; } |
3498 | }; |
3499 | |
3500 | class CodeAlignAttr : public StmtAttr { |
3501 | Expr * alignment; |
3502 | |
3503 | public: |
3504 | enum Spelling { |
3505 | GNU_code_align = 0, |
3506 | CXX11_clang_code_align = 1, |
3507 | C23_clang_code_align = 2, |
3508 | SpellingNotCalculated = 15 |
3509 | |
3510 | }; |
3511 | |
3512 | // Factory methods |
3513 | static CodeAlignAttr *CreateImplicit(ASTContext &Ctx, Expr * Alignment, const AttributeCommonInfo &CommonInfo); |
3514 | static CodeAlignAttr *Create(ASTContext &Ctx, Expr * Alignment, const AttributeCommonInfo &CommonInfo); |
3515 | static CodeAlignAttr *CreateImplicit(ASTContext &Ctx, Expr * Alignment, SourceRange Range = {}, Spelling S = GNU_code_align); |
3516 | static CodeAlignAttr *Create(ASTContext &Ctx, Expr * Alignment, SourceRange Range = {}, Spelling S = GNU_code_align); |
3517 | |
3518 | // Constructors |
3519 | CodeAlignAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
3520 | , Expr * Alignment |
3521 | ); |
3522 | |
3523 | CodeAlignAttr *clone(ASTContext &C) const; |
3524 | void printPretty(raw_ostream &OS, |
3525 | const PrintingPolicy &Policy) const; |
3526 | const char *getSpelling() const; |
3527 | Expr * getAlignment() const { |
3528 | return alignment; |
3529 | } |
3530 | |
3531 | |
3532 | static constexpr int MinimumAlignment = 1; |
3533 | static constexpr int MaximumAlignment = 4096; |
3534 | |
3535 | |
3536 | static bool classof(const Attr *A) { return A->getKind() == attr::CodeAlign; } |
3537 | }; |
3538 | |
3539 | class CodeModelAttr : public InheritableAttr { |
3540 | private: |
3541 | llvm::CodeModel::Model model; |
3542 | |
3543 | public: |
3544 | enum Spelling { |
3545 | GNU_model = 0, |
3546 | CXX11_gnu_model = 1, |
3547 | C23_gnu_model = 2, |
3548 | SpellingNotCalculated = 15 |
3549 | |
3550 | }; |
3551 | |
3552 | // Factory methods |
3553 | static CodeModelAttr *CreateImplicit(ASTContext &Ctx, llvm::CodeModel::Model Model, const AttributeCommonInfo &CommonInfo); |
3554 | static CodeModelAttr *Create(ASTContext &Ctx, llvm::CodeModel::Model Model, const AttributeCommonInfo &CommonInfo); |
3555 | static CodeModelAttr *CreateImplicit(ASTContext &Ctx, llvm::CodeModel::Model Model, SourceRange Range = {}, Spelling S = GNU_model); |
3556 | static CodeModelAttr *Create(ASTContext &Ctx, llvm::CodeModel::Model Model, SourceRange Range = {}, Spelling S = GNU_model); |
3557 | |
3558 | // Constructors |
3559 | CodeModelAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
3560 | , llvm::CodeModel::Model Model |
3561 | ); |
3562 | |
3563 | CodeModelAttr *clone(ASTContext &C) const; |
3564 | void printPretty(raw_ostream &OS, |
3565 | const PrintingPolicy &Policy) const; |
3566 | const char *getSpelling() const; |
3567 | llvm::CodeModel::Model getModel() const { |
3568 | return model; |
3569 | } |
3570 | |
3571 | static bool ConvertStrToModel(StringRef Val, llvm::CodeModel::Model &Out); |
3572 | static const char *ConvertModelToStr(llvm::CodeModel::Model Val); |
3573 | |
3574 | |
3575 | static bool classof(const Attr *A) { return A->getKind() == attr::CodeModel; } |
3576 | }; |
3577 | |
3578 | class CodeSegAttr : public InheritableAttr { |
3579 | unsigned nameLength; |
3580 | char *name; |
3581 | |
3582 | public: |
3583 | // Factory methods |
3584 | static CodeSegAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Name, const AttributeCommonInfo &CommonInfo); |
3585 | static CodeSegAttr *Create(ASTContext &Ctx, llvm::StringRef Name, const AttributeCommonInfo &CommonInfo); |
3586 | static CodeSegAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Name, SourceRange Range = {}); |
3587 | static CodeSegAttr *Create(ASTContext &Ctx, llvm::StringRef Name, SourceRange Range = {}); |
3588 | |
3589 | // Constructors |
3590 | CodeSegAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
3591 | , llvm::StringRef Name |
3592 | ); |
3593 | |
3594 | CodeSegAttr *clone(ASTContext &C) const; |
3595 | void printPretty(raw_ostream &OS, |
3596 | const PrintingPolicy &Policy) const; |
3597 | const char *getSpelling() const; |
3598 | llvm::StringRef getName() const { |
3599 | return llvm::StringRef(name, nameLength); |
3600 | } |
3601 | unsigned getNameLength() const { |
3602 | return nameLength; |
3603 | } |
3604 | void setName(ASTContext &C, llvm::StringRef S) { |
3605 | nameLength = S.size(); |
3606 | this->name = new (C, 1) char [nameLength]; |
3607 | if (!S.empty()) |
3608 | std::memcpy(dest: this->name, src: S.data(), n: nameLength); |
3609 | } |
3610 | |
3611 | |
3612 | |
3613 | static bool classof(const Attr *A) { return A->getKind() == attr::CodeSeg; } |
3614 | }; |
3615 | |
3616 | class ColdAttr : public InheritableAttr { |
3617 | public: |
3618 | enum Spelling { |
3619 | GNU_cold = 0, |
3620 | CXX11_gnu_cold = 1, |
3621 | C23_gnu_cold = 2, |
3622 | SpellingNotCalculated = 15 |
3623 | |
3624 | }; |
3625 | |
3626 | // Factory methods |
3627 | static ColdAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
3628 | static ColdAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
3629 | static ColdAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_cold); |
3630 | static ColdAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_cold); |
3631 | |
3632 | // Constructors |
3633 | ColdAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
3634 | ); |
3635 | |
3636 | ColdAttr *clone(ASTContext &C) const; |
3637 | void printPretty(raw_ostream &OS, |
3638 | const PrintingPolicy &Policy) const; |
3639 | const char *getSpelling() const; |
3640 | |
3641 | |
3642 | static bool classof(const Attr *A) { return A->getKind() == attr::Cold; } |
3643 | }; |
3644 | |
3645 | class CommonAttr : public InheritableAttr { |
3646 | public: |
3647 | enum Spelling { |
3648 | GNU_common = 0, |
3649 | CXX11_gnu_common = 1, |
3650 | C23_gnu_common = 2, |
3651 | SpellingNotCalculated = 15 |
3652 | |
3653 | }; |
3654 | |
3655 | // Factory methods |
3656 | static CommonAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
3657 | static CommonAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
3658 | static CommonAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_common); |
3659 | static CommonAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_common); |
3660 | |
3661 | // Constructors |
3662 | CommonAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
3663 | ); |
3664 | |
3665 | CommonAttr *clone(ASTContext &C) const; |
3666 | void printPretty(raw_ostream &OS, |
3667 | const PrintingPolicy &Policy) const; |
3668 | const char *getSpelling() const; |
3669 | |
3670 | |
3671 | static bool classof(const Attr *A) { return A->getKind() == attr::Common; } |
3672 | }; |
3673 | |
3674 | class ConstAttr : public InheritableAttr { |
3675 | public: |
3676 | enum Spelling { |
3677 | GNU_const = 0, |
3678 | CXX11_gnu_const = 1, |
3679 | C23_gnu_const = 2, |
3680 | SpellingNotCalculated = 15 |
3681 | |
3682 | }; |
3683 | |
3684 | // Factory methods |
3685 | static ConstAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
3686 | static ConstAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
3687 | static ConstAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_const); |
3688 | static ConstAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_const); |
3689 | |
3690 | // Constructors |
3691 | ConstAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
3692 | ); |
3693 | |
3694 | ConstAttr *clone(ASTContext &C) const; |
3695 | void printPretty(raw_ostream &OS, |
3696 | const PrintingPolicy &Policy) const; |
3697 | const char *getSpelling() const; |
3698 | |
3699 | |
3700 | static bool classof(const Attr *A) { return A->getKind() == attr::Const; } |
3701 | }; |
3702 | |
3703 | class ConstInitAttr : public InheritableAttr { |
3704 | public: |
3705 | enum Spelling { |
3706 | Keyword_constinit = 0, |
3707 | GNU_require_constant_initialization = 1, |
3708 | CXX11_clang_require_constant_initialization = 2, |
3709 | SpellingNotCalculated = 15 |
3710 | |
3711 | }; |
3712 | |
3713 | // Factory methods |
3714 | static ConstInitAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
3715 | static ConstInitAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
3716 | static ConstInitAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = Keyword_constinit); |
3717 | static ConstInitAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = Keyword_constinit); |
3718 | |
3719 | // Constructors |
3720 | ConstInitAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
3721 | ); |
3722 | |
3723 | ConstInitAttr *clone(ASTContext &C) const; |
3724 | void printPretty(raw_ostream &OS, |
3725 | const PrintingPolicy &Policy) const; |
3726 | const char *getSpelling() const; |
3727 | Spelling getSemanticSpelling() const; |
3728 | bool isConstinit() const { return getAttributeSpellingListIndex() == 0; } |
3729 | |
3730 | |
3731 | static bool classof(const Attr *A) { return A->getKind() == attr::ConstInit; } |
3732 | }; |
3733 | |
3734 | class ConstructorAttr : public InheritableAttr { |
3735 | int priority; |
3736 | |
3737 | public: |
3738 | enum Spelling { |
3739 | GNU_constructor = 0, |
3740 | CXX11_gnu_constructor = 1, |
3741 | C23_gnu_constructor = 2, |
3742 | SpellingNotCalculated = 15 |
3743 | |
3744 | }; |
3745 | |
3746 | // Factory methods |
3747 | static ConstructorAttr *CreateImplicit(ASTContext &Ctx, int Priority, const AttributeCommonInfo &CommonInfo); |
3748 | static ConstructorAttr *Create(ASTContext &Ctx, int Priority, const AttributeCommonInfo &CommonInfo); |
3749 | static ConstructorAttr *CreateImplicit(ASTContext &Ctx, int Priority, SourceRange Range = {}, Spelling S = GNU_constructor); |
3750 | static ConstructorAttr *Create(ASTContext &Ctx, int Priority, SourceRange Range = {}, Spelling S = GNU_constructor); |
3751 | |
3752 | // Constructors |
3753 | ConstructorAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
3754 | , int Priority |
3755 | ); |
3756 | ConstructorAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
3757 | ); |
3758 | |
3759 | ConstructorAttr *clone(ASTContext &C) const; |
3760 | void printPretty(raw_ostream &OS, |
3761 | const PrintingPolicy &Policy) const; |
3762 | const char *getSpelling() const; |
3763 | int getPriority() const { |
3764 | return priority; |
3765 | } |
3766 | |
3767 | static const int DefaultPriority = 65535; |
3768 | |
3769 | |
3770 | |
3771 | static bool classof(const Attr *A) { return A->getKind() == attr::Constructor; } |
3772 | }; |
3773 | |
3774 | class ConsumableAttr : public InheritableAttr { |
3775 | public: |
3776 | enum ConsumedState { |
3777 | Unknown, |
3778 | Consumed, |
3779 | Unconsumed |
3780 | }; |
3781 | private: |
3782 | ConsumableAttr::ConsumedState defaultState; |
3783 | |
3784 | public: |
3785 | enum Spelling { |
3786 | GNU_consumable = 0, |
3787 | CXX11_clang_consumable = 1, |
3788 | SpellingNotCalculated = 15 |
3789 | |
3790 | }; |
3791 | |
3792 | // Factory methods |
3793 | static ConsumableAttr *CreateImplicit(ASTContext &Ctx, ConsumableAttr::ConsumedState DefaultState, const AttributeCommonInfo &CommonInfo); |
3794 | static ConsumableAttr *Create(ASTContext &Ctx, ConsumableAttr::ConsumedState DefaultState, const AttributeCommonInfo &CommonInfo); |
3795 | static ConsumableAttr *CreateImplicit(ASTContext &Ctx, ConsumableAttr::ConsumedState DefaultState, SourceRange Range = {}, Spelling S = GNU_consumable); |
3796 | static ConsumableAttr *Create(ASTContext &Ctx, ConsumableAttr::ConsumedState DefaultState, SourceRange Range = {}, Spelling S = GNU_consumable); |
3797 | |
3798 | // Constructors |
3799 | ConsumableAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
3800 | , ConsumableAttr::ConsumedState DefaultState |
3801 | ); |
3802 | |
3803 | ConsumableAttr *clone(ASTContext &C) const; |
3804 | void printPretty(raw_ostream &OS, |
3805 | const PrintingPolicy &Policy) const; |
3806 | const char *getSpelling() const; |
3807 | ConsumableAttr::ConsumedState getDefaultState() const { |
3808 | return defaultState; |
3809 | } |
3810 | |
3811 | static bool ConvertStrToConsumedState(StringRef Val, ConsumableAttr::ConsumedState &Out); |
3812 | static const char *ConvertConsumedStateToStr(ConsumableAttr::ConsumedState Val); |
3813 | |
3814 | |
3815 | static bool classof(const Attr *A) { return A->getKind() == attr::Consumable; } |
3816 | }; |
3817 | |
3818 | class ConsumableAutoCastAttr : public InheritableAttr { |
3819 | public: |
3820 | enum Spelling { |
3821 | GNU_consumable_auto_cast_state = 0, |
3822 | CXX11_clang_consumable_auto_cast_state = 1, |
3823 | SpellingNotCalculated = 15 |
3824 | |
3825 | }; |
3826 | |
3827 | // Factory methods |
3828 | static ConsumableAutoCastAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
3829 | static ConsumableAutoCastAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
3830 | static ConsumableAutoCastAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_consumable_auto_cast_state); |
3831 | static ConsumableAutoCastAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_consumable_auto_cast_state); |
3832 | |
3833 | // Constructors |
3834 | ConsumableAutoCastAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
3835 | ); |
3836 | |
3837 | ConsumableAutoCastAttr *clone(ASTContext &C) const; |
3838 | void printPretty(raw_ostream &OS, |
3839 | const PrintingPolicy &Policy) const; |
3840 | const char *getSpelling() const; |
3841 | |
3842 | |
3843 | static bool classof(const Attr *A) { return A->getKind() == attr::ConsumableAutoCast; } |
3844 | }; |
3845 | |
3846 | class ConsumableSetOnReadAttr : public InheritableAttr { |
3847 | public: |
3848 | enum Spelling { |
3849 | GNU_consumable_set_state_on_read = 0, |
3850 | CXX11_clang_consumable_set_state_on_read = 1, |
3851 | SpellingNotCalculated = 15 |
3852 | |
3853 | }; |
3854 | |
3855 | // Factory methods |
3856 | static ConsumableSetOnReadAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
3857 | static ConsumableSetOnReadAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
3858 | static ConsumableSetOnReadAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_consumable_set_state_on_read); |
3859 | static ConsumableSetOnReadAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_consumable_set_state_on_read); |
3860 | |
3861 | // Constructors |
3862 | ConsumableSetOnReadAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
3863 | ); |
3864 | |
3865 | ConsumableSetOnReadAttr *clone(ASTContext &C) const; |
3866 | void printPretty(raw_ostream &OS, |
3867 | const PrintingPolicy &Policy) const; |
3868 | const char *getSpelling() const; |
3869 | |
3870 | |
3871 | static bool classof(const Attr *A) { return A->getKind() == attr::ConsumableSetOnRead; } |
3872 | }; |
3873 | |
3874 | class ConvergentAttr : public InheritableAttr { |
3875 | public: |
3876 | enum Spelling { |
3877 | GNU_convergent = 0, |
3878 | CXX11_clang_convergent = 1, |
3879 | C23_clang_convergent = 2, |
3880 | SpellingNotCalculated = 15 |
3881 | |
3882 | }; |
3883 | |
3884 | // Factory methods |
3885 | static ConvergentAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
3886 | static ConvergentAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
3887 | static ConvergentAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_convergent); |
3888 | static ConvergentAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_convergent); |
3889 | |
3890 | // Constructors |
3891 | ConvergentAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
3892 | ); |
3893 | |
3894 | ConvergentAttr *clone(ASTContext &C) const; |
3895 | void printPretty(raw_ostream &OS, |
3896 | const PrintingPolicy &Policy) const; |
3897 | const char *getSpelling() const; |
3898 | |
3899 | |
3900 | static bool classof(const Attr *A) { return A->getKind() == attr::Convergent; } |
3901 | }; |
3902 | |
3903 | class CoroDisableLifetimeBoundAttr : public InheritableAttr { |
3904 | public: |
3905 | enum Spelling { |
3906 | GNU_coro_disable_lifetimebound = 0, |
3907 | CXX11_clang_coro_disable_lifetimebound = 1, |
3908 | C23_clang_coro_disable_lifetimebound = 2, |
3909 | SpellingNotCalculated = 15 |
3910 | |
3911 | }; |
3912 | |
3913 | // Factory methods |
3914 | static CoroDisableLifetimeBoundAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
3915 | static CoroDisableLifetimeBoundAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
3916 | static CoroDisableLifetimeBoundAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_coro_disable_lifetimebound); |
3917 | static CoroDisableLifetimeBoundAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_coro_disable_lifetimebound); |
3918 | |
3919 | // Constructors |
3920 | CoroDisableLifetimeBoundAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
3921 | ); |
3922 | |
3923 | CoroDisableLifetimeBoundAttr *clone(ASTContext &C) const; |
3924 | void printPretty(raw_ostream &OS, |
3925 | const PrintingPolicy &Policy) const; |
3926 | const char *getSpelling() const; |
3927 | |
3928 | |
3929 | static bool classof(const Attr *A) { return A->getKind() == attr::CoroDisableLifetimeBound; } |
3930 | }; |
3931 | |
3932 | class CoroLifetimeBoundAttr : public InheritableAttr { |
3933 | public: |
3934 | enum Spelling { |
3935 | GNU_coro_lifetimebound = 0, |
3936 | CXX11_clang_coro_lifetimebound = 1, |
3937 | C23_clang_coro_lifetimebound = 2, |
3938 | SpellingNotCalculated = 15 |
3939 | |
3940 | }; |
3941 | |
3942 | // Factory methods |
3943 | static CoroLifetimeBoundAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
3944 | static CoroLifetimeBoundAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
3945 | static CoroLifetimeBoundAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_coro_lifetimebound); |
3946 | static CoroLifetimeBoundAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_coro_lifetimebound); |
3947 | |
3948 | // Constructors |
3949 | CoroLifetimeBoundAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
3950 | ); |
3951 | |
3952 | CoroLifetimeBoundAttr *clone(ASTContext &C) const; |
3953 | void printPretty(raw_ostream &OS, |
3954 | const PrintingPolicy &Policy) const; |
3955 | const char *getSpelling() const; |
3956 | |
3957 | |
3958 | static bool classof(const Attr *A) { return A->getKind() == attr::CoroLifetimeBound; } |
3959 | }; |
3960 | |
3961 | class CoroOnlyDestroyWhenCompleteAttr : public InheritableAttr { |
3962 | public: |
3963 | enum Spelling { |
3964 | GNU_coro_only_destroy_when_complete = 0, |
3965 | CXX11_clang_coro_only_destroy_when_complete = 1, |
3966 | C23_clang_coro_only_destroy_when_complete = 2, |
3967 | SpellingNotCalculated = 15 |
3968 | |
3969 | }; |
3970 | |
3971 | // Factory methods |
3972 | static CoroOnlyDestroyWhenCompleteAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
3973 | static CoroOnlyDestroyWhenCompleteAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
3974 | static CoroOnlyDestroyWhenCompleteAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_coro_only_destroy_when_complete); |
3975 | static CoroOnlyDestroyWhenCompleteAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_coro_only_destroy_when_complete); |
3976 | |
3977 | // Constructors |
3978 | CoroOnlyDestroyWhenCompleteAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
3979 | ); |
3980 | |
3981 | CoroOnlyDestroyWhenCompleteAttr *clone(ASTContext &C) const; |
3982 | void printPretty(raw_ostream &OS, |
3983 | const PrintingPolicy &Policy) const; |
3984 | const char *getSpelling() const; |
3985 | |
3986 | |
3987 | static bool classof(const Attr *A) { return A->getKind() == attr::CoroOnlyDestroyWhenComplete; } |
3988 | }; |
3989 | |
3990 | class CoroReturnTypeAttr : public InheritableAttr { |
3991 | public: |
3992 | enum Spelling { |
3993 | GNU_coro_return_type = 0, |
3994 | CXX11_clang_coro_return_type = 1, |
3995 | C23_clang_coro_return_type = 2, |
3996 | SpellingNotCalculated = 15 |
3997 | |
3998 | }; |
3999 | |
4000 | // Factory methods |
4001 | static CoroReturnTypeAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
4002 | static CoroReturnTypeAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
4003 | static CoroReturnTypeAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_coro_return_type); |
4004 | static CoroReturnTypeAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_coro_return_type); |
4005 | |
4006 | // Constructors |
4007 | CoroReturnTypeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
4008 | ); |
4009 | |
4010 | CoroReturnTypeAttr *clone(ASTContext &C) const; |
4011 | void printPretty(raw_ostream &OS, |
4012 | const PrintingPolicy &Policy) const; |
4013 | const char *getSpelling() const; |
4014 | |
4015 | |
4016 | static bool classof(const Attr *A) { return A->getKind() == attr::CoroReturnType; } |
4017 | }; |
4018 | |
4019 | class CoroWrapperAttr : public InheritableAttr { |
4020 | public: |
4021 | enum Spelling { |
4022 | GNU_coro_wrapper = 0, |
4023 | CXX11_clang_coro_wrapper = 1, |
4024 | C23_clang_coro_wrapper = 2, |
4025 | SpellingNotCalculated = 15 |
4026 | |
4027 | }; |
4028 | |
4029 | // Factory methods |
4030 | static CoroWrapperAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
4031 | static CoroWrapperAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
4032 | static CoroWrapperAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_coro_wrapper); |
4033 | static CoroWrapperAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_coro_wrapper); |
4034 | |
4035 | // Constructors |
4036 | CoroWrapperAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
4037 | ); |
4038 | |
4039 | CoroWrapperAttr *clone(ASTContext &C) const; |
4040 | void printPretty(raw_ostream &OS, |
4041 | const PrintingPolicy &Policy) const; |
4042 | const char *getSpelling() const; |
4043 | |
4044 | |
4045 | static bool classof(const Attr *A) { return A->getKind() == attr::CoroWrapper; } |
4046 | }; |
4047 | |
4048 | class CountedByAttr : public InheritableAttr { |
4049 | Expr * count; |
4050 | |
4051 | int nestedLevel; |
4052 | |
4053 | public: |
4054 | enum Spelling { |
4055 | GNU_counted_by = 0, |
4056 | CXX11_clang_counted_by = 1, |
4057 | C23_clang_counted_by = 2, |
4058 | SpellingNotCalculated = 15 |
4059 | |
4060 | }; |
4061 | |
4062 | // Factory methods |
4063 | static CountedByAttr *CreateImplicit(ASTContext &Ctx, Expr * Count, int NestedLevel, const AttributeCommonInfo &CommonInfo); |
4064 | static CountedByAttr *Create(ASTContext &Ctx, Expr * Count, int NestedLevel, const AttributeCommonInfo &CommonInfo); |
4065 | static CountedByAttr *CreateImplicit(ASTContext &Ctx, Expr * Count, int NestedLevel, SourceRange Range = {}, Spelling S = GNU_counted_by); |
4066 | static CountedByAttr *Create(ASTContext &Ctx, Expr * Count, int NestedLevel, SourceRange Range = {}, Spelling S = GNU_counted_by); |
4067 | |
4068 | // Constructors |
4069 | CountedByAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
4070 | , Expr * Count |
4071 | , int NestedLevel |
4072 | ); |
4073 | CountedByAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
4074 | , Expr * Count |
4075 | ); |
4076 | |
4077 | CountedByAttr *clone(ASTContext &C) const; |
4078 | void printPretty(raw_ostream &OS, |
4079 | const PrintingPolicy &Policy) const; |
4080 | const char *getSpelling() const; |
4081 | Expr * getCount() const { |
4082 | return count; |
4083 | } |
4084 | |
4085 | int getNestedLevel() const { |
4086 | return nestedLevel; |
4087 | } |
4088 | |
4089 | |
4090 | |
4091 | static bool classof(const Attr *A) { return A->getKind() == attr::CountedBy; } |
4092 | }; |
4093 | |
4094 | class CountedByOrNullAttr : public InheritableAttr { |
4095 | Expr * count; |
4096 | |
4097 | int nestedLevel; |
4098 | |
4099 | public: |
4100 | enum Spelling { |
4101 | GNU_counted_by_or_null = 0, |
4102 | CXX11_clang_counted_by_or_null = 1, |
4103 | C23_clang_counted_by_or_null = 2, |
4104 | SpellingNotCalculated = 15 |
4105 | |
4106 | }; |
4107 | |
4108 | // Factory methods |
4109 | static CountedByOrNullAttr *CreateImplicit(ASTContext &Ctx, Expr * Count, int NestedLevel, const AttributeCommonInfo &CommonInfo); |
4110 | static CountedByOrNullAttr *Create(ASTContext &Ctx, Expr * Count, int NestedLevel, const AttributeCommonInfo &CommonInfo); |
4111 | static CountedByOrNullAttr *CreateImplicit(ASTContext &Ctx, Expr * Count, int NestedLevel, SourceRange Range = {}, Spelling S = GNU_counted_by_or_null); |
4112 | static CountedByOrNullAttr *Create(ASTContext &Ctx, Expr * Count, int NestedLevel, SourceRange Range = {}, Spelling S = GNU_counted_by_or_null); |
4113 | |
4114 | // Constructors |
4115 | CountedByOrNullAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
4116 | , Expr * Count |
4117 | , int NestedLevel |
4118 | ); |
4119 | CountedByOrNullAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
4120 | , Expr * Count |
4121 | ); |
4122 | |
4123 | CountedByOrNullAttr *clone(ASTContext &C) const; |
4124 | void printPretty(raw_ostream &OS, |
4125 | const PrintingPolicy &Policy) const; |
4126 | const char *getSpelling() const; |
4127 | Expr * getCount() const { |
4128 | return count; |
4129 | } |
4130 | |
4131 | int getNestedLevel() const { |
4132 | return nestedLevel; |
4133 | } |
4134 | |
4135 | |
4136 | |
4137 | static bool classof(const Attr *A) { return A->getKind() == attr::CountedByOrNull; } |
4138 | }; |
4139 | |
4140 | class DLLExportAttr : public InheritableAttr { |
4141 | public: |
4142 | enum Spelling { |
4143 | Declspec_dllexport = 0, |
4144 | GNU_dllexport = 1, |
4145 | CXX11_gnu_dllexport = 2, |
4146 | C23_gnu_dllexport = 3, |
4147 | SpellingNotCalculated = 15 |
4148 | |
4149 | }; |
4150 | |
4151 | // Factory methods |
4152 | static DLLExportAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
4153 | static DLLExportAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
4154 | static DLLExportAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = Declspec_dllexport); |
4155 | static DLLExportAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = Declspec_dllexport); |
4156 | |
4157 | // Constructors |
4158 | DLLExportAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
4159 | ); |
4160 | |
4161 | DLLExportAttr *clone(ASTContext &C) const; |
4162 | void printPretty(raw_ostream &OS, |
4163 | const PrintingPolicy &Policy) const; |
4164 | const char *getSpelling() const; |
4165 | |
4166 | |
4167 | static bool classof(const Attr *A) { return A->getKind() == attr::DLLExport; } |
4168 | }; |
4169 | |
4170 | class DLLExportStaticLocalAttr : public InheritableAttr { |
4171 | public: |
4172 | // Factory methods |
4173 | static DLLExportStaticLocalAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
4174 | static DLLExportStaticLocalAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
4175 | static DLLExportStaticLocalAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
4176 | static DLLExportStaticLocalAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
4177 | |
4178 | // Constructors |
4179 | DLLExportStaticLocalAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
4180 | ); |
4181 | |
4182 | DLLExportStaticLocalAttr *clone(ASTContext &C) const; |
4183 | void printPretty(raw_ostream &OS, |
4184 | const PrintingPolicy &Policy) const; |
4185 | const char *getSpelling() const; |
4186 | |
4187 | |
4188 | static bool classof(const Attr *A) { return A->getKind() == attr::DLLExportStaticLocal; } |
4189 | }; |
4190 | |
4191 | class DLLImportAttr : public InheritableAttr { |
4192 | public: |
4193 | enum Spelling { |
4194 | Declspec_dllimport = 0, |
4195 | GNU_dllimport = 1, |
4196 | CXX11_gnu_dllimport = 2, |
4197 | C23_gnu_dllimport = 3, |
4198 | SpellingNotCalculated = 15 |
4199 | |
4200 | }; |
4201 | |
4202 | // Factory methods |
4203 | static DLLImportAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
4204 | static DLLImportAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
4205 | static DLLImportAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = Declspec_dllimport); |
4206 | static DLLImportAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = Declspec_dllimport); |
4207 | |
4208 | // Constructors |
4209 | DLLImportAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
4210 | ); |
4211 | |
4212 | DLLImportAttr *clone(ASTContext &C) const; |
4213 | void printPretty(raw_ostream &OS, |
4214 | const PrintingPolicy &Policy) const; |
4215 | const char *getSpelling() const; |
4216 | |
4217 | private: |
4218 | bool PropagatedToBaseTemplate = false; |
4219 | |
4220 | public: |
4221 | void setPropagatedToBaseTemplate() { PropagatedToBaseTemplate = true; } |
4222 | bool wasPropagatedToBaseTemplate() { return PropagatedToBaseTemplate; } |
4223 | |
4224 | |
4225 | static bool classof(const Attr *A) { return A->getKind() == attr::DLLImport; } |
4226 | }; |
4227 | |
4228 | class DLLImportStaticLocalAttr : public InheritableAttr { |
4229 | public: |
4230 | // Factory methods |
4231 | static DLLImportStaticLocalAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
4232 | static DLLImportStaticLocalAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
4233 | static DLLImportStaticLocalAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
4234 | static DLLImportStaticLocalAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
4235 | |
4236 | // Constructors |
4237 | DLLImportStaticLocalAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
4238 | ); |
4239 | |
4240 | DLLImportStaticLocalAttr *clone(ASTContext &C) const; |
4241 | void printPretty(raw_ostream &OS, |
4242 | const PrintingPolicy &Policy) const; |
4243 | const char *getSpelling() const; |
4244 | |
4245 | |
4246 | static bool classof(const Attr *A) { return A->getKind() == attr::DLLImportStaticLocal; } |
4247 | }; |
4248 | |
4249 | class DeprecatedAttr : public InheritableAttr { |
4250 | unsigned messageLength; |
4251 | char *message; |
4252 | |
4253 | unsigned replacementLength; |
4254 | char *replacement; |
4255 | |
4256 | public: |
4257 | enum Spelling { |
4258 | GNU_deprecated = 0, |
4259 | CXX11_gnu_deprecated = 1, |
4260 | C23_gnu_deprecated = 2, |
4261 | Declspec_deprecated = 3, |
4262 | CXX11_deprecated = 4, |
4263 | C23_deprecated = 5, |
4264 | SpellingNotCalculated = 15 |
4265 | |
4266 | }; |
4267 | |
4268 | // Factory methods |
4269 | static DeprecatedAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Message, llvm::StringRef Replacement, const AttributeCommonInfo &CommonInfo); |
4270 | static DeprecatedAttr *Create(ASTContext &Ctx, llvm::StringRef Message, llvm::StringRef Replacement, const AttributeCommonInfo &CommonInfo); |
4271 | static DeprecatedAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Message, llvm::StringRef Replacement, SourceRange Range = {}, Spelling S = GNU_deprecated); |
4272 | static DeprecatedAttr *Create(ASTContext &Ctx, llvm::StringRef Message, llvm::StringRef Replacement, SourceRange Range = {}, Spelling S = GNU_deprecated); |
4273 | |
4274 | // Constructors |
4275 | DeprecatedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
4276 | , llvm::StringRef Message |
4277 | , llvm::StringRef Replacement |
4278 | ); |
4279 | DeprecatedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
4280 | ); |
4281 | |
4282 | DeprecatedAttr *clone(ASTContext &C) const; |
4283 | void printPretty(raw_ostream &OS, |
4284 | const PrintingPolicy &Policy) const; |
4285 | const char *getSpelling() const; |
4286 | llvm::StringRef getMessage() const { |
4287 | return llvm::StringRef(message, messageLength); |
4288 | } |
4289 | unsigned getMessageLength() const { |
4290 | return messageLength; |
4291 | } |
4292 | void setMessage(ASTContext &C, llvm::StringRef S) { |
4293 | messageLength = S.size(); |
4294 | this->message = new (C, 1) char [messageLength]; |
4295 | if (!S.empty()) |
4296 | std::memcpy(dest: this->message, src: S.data(), n: messageLength); |
4297 | } |
4298 | |
4299 | llvm::StringRef getReplacement() const { |
4300 | return llvm::StringRef(replacement, replacementLength); |
4301 | } |
4302 | unsigned getReplacementLength() const { |
4303 | return replacementLength; |
4304 | } |
4305 | void setReplacement(ASTContext &C, llvm::StringRef S) { |
4306 | replacementLength = S.size(); |
4307 | this->replacement = new (C, 1) char [replacementLength]; |
4308 | if (!S.empty()) |
4309 | std::memcpy(dest: this->replacement, src: S.data(), n: replacementLength); |
4310 | } |
4311 | |
4312 | |
4313 | |
4314 | static bool classof(const Attr *A) { return A->getKind() == attr::Deprecated; } |
4315 | }; |
4316 | |
4317 | class DestructorAttr : public InheritableAttr { |
4318 | int priority; |
4319 | |
4320 | public: |
4321 | enum Spelling { |
4322 | GNU_destructor = 0, |
4323 | CXX11_gnu_destructor = 1, |
4324 | C23_gnu_destructor = 2, |
4325 | SpellingNotCalculated = 15 |
4326 | |
4327 | }; |
4328 | |
4329 | // Factory methods |
4330 | static DestructorAttr *CreateImplicit(ASTContext &Ctx, int Priority, const AttributeCommonInfo &CommonInfo); |
4331 | static DestructorAttr *Create(ASTContext &Ctx, int Priority, const AttributeCommonInfo &CommonInfo); |
4332 | static DestructorAttr *CreateImplicit(ASTContext &Ctx, int Priority, SourceRange Range = {}, Spelling S = GNU_destructor); |
4333 | static DestructorAttr *Create(ASTContext &Ctx, int Priority, SourceRange Range = {}, Spelling S = GNU_destructor); |
4334 | |
4335 | // Constructors |
4336 | DestructorAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
4337 | , int Priority |
4338 | ); |
4339 | DestructorAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
4340 | ); |
4341 | |
4342 | DestructorAttr *clone(ASTContext &C) const; |
4343 | void printPretty(raw_ostream &OS, |
4344 | const PrintingPolicy &Policy) const; |
4345 | const char *getSpelling() const; |
4346 | int getPriority() const { |
4347 | return priority; |
4348 | } |
4349 | |
4350 | static const int DefaultPriority = 65535; |
4351 | |
4352 | |
4353 | |
4354 | static bool classof(const Attr *A) { return A->getKind() == attr::Destructor; } |
4355 | }; |
4356 | |
4357 | class DiagnoseAsBuiltinAttr : public InheritableAttr { |
4358 | FunctionDecl * function; |
4359 | |
4360 | unsigned argIndices_Size; |
4361 | unsigned *argIndices_; |
4362 | |
4363 | public: |
4364 | enum Spelling { |
4365 | GNU_diagnose_as_builtin = 0, |
4366 | CXX11_clang_diagnose_as_builtin = 1, |
4367 | C23_clang_diagnose_as_builtin = 2, |
4368 | SpellingNotCalculated = 15 |
4369 | |
4370 | }; |
4371 | |
4372 | // Factory methods |
4373 | static DiagnoseAsBuiltinAttr *CreateImplicit(ASTContext &Ctx, FunctionDecl * Function, unsigned *ArgIndices, unsigned ArgIndicesSize, const AttributeCommonInfo &CommonInfo); |
4374 | static DiagnoseAsBuiltinAttr *Create(ASTContext &Ctx, FunctionDecl * Function, unsigned *ArgIndices, unsigned ArgIndicesSize, const AttributeCommonInfo &CommonInfo); |
4375 | static DiagnoseAsBuiltinAttr *CreateImplicit(ASTContext &Ctx, FunctionDecl * Function, unsigned *ArgIndices, unsigned ArgIndicesSize, SourceRange Range = {}, Spelling S = GNU_diagnose_as_builtin); |
4376 | static DiagnoseAsBuiltinAttr *Create(ASTContext &Ctx, FunctionDecl * Function, unsigned *ArgIndices, unsigned ArgIndicesSize, SourceRange Range = {}, Spelling S = GNU_diagnose_as_builtin); |
4377 | |
4378 | // Constructors |
4379 | DiagnoseAsBuiltinAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
4380 | , FunctionDecl * Function |
4381 | , unsigned *ArgIndices, unsigned ArgIndicesSize |
4382 | ); |
4383 | DiagnoseAsBuiltinAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
4384 | , FunctionDecl * Function |
4385 | ); |
4386 | |
4387 | DiagnoseAsBuiltinAttr *clone(ASTContext &C) const; |
4388 | void printPretty(raw_ostream &OS, |
4389 | const PrintingPolicy &Policy) const; |
4390 | const char *getSpelling() const; |
4391 | FunctionDecl * getFunction() const { |
4392 | return function; |
4393 | } |
4394 | |
4395 | typedef unsigned* argIndices_iterator; |
4396 | argIndices_iterator argIndices_begin() const { return argIndices_; } |
4397 | argIndices_iterator argIndices_end() const { return argIndices_ + argIndices_Size; } |
4398 | unsigned argIndices_size() const { return argIndices_Size; } |
4399 | llvm::iterator_range<argIndices_iterator> argIndices() const { return llvm::make_range(x: argIndices_begin(), y: argIndices_end()); } |
4400 | |
4401 | |
4402 | |
4403 | |
4404 | static bool classof(const Attr *A) { return A->getKind() == attr::DiagnoseAsBuiltin; } |
4405 | }; |
4406 | |
4407 | class DiagnoseIfAttr : public InheritableAttr { |
4408 | Expr * cond; |
4409 | |
4410 | unsigned messageLength; |
4411 | char *message; |
4412 | |
4413 | public: |
4414 | enum DiagnosticType { |
4415 | DT_Error, |
4416 | DT_Warning |
4417 | }; |
4418 | private: |
4419 | DiagnoseIfAttr::DiagnosticType diagnosticType; |
4420 | |
4421 | bool argDependent; |
4422 | |
4423 | NamedDecl * parent; |
4424 | |
4425 | public: |
4426 | // Factory methods |
4427 | static DiagnoseIfAttr *CreateImplicit(ASTContext &Ctx, Expr * Cond, llvm::StringRef Message, DiagnoseIfAttr::DiagnosticType DiagnosticType, bool ArgDependent, NamedDecl * Parent, const AttributeCommonInfo &CommonInfo); |
4428 | static DiagnoseIfAttr *Create(ASTContext &Ctx, Expr * Cond, llvm::StringRef Message, DiagnoseIfAttr::DiagnosticType DiagnosticType, bool ArgDependent, NamedDecl * Parent, const AttributeCommonInfo &CommonInfo); |
4429 | static DiagnoseIfAttr *CreateImplicit(ASTContext &Ctx, Expr * Cond, llvm::StringRef Message, DiagnoseIfAttr::DiagnosticType DiagnosticType, bool ArgDependent, NamedDecl * Parent, SourceRange Range = {}); |
4430 | static DiagnoseIfAttr *Create(ASTContext &Ctx, Expr * Cond, llvm::StringRef Message, DiagnoseIfAttr::DiagnosticType DiagnosticType, bool ArgDependent, NamedDecl * Parent, SourceRange Range = {}); |
4431 | static DiagnoseIfAttr *CreateImplicit(ASTContext &Ctx, Expr * Cond, llvm::StringRef Message, DiagnoseIfAttr::DiagnosticType DiagnosticType, const AttributeCommonInfo &CommonInfo); |
4432 | static DiagnoseIfAttr *Create(ASTContext &Ctx, Expr * Cond, llvm::StringRef Message, DiagnoseIfAttr::DiagnosticType DiagnosticType, const AttributeCommonInfo &CommonInfo); |
4433 | static DiagnoseIfAttr *CreateImplicit(ASTContext &Ctx, Expr * Cond, llvm::StringRef Message, DiagnoseIfAttr::DiagnosticType DiagnosticType, SourceRange Range = {}); |
4434 | static DiagnoseIfAttr *Create(ASTContext &Ctx, Expr * Cond, llvm::StringRef Message, DiagnoseIfAttr::DiagnosticType DiagnosticType, SourceRange Range = {}); |
4435 | |
4436 | // Constructors |
4437 | DiagnoseIfAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
4438 | , Expr * Cond |
4439 | , llvm::StringRef Message |
4440 | , DiagnoseIfAttr::DiagnosticType DiagnosticType |
4441 | , bool ArgDependent |
4442 | , NamedDecl * Parent |
4443 | ); |
4444 | DiagnoseIfAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
4445 | , Expr * Cond |
4446 | , llvm::StringRef Message |
4447 | , DiagnoseIfAttr::DiagnosticType DiagnosticType |
4448 | ); |
4449 | |
4450 | DiagnoseIfAttr *clone(ASTContext &C) const; |
4451 | void printPretty(raw_ostream &OS, |
4452 | const PrintingPolicy &Policy) const; |
4453 | const char *getSpelling() const; |
4454 | Expr * getCond() const { |
4455 | return cond; |
4456 | } |
4457 | |
4458 | llvm::StringRef getMessage() const { |
4459 | return llvm::StringRef(message, messageLength); |
4460 | } |
4461 | unsigned getMessageLength() const { |
4462 | return messageLength; |
4463 | } |
4464 | void setMessage(ASTContext &C, llvm::StringRef S) { |
4465 | messageLength = S.size(); |
4466 | this->message = new (C, 1) char [messageLength]; |
4467 | if (!S.empty()) |
4468 | std::memcpy(dest: this->message, src: S.data(), n: messageLength); |
4469 | } |
4470 | |
4471 | DiagnoseIfAttr::DiagnosticType getDiagnosticType() const { |
4472 | return diagnosticType; |
4473 | } |
4474 | |
4475 | static bool ConvertStrToDiagnosticType(StringRef Val, DiagnoseIfAttr::DiagnosticType &Out); |
4476 | static const char *ConvertDiagnosticTypeToStr(DiagnoseIfAttr::DiagnosticType Val); |
4477 | bool getArgDependent() const { |
4478 | return argDependent; |
4479 | } |
4480 | |
4481 | NamedDecl * getParent() const { |
4482 | return parent; |
4483 | } |
4484 | |
4485 | |
4486 | bool isError() const { return diagnosticType == DT_Error; } |
4487 | bool isWarning() const { return diagnosticType == DT_Warning; } |
4488 | |
4489 | |
4490 | static bool classof(const Attr *A) { return A->getKind() == attr::DiagnoseIf; } |
4491 | }; |
4492 | |
4493 | class DisableSanitizerInstrumentationAttr : public InheritableAttr { |
4494 | public: |
4495 | enum Spelling { |
4496 | GNU_disable_sanitizer_instrumentation = 0, |
4497 | CXX11_clang_disable_sanitizer_instrumentation = 1, |
4498 | C23_clang_disable_sanitizer_instrumentation = 2, |
4499 | SpellingNotCalculated = 15 |
4500 | |
4501 | }; |
4502 | |
4503 | // Factory methods |
4504 | static DisableSanitizerInstrumentationAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
4505 | static DisableSanitizerInstrumentationAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
4506 | static DisableSanitizerInstrumentationAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_disable_sanitizer_instrumentation); |
4507 | static DisableSanitizerInstrumentationAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_disable_sanitizer_instrumentation); |
4508 | |
4509 | // Constructors |
4510 | DisableSanitizerInstrumentationAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
4511 | ); |
4512 | |
4513 | DisableSanitizerInstrumentationAttr *clone(ASTContext &C) const; |
4514 | void printPretty(raw_ostream &OS, |
4515 | const PrintingPolicy &Policy) const; |
4516 | const char *getSpelling() const; |
4517 | |
4518 | |
4519 | static bool classof(const Attr *A) { return A->getKind() == attr::DisableSanitizerInstrumentation; } |
4520 | }; |
4521 | |
4522 | class DisableTailCallsAttr : public InheritableAttr { |
4523 | public: |
4524 | enum Spelling { |
4525 | GNU_disable_tail_calls = 0, |
4526 | CXX11_clang_disable_tail_calls = 1, |
4527 | C23_clang_disable_tail_calls = 2, |
4528 | SpellingNotCalculated = 15 |
4529 | |
4530 | }; |
4531 | |
4532 | // Factory methods |
4533 | static DisableTailCallsAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
4534 | static DisableTailCallsAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
4535 | static DisableTailCallsAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_disable_tail_calls); |
4536 | static DisableTailCallsAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_disable_tail_calls); |
4537 | |
4538 | // Constructors |
4539 | DisableTailCallsAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
4540 | ); |
4541 | |
4542 | DisableTailCallsAttr *clone(ASTContext &C) const; |
4543 | void printPretty(raw_ostream &OS, |
4544 | const PrintingPolicy &Policy) const; |
4545 | const char *getSpelling() const; |
4546 | |
4547 | |
4548 | static bool classof(const Attr *A) { return A->getKind() == attr::DisableTailCalls; } |
4549 | }; |
4550 | |
4551 | class EmptyBasesAttr : public InheritableAttr { |
4552 | public: |
4553 | // Factory methods |
4554 | static EmptyBasesAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
4555 | static EmptyBasesAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
4556 | static EmptyBasesAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
4557 | static EmptyBasesAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
4558 | |
4559 | // Constructors |
4560 | EmptyBasesAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
4561 | ); |
4562 | |
4563 | EmptyBasesAttr *clone(ASTContext &C) const; |
4564 | void printPretty(raw_ostream &OS, |
4565 | const PrintingPolicy &Policy) const; |
4566 | const char *getSpelling() const; |
4567 | |
4568 | |
4569 | static bool classof(const Attr *A) { return A->getKind() == attr::EmptyBases; } |
4570 | }; |
4571 | |
4572 | class EnableIfAttr : public InheritableAttr { |
4573 | Expr * cond; |
4574 | |
4575 | unsigned messageLength; |
4576 | char *message; |
4577 | |
4578 | public: |
4579 | // Factory methods |
4580 | static EnableIfAttr *CreateImplicit(ASTContext &Ctx, Expr * Cond, llvm::StringRef Message, const AttributeCommonInfo &CommonInfo); |
4581 | static EnableIfAttr *Create(ASTContext &Ctx, Expr * Cond, llvm::StringRef Message, const AttributeCommonInfo &CommonInfo); |
4582 | static EnableIfAttr *CreateImplicit(ASTContext &Ctx, Expr * Cond, llvm::StringRef Message, SourceRange Range = {}); |
4583 | static EnableIfAttr *Create(ASTContext &Ctx, Expr * Cond, llvm::StringRef Message, SourceRange Range = {}); |
4584 | |
4585 | // Constructors |
4586 | EnableIfAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
4587 | , Expr * Cond |
4588 | , llvm::StringRef Message |
4589 | ); |
4590 | |
4591 | EnableIfAttr *clone(ASTContext &C) const; |
4592 | void printPretty(raw_ostream &OS, |
4593 | const PrintingPolicy &Policy) const; |
4594 | const char *getSpelling() const; |
4595 | Expr * getCond() const { |
4596 | return cond; |
4597 | } |
4598 | |
4599 | llvm::StringRef getMessage() const { |
4600 | return llvm::StringRef(message, messageLength); |
4601 | } |
4602 | unsigned getMessageLength() const { |
4603 | return messageLength; |
4604 | } |
4605 | void setMessage(ASTContext &C, llvm::StringRef S) { |
4606 | messageLength = S.size(); |
4607 | this->message = new (C, 1) char [messageLength]; |
4608 | if (!S.empty()) |
4609 | std::memcpy(dest: this->message, src: S.data(), n: messageLength); |
4610 | } |
4611 | |
4612 | |
4613 | |
4614 | static bool classof(const Attr *A) { return A->getKind() == attr::EnableIf; } |
4615 | }; |
4616 | |
4617 | class EnforceTCBAttr : public InheritableAttr { |
4618 | unsigned tCBNameLength; |
4619 | char *tCBName; |
4620 | |
4621 | public: |
4622 | enum Spelling { |
4623 | GNU_enforce_tcb = 0, |
4624 | CXX11_clang_enforce_tcb = 1, |
4625 | C23_clang_enforce_tcb = 2, |
4626 | SpellingNotCalculated = 15 |
4627 | |
4628 | }; |
4629 | |
4630 | // Factory methods |
4631 | static EnforceTCBAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef TCBName, const AttributeCommonInfo &CommonInfo); |
4632 | static EnforceTCBAttr *Create(ASTContext &Ctx, llvm::StringRef TCBName, const AttributeCommonInfo &CommonInfo); |
4633 | static EnforceTCBAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef TCBName, SourceRange Range = {}, Spelling S = GNU_enforce_tcb); |
4634 | static EnforceTCBAttr *Create(ASTContext &Ctx, llvm::StringRef TCBName, SourceRange Range = {}, Spelling S = GNU_enforce_tcb); |
4635 | |
4636 | // Constructors |
4637 | EnforceTCBAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
4638 | , llvm::StringRef TCBName |
4639 | ); |
4640 | |
4641 | EnforceTCBAttr *clone(ASTContext &C) const; |
4642 | void printPretty(raw_ostream &OS, |
4643 | const PrintingPolicy &Policy) const; |
4644 | const char *getSpelling() const; |
4645 | llvm::StringRef getTCBName() const { |
4646 | return llvm::StringRef(tCBName, tCBNameLength); |
4647 | } |
4648 | unsigned getTCBNameLength() const { |
4649 | return tCBNameLength; |
4650 | } |
4651 | void setTCBName(ASTContext &C, llvm::StringRef S) { |
4652 | tCBNameLength = S.size(); |
4653 | this->tCBName = new (C, 1) char [tCBNameLength]; |
4654 | if (!S.empty()) |
4655 | std::memcpy(dest: this->tCBName, src: S.data(), n: tCBNameLength); |
4656 | } |
4657 | |
4658 | |
4659 | |
4660 | static bool classof(const Attr *A) { return A->getKind() == attr::EnforceTCB; } |
4661 | }; |
4662 | |
4663 | class EnforceTCBLeafAttr : public InheritableAttr { |
4664 | unsigned tCBNameLength; |
4665 | char *tCBName; |
4666 | |
4667 | public: |
4668 | enum Spelling { |
4669 | GNU_enforce_tcb_leaf = 0, |
4670 | CXX11_clang_enforce_tcb_leaf = 1, |
4671 | C23_clang_enforce_tcb_leaf = 2, |
4672 | SpellingNotCalculated = 15 |
4673 | |
4674 | }; |
4675 | |
4676 | // Factory methods |
4677 | static EnforceTCBLeafAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef TCBName, const AttributeCommonInfo &CommonInfo); |
4678 | static EnforceTCBLeafAttr *Create(ASTContext &Ctx, llvm::StringRef TCBName, const AttributeCommonInfo &CommonInfo); |
4679 | static EnforceTCBLeafAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef TCBName, SourceRange Range = {}, Spelling S = GNU_enforce_tcb_leaf); |
4680 | static EnforceTCBLeafAttr *Create(ASTContext &Ctx, llvm::StringRef TCBName, SourceRange Range = {}, Spelling S = GNU_enforce_tcb_leaf); |
4681 | |
4682 | // Constructors |
4683 | EnforceTCBLeafAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
4684 | , llvm::StringRef TCBName |
4685 | ); |
4686 | |
4687 | EnforceTCBLeafAttr *clone(ASTContext &C) const; |
4688 | void printPretty(raw_ostream &OS, |
4689 | const PrintingPolicy &Policy) const; |
4690 | const char *getSpelling() const; |
4691 | llvm::StringRef getTCBName() const { |
4692 | return llvm::StringRef(tCBName, tCBNameLength); |
4693 | } |
4694 | unsigned getTCBNameLength() const { |
4695 | return tCBNameLength; |
4696 | } |
4697 | void setTCBName(ASTContext &C, llvm::StringRef S) { |
4698 | tCBNameLength = S.size(); |
4699 | this->tCBName = new (C, 1) char [tCBNameLength]; |
4700 | if (!S.empty()) |
4701 | std::memcpy(dest: this->tCBName, src: S.data(), n: tCBNameLength); |
4702 | } |
4703 | |
4704 | |
4705 | |
4706 | static bool classof(const Attr *A) { return A->getKind() == attr::EnforceTCBLeaf; } |
4707 | }; |
4708 | |
4709 | class EnumExtensibilityAttr : public InheritableAttr { |
4710 | public: |
4711 | enum Kind { |
4712 | Closed, |
4713 | Open |
4714 | }; |
4715 | private: |
4716 | EnumExtensibilityAttr::Kind extensibility; |
4717 | |
4718 | public: |
4719 | enum Spelling { |
4720 | GNU_enum_extensibility = 0, |
4721 | CXX11_clang_enum_extensibility = 1, |
4722 | C23_clang_enum_extensibility = 2, |
4723 | SpellingNotCalculated = 15 |
4724 | |
4725 | }; |
4726 | |
4727 | // Factory methods |
4728 | static EnumExtensibilityAttr *CreateImplicit(ASTContext &Ctx, EnumExtensibilityAttr::Kind Extensibility, const AttributeCommonInfo &CommonInfo); |
4729 | static EnumExtensibilityAttr *Create(ASTContext &Ctx, EnumExtensibilityAttr::Kind Extensibility, const AttributeCommonInfo &CommonInfo); |
4730 | static EnumExtensibilityAttr *CreateImplicit(ASTContext &Ctx, EnumExtensibilityAttr::Kind Extensibility, SourceRange Range = {}, Spelling S = GNU_enum_extensibility); |
4731 | static EnumExtensibilityAttr *Create(ASTContext &Ctx, EnumExtensibilityAttr::Kind Extensibility, SourceRange Range = {}, Spelling S = GNU_enum_extensibility); |
4732 | |
4733 | // Constructors |
4734 | EnumExtensibilityAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
4735 | , EnumExtensibilityAttr::Kind Extensibility |
4736 | ); |
4737 | |
4738 | EnumExtensibilityAttr *clone(ASTContext &C) const; |
4739 | void printPretty(raw_ostream &OS, |
4740 | const PrintingPolicy &Policy) const; |
4741 | const char *getSpelling() const; |
4742 | EnumExtensibilityAttr::Kind getExtensibility() const { |
4743 | return extensibility; |
4744 | } |
4745 | |
4746 | static bool ConvertStrToKind(StringRef Val, EnumExtensibilityAttr::Kind &Out); |
4747 | static const char *ConvertKindToStr(EnumExtensibilityAttr::Kind Val); |
4748 | |
4749 | |
4750 | static bool classof(const Attr *A) { return A->getKind() == attr::EnumExtensibility; } |
4751 | }; |
4752 | |
4753 | class ErrorAttr : public InheritableAttr { |
4754 | unsigned userDiagnosticLength; |
4755 | char *userDiagnostic; |
4756 | |
4757 | public: |
4758 | enum Spelling { |
4759 | GNU_error = 0, |
4760 | CXX11_gnu_error = 1, |
4761 | C23_gnu_error = 2, |
4762 | GNU_warning = 3, |
4763 | CXX11_gnu_warning = 4, |
4764 | C23_gnu_warning = 5, |
4765 | SpellingNotCalculated = 15 |
4766 | |
4767 | }; |
4768 | |
4769 | // Factory methods |
4770 | static ErrorAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef UserDiagnostic, const AttributeCommonInfo &CommonInfo); |
4771 | static ErrorAttr *Create(ASTContext &Ctx, llvm::StringRef UserDiagnostic, const AttributeCommonInfo &CommonInfo); |
4772 | static ErrorAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef UserDiagnostic, SourceRange Range = {}, Spelling S = GNU_error); |
4773 | static ErrorAttr *Create(ASTContext &Ctx, llvm::StringRef UserDiagnostic, SourceRange Range = {}, Spelling S = GNU_error); |
4774 | |
4775 | // Constructors |
4776 | ErrorAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
4777 | , llvm::StringRef UserDiagnostic |
4778 | ); |
4779 | |
4780 | ErrorAttr *clone(ASTContext &C) const; |
4781 | void printPretty(raw_ostream &OS, |
4782 | const PrintingPolicy &Policy) const; |
4783 | const char *getSpelling() const; |
4784 | Spelling getSemanticSpelling() const; |
4785 | bool isError() const { return getAttributeSpellingListIndex() == 0 || |
4786 | getAttributeSpellingListIndex() == 1 || |
4787 | getAttributeSpellingListIndex() == 2; } |
4788 | bool isWarning() const { return getAttributeSpellingListIndex() == 3 || |
4789 | getAttributeSpellingListIndex() == 4 || |
4790 | getAttributeSpellingListIndex() == 5; } |
4791 | llvm::StringRef getUserDiagnostic() const { |
4792 | return llvm::StringRef(userDiagnostic, userDiagnosticLength); |
4793 | } |
4794 | unsigned getUserDiagnosticLength() const { |
4795 | return userDiagnosticLength; |
4796 | } |
4797 | void setUserDiagnostic(ASTContext &C, llvm::StringRef S) { |
4798 | userDiagnosticLength = S.size(); |
4799 | this->userDiagnostic = new (C, 1) char [userDiagnosticLength]; |
4800 | if (!S.empty()) |
4801 | std::memcpy(dest: this->userDiagnostic, src: S.data(), n: userDiagnosticLength); |
4802 | } |
4803 | |
4804 | |
4805 | |
4806 | static bool classof(const Attr *A) { return A->getKind() == attr::Error; } |
4807 | }; |
4808 | |
4809 | class ExcludeFromExplicitInstantiationAttr : public InheritableAttr { |
4810 | public: |
4811 | enum Spelling { |
4812 | GNU_exclude_from_explicit_instantiation = 0, |
4813 | CXX11_clang_exclude_from_explicit_instantiation = 1, |
4814 | C23_clang_exclude_from_explicit_instantiation = 2, |
4815 | SpellingNotCalculated = 15 |
4816 | |
4817 | }; |
4818 | |
4819 | // Factory methods |
4820 | static ExcludeFromExplicitInstantiationAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
4821 | static ExcludeFromExplicitInstantiationAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
4822 | static ExcludeFromExplicitInstantiationAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_exclude_from_explicit_instantiation); |
4823 | static ExcludeFromExplicitInstantiationAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_exclude_from_explicit_instantiation); |
4824 | |
4825 | // Constructors |
4826 | ExcludeFromExplicitInstantiationAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
4827 | ); |
4828 | |
4829 | ExcludeFromExplicitInstantiationAttr *clone(ASTContext &C) const; |
4830 | void printPretty(raw_ostream &OS, |
4831 | const PrintingPolicy &Policy) const; |
4832 | const char *getSpelling() const; |
4833 | |
4834 | |
4835 | static bool classof(const Attr *A) { return A->getKind() == attr::ExcludeFromExplicitInstantiation; } |
4836 | }; |
4837 | |
4838 | class ExclusiveTrylockFunctionAttr : public InheritableAttr { |
4839 | Expr * successValue; |
4840 | |
4841 | unsigned args_Size; |
4842 | Expr * *args_; |
4843 | |
4844 | public: |
4845 | // Factory methods |
4846 | static ExclusiveTrylockFunctionAttr *CreateImplicit(ASTContext &Ctx, Expr * SuccessValue, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo); |
4847 | static ExclusiveTrylockFunctionAttr *Create(ASTContext &Ctx, Expr * SuccessValue, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo); |
4848 | static ExclusiveTrylockFunctionAttr *CreateImplicit(ASTContext &Ctx, Expr * SuccessValue, Expr * *Args, unsigned ArgsSize, SourceRange Range = {}); |
4849 | static ExclusiveTrylockFunctionAttr *Create(ASTContext &Ctx, Expr * SuccessValue, Expr * *Args, unsigned ArgsSize, SourceRange Range = {}); |
4850 | |
4851 | // Constructors |
4852 | ExclusiveTrylockFunctionAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
4853 | , Expr * SuccessValue |
4854 | , Expr * *Args, unsigned ArgsSize |
4855 | ); |
4856 | ExclusiveTrylockFunctionAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
4857 | , Expr * SuccessValue |
4858 | ); |
4859 | |
4860 | ExclusiveTrylockFunctionAttr *clone(ASTContext &C) const; |
4861 | void printPretty(raw_ostream &OS, |
4862 | const PrintingPolicy &Policy) const; |
4863 | const char *getSpelling() const; |
4864 | Expr * getSuccessValue() const { |
4865 | return successValue; |
4866 | } |
4867 | |
4868 | typedef Expr ** args_iterator; |
4869 | args_iterator args_begin() const { return args_; } |
4870 | args_iterator args_end() const { return args_ + args_Size; } |
4871 | unsigned args_size() const { return args_Size; } |
4872 | llvm::iterator_range<args_iterator> args() const { return llvm::make_range(x: args_begin(), y: args_end()); } |
4873 | |
4874 | |
4875 | |
4876 | |
4877 | static bool classof(const Attr *A) { return A->getKind() == attr::ExclusiveTrylockFunction; } |
4878 | }; |
4879 | |
4880 | class ExternalSourceSymbolAttr : public InheritableAttr { |
4881 | unsigned languageLength; |
4882 | char *language; |
4883 | |
4884 | unsigned definedInLength; |
4885 | char *definedIn; |
4886 | |
4887 | bool generatedDeclaration; |
4888 | |
4889 | unsigned uSRLength; |
4890 | char *uSR; |
4891 | |
4892 | public: |
4893 | enum Spelling { |
4894 | GNU_external_source_symbol = 0, |
4895 | CXX11_clang_external_source_symbol = 1, |
4896 | C23_clang_external_source_symbol = 2, |
4897 | SpellingNotCalculated = 15 |
4898 | |
4899 | }; |
4900 | |
4901 | // Factory methods |
4902 | static ExternalSourceSymbolAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Language, llvm::StringRef DefinedIn, bool GeneratedDeclaration, llvm::StringRef USR, const AttributeCommonInfo &CommonInfo); |
4903 | static ExternalSourceSymbolAttr *Create(ASTContext &Ctx, llvm::StringRef Language, llvm::StringRef DefinedIn, bool GeneratedDeclaration, llvm::StringRef USR, const AttributeCommonInfo &CommonInfo); |
4904 | static ExternalSourceSymbolAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Language, llvm::StringRef DefinedIn, bool GeneratedDeclaration, llvm::StringRef USR, SourceRange Range = {}, Spelling S = GNU_external_source_symbol); |
4905 | static ExternalSourceSymbolAttr *Create(ASTContext &Ctx, llvm::StringRef Language, llvm::StringRef DefinedIn, bool GeneratedDeclaration, llvm::StringRef USR, SourceRange Range = {}, Spelling S = GNU_external_source_symbol); |
4906 | |
4907 | // Constructors |
4908 | ExternalSourceSymbolAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
4909 | , llvm::StringRef Language |
4910 | , llvm::StringRef DefinedIn |
4911 | , bool GeneratedDeclaration |
4912 | , llvm::StringRef USR |
4913 | ); |
4914 | ExternalSourceSymbolAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
4915 | ); |
4916 | |
4917 | ExternalSourceSymbolAttr *clone(ASTContext &C) const; |
4918 | void printPretty(raw_ostream &OS, |
4919 | const PrintingPolicy &Policy) const; |
4920 | const char *getSpelling() const; |
4921 | llvm::StringRef getLanguage() const { |
4922 | return llvm::StringRef(language, languageLength); |
4923 | } |
4924 | unsigned getLanguageLength() const { |
4925 | return languageLength; |
4926 | } |
4927 | void setLanguage(ASTContext &C, llvm::StringRef S) { |
4928 | languageLength = S.size(); |
4929 | this->language = new (C, 1) char [languageLength]; |
4930 | if (!S.empty()) |
4931 | std::memcpy(dest: this->language, src: S.data(), n: languageLength); |
4932 | } |
4933 | |
4934 | llvm::StringRef getDefinedIn() const { |
4935 | return llvm::StringRef(definedIn, definedInLength); |
4936 | } |
4937 | unsigned getDefinedInLength() const { |
4938 | return definedInLength; |
4939 | } |
4940 | void setDefinedIn(ASTContext &C, llvm::StringRef S) { |
4941 | definedInLength = S.size(); |
4942 | this->definedIn = new (C, 1) char [definedInLength]; |
4943 | if (!S.empty()) |
4944 | std::memcpy(dest: this->definedIn, src: S.data(), n: definedInLength); |
4945 | } |
4946 | |
4947 | bool getGeneratedDeclaration() const { |
4948 | return generatedDeclaration; |
4949 | } |
4950 | |
4951 | llvm::StringRef getUSR() const { |
4952 | return llvm::StringRef(uSR, uSRLength); |
4953 | } |
4954 | unsigned getUSRLength() const { |
4955 | return uSRLength; |
4956 | } |
4957 | void setUSR(ASTContext &C, llvm::StringRef S) { |
4958 | uSRLength = S.size(); |
4959 | this->uSR = new (C, 1) char [uSRLength]; |
4960 | if (!S.empty()) |
4961 | std::memcpy(dest: this->uSR, src: S.data(), n: uSRLength); |
4962 | } |
4963 | |
4964 | |
4965 | |
4966 | static bool classof(const Attr *A) { return A->getKind() == attr::ExternalSourceSymbol; } |
4967 | }; |
4968 | |
4969 | class FallThroughAttr : public StmtAttr { |
4970 | public: |
4971 | enum Spelling { |
4972 | CXX11_fallthrough = 0, |
4973 | C23_fallthrough = 1, |
4974 | CXX11_clang_fallthrough = 2, |
4975 | GNU_fallthrough = 3, |
4976 | CXX11_gnu_fallthrough = 4, |
4977 | C23_gnu_fallthrough = 5, |
4978 | SpellingNotCalculated = 15 |
4979 | |
4980 | }; |
4981 | |
4982 | // Factory methods |
4983 | static FallThroughAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
4984 | static FallThroughAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
4985 | static FallThroughAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = CXX11_fallthrough); |
4986 | static FallThroughAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = CXX11_fallthrough); |
4987 | |
4988 | // Constructors |
4989 | FallThroughAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
4990 | ); |
4991 | |
4992 | FallThroughAttr *clone(ASTContext &C) const; |
4993 | void printPretty(raw_ostream &OS, |
4994 | const PrintingPolicy &Policy) const; |
4995 | const char *getSpelling() const; |
4996 | |
4997 | |
4998 | static bool classof(const Attr *A) { return A->getKind() == attr::FallThrough; } |
4999 | }; |
5000 | |
5001 | class FastCallAttr : public InheritableAttr { |
5002 | public: |
5003 | enum Spelling { |
5004 | GNU_fastcall = 0, |
5005 | CXX11_gnu_fastcall = 1, |
5006 | C23_gnu_fastcall = 2, |
5007 | Keyword_fastcall = 3, |
5008 | SpellingNotCalculated = 15 |
5009 | |
5010 | }; |
5011 | |
5012 | // Factory methods |
5013 | static FastCallAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
5014 | static FastCallAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
5015 | static FastCallAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_fastcall); |
5016 | static FastCallAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_fastcall); |
5017 | |
5018 | // Constructors |
5019 | FastCallAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
5020 | ); |
5021 | |
5022 | FastCallAttr *clone(ASTContext &C) const; |
5023 | void printPretty(raw_ostream &OS, |
5024 | const PrintingPolicy &Policy) const; |
5025 | const char *getSpelling() const; |
5026 | |
5027 | |
5028 | static bool classof(const Attr *A) { return A->getKind() == attr::FastCall; } |
5029 | }; |
5030 | |
5031 | class FinalAttr : public InheritableAttr { |
5032 | public: |
5033 | enum Spelling { |
5034 | Keyword_final = 0, |
5035 | Keyword_sealed = 1, |
5036 | SpellingNotCalculated = 15 |
5037 | |
5038 | }; |
5039 | |
5040 | // Factory methods |
5041 | static FinalAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
5042 | static FinalAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
5043 | static FinalAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = Keyword_final); |
5044 | static FinalAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = Keyword_final); |
5045 | |
5046 | // Constructors |
5047 | FinalAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
5048 | ); |
5049 | |
5050 | FinalAttr *clone(ASTContext &C) const; |
5051 | void printPretty(raw_ostream &OS, |
5052 | const PrintingPolicy &Policy) const; |
5053 | const char *getSpelling() const; |
5054 | Spelling getSemanticSpelling() const; |
5055 | bool isSpelledAsSealed() const { return getAttributeSpellingListIndex() == 1; } |
5056 | |
5057 | |
5058 | static bool classof(const Attr *A) { return A->getKind() == attr::Final; } |
5059 | }; |
5060 | |
5061 | class FlagEnumAttr : public InheritableAttr { |
5062 | public: |
5063 | enum Spelling { |
5064 | GNU_flag_enum = 0, |
5065 | CXX11_clang_flag_enum = 1, |
5066 | C23_clang_flag_enum = 2, |
5067 | SpellingNotCalculated = 15 |
5068 | |
5069 | }; |
5070 | |
5071 | // Factory methods |
5072 | static FlagEnumAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
5073 | static FlagEnumAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
5074 | static FlagEnumAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_flag_enum); |
5075 | static FlagEnumAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_flag_enum); |
5076 | |
5077 | // Constructors |
5078 | FlagEnumAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
5079 | ); |
5080 | |
5081 | FlagEnumAttr *clone(ASTContext &C) const; |
5082 | void printPretty(raw_ostream &OS, |
5083 | const PrintingPolicy &Policy) const; |
5084 | const char *getSpelling() const; |
5085 | |
5086 | |
5087 | static bool classof(const Attr *A) { return A->getKind() == attr::FlagEnum; } |
5088 | }; |
5089 | |
5090 | class FlattenAttr : public InheritableAttr { |
5091 | public: |
5092 | enum Spelling { |
5093 | GNU_flatten = 0, |
5094 | CXX11_gnu_flatten = 1, |
5095 | C23_gnu_flatten = 2, |
5096 | SpellingNotCalculated = 15 |
5097 | |
5098 | }; |
5099 | |
5100 | // Factory methods |
5101 | static FlattenAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
5102 | static FlattenAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
5103 | static FlattenAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_flatten); |
5104 | static FlattenAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_flatten); |
5105 | |
5106 | // Constructors |
5107 | FlattenAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
5108 | ); |
5109 | |
5110 | FlattenAttr *clone(ASTContext &C) const; |
5111 | void printPretty(raw_ostream &OS, |
5112 | const PrintingPolicy &Policy) const; |
5113 | const char *getSpelling() const; |
5114 | |
5115 | |
5116 | static bool classof(const Attr *A) { return A->getKind() == attr::Flatten; } |
5117 | }; |
5118 | |
5119 | class FormatAttr : public InheritableAttr { |
5120 | IdentifierInfo * type; |
5121 | |
5122 | int formatIdx; |
5123 | |
5124 | int firstArg; |
5125 | |
5126 | public: |
5127 | enum Spelling { |
5128 | GNU_format = 0, |
5129 | CXX11_gnu_format = 1, |
5130 | C23_gnu_format = 2, |
5131 | SpellingNotCalculated = 15 |
5132 | |
5133 | }; |
5134 | |
5135 | // Factory methods |
5136 | static FormatAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * Type, int FormatIdx, int FirstArg, const AttributeCommonInfo &CommonInfo); |
5137 | static FormatAttr *Create(ASTContext &Ctx, IdentifierInfo * Type, int FormatIdx, int FirstArg, const AttributeCommonInfo &CommonInfo); |
5138 | static FormatAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * Type, int FormatIdx, int FirstArg, SourceRange Range = {}, Spelling S = GNU_format); |
5139 | static FormatAttr *Create(ASTContext &Ctx, IdentifierInfo * Type, int FormatIdx, int FirstArg, SourceRange Range = {}, Spelling S = GNU_format); |
5140 | |
5141 | // Constructors |
5142 | FormatAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
5143 | , IdentifierInfo * Type |
5144 | , int FormatIdx |
5145 | , int FirstArg |
5146 | ); |
5147 | |
5148 | FormatAttr *clone(ASTContext &C) const; |
5149 | void printPretty(raw_ostream &OS, |
5150 | const PrintingPolicy &Policy) const; |
5151 | const char *getSpelling() const; |
5152 | IdentifierInfo * getType() const { |
5153 | return type; |
5154 | } |
5155 | |
5156 | int getFormatIdx() const { |
5157 | return formatIdx; |
5158 | } |
5159 | |
5160 | int getFirstArg() const { |
5161 | return firstArg; |
5162 | } |
5163 | |
5164 | |
5165 | |
5166 | static bool classof(const Attr *A) { return A->getKind() == attr::Format; } |
5167 | }; |
5168 | |
5169 | class FormatArgAttr : public InheritableAttr { |
5170 | ParamIdx formatIdx; |
5171 | |
5172 | public: |
5173 | enum Spelling { |
5174 | GNU_format_arg = 0, |
5175 | CXX11_gnu_format_arg = 1, |
5176 | C23_gnu_format_arg = 2, |
5177 | SpellingNotCalculated = 15 |
5178 | |
5179 | }; |
5180 | |
5181 | // Factory methods |
5182 | static FormatArgAttr *CreateImplicit(ASTContext &Ctx, ParamIdx FormatIdx, const AttributeCommonInfo &CommonInfo); |
5183 | static FormatArgAttr *Create(ASTContext &Ctx, ParamIdx FormatIdx, const AttributeCommonInfo &CommonInfo); |
5184 | static FormatArgAttr *CreateImplicit(ASTContext &Ctx, ParamIdx FormatIdx, SourceRange Range = {}, Spelling S = GNU_format_arg); |
5185 | static FormatArgAttr *Create(ASTContext &Ctx, ParamIdx FormatIdx, SourceRange Range = {}, Spelling S = GNU_format_arg); |
5186 | |
5187 | // Constructors |
5188 | FormatArgAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
5189 | , ParamIdx FormatIdx |
5190 | ); |
5191 | |
5192 | FormatArgAttr *clone(ASTContext &C) const; |
5193 | void printPretty(raw_ostream &OS, |
5194 | const PrintingPolicy &Policy) const; |
5195 | const char *getSpelling() const; |
5196 | ParamIdx getFormatIdx() const { |
5197 | return formatIdx; |
5198 | } |
5199 | |
5200 | |
5201 | |
5202 | static bool classof(const Attr *A) { return A->getKind() == attr::FormatArg; } |
5203 | }; |
5204 | |
5205 | class FunctionReturnThunksAttr : public InheritableAttr { |
5206 | public: |
5207 | enum Kind { |
5208 | Keep, |
5209 | Extern |
5210 | }; |
5211 | private: |
5212 | FunctionReturnThunksAttr::Kind thunkType; |
5213 | |
5214 | public: |
5215 | enum Spelling { |
5216 | GNU_function_return = 0, |
5217 | CXX11_gnu_function_return = 1, |
5218 | C23_gnu_function_return = 2, |
5219 | SpellingNotCalculated = 15 |
5220 | |
5221 | }; |
5222 | |
5223 | // Factory methods |
5224 | static FunctionReturnThunksAttr *CreateImplicit(ASTContext &Ctx, FunctionReturnThunksAttr::Kind ThunkType, const AttributeCommonInfo &CommonInfo); |
5225 | static FunctionReturnThunksAttr *Create(ASTContext &Ctx, FunctionReturnThunksAttr::Kind ThunkType, const AttributeCommonInfo &CommonInfo); |
5226 | static FunctionReturnThunksAttr *CreateImplicit(ASTContext &Ctx, FunctionReturnThunksAttr::Kind ThunkType, SourceRange Range = {}, Spelling S = GNU_function_return); |
5227 | static FunctionReturnThunksAttr *Create(ASTContext &Ctx, FunctionReturnThunksAttr::Kind ThunkType, SourceRange Range = {}, Spelling S = GNU_function_return); |
5228 | |
5229 | // Constructors |
5230 | FunctionReturnThunksAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
5231 | , FunctionReturnThunksAttr::Kind ThunkType |
5232 | ); |
5233 | |
5234 | FunctionReturnThunksAttr *clone(ASTContext &C) const; |
5235 | void printPretty(raw_ostream &OS, |
5236 | const PrintingPolicy &Policy) const; |
5237 | const char *getSpelling() const; |
5238 | FunctionReturnThunksAttr::Kind getThunkType() const { |
5239 | return thunkType; |
5240 | } |
5241 | |
5242 | static bool ConvertStrToKind(StringRef Val, FunctionReturnThunksAttr::Kind &Out); |
5243 | static const char *ConvertKindToStr(FunctionReturnThunksAttr::Kind Val); |
5244 | |
5245 | |
5246 | static bool classof(const Attr *A) { return A->getKind() == attr::FunctionReturnThunks; } |
5247 | }; |
5248 | |
5249 | class GNUInlineAttr : public InheritableAttr { |
5250 | public: |
5251 | enum Spelling { |
5252 | GNU_gnu_inline = 0, |
5253 | CXX11_gnu_gnu_inline = 1, |
5254 | C23_gnu_gnu_inline = 2, |
5255 | SpellingNotCalculated = 15 |
5256 | |
5257 | }; |
5258 | |
5259 | // Factory methods |
5260 | static GNUInlineAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
5261 | static GNUInlineAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
5262 | static GNUInlineAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_gnu_inline); |
5263 | static GNUInlineAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_gnu_inline); |
5264 | |
5265 | // Constructors |
5266 | GNUInlineAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
5267 | ); |
5268 | |
5269 | GNUInlineAttr *clone(ASTContext &C) const; |
5270 | void printPretty(raw_ostream &OS, |
5271 | const PrintingPolicy &Policy) const; |
5272 | const char *getSpelling() const; |
5273 | |
5274 | |
5275 | static bool classof(const Attr *A) { return A->getKind() == attr::GNUInline; } |
5276 | }; |
5277 | |
5278 | class GuardedByAttr : public InheritableAttr { |
5279 | Expr * arg; |
5280 | |
5281 | public: |
5282 | // Factory methods |
5283 | static GuardedByAttr *CreateImplicit(ASTContext &Ctx, Expr * Arg, const AttributeCommonInfo &CommonInfo); |
5284 | static GuardedByAttr *Create(ASTContext &Ctx, Expr * Arg, const AttributeCommonInfo &CommonInfo); |
5285 | static GuardedByAttr *CreateImplicit(ASTContext &Ctx, Expr * Arg, SourceRange Range = {}); |
5286 | static GuardedByAttr *Create(ASTContext &Ctx, Expr * Arg, SourceRange Range = {}); |
5287 | |
5288 | // Constructors |
5289 | GuardedByAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
5290 | , Expr * Arg |
5291 | ); |
5292 | |
5293 | GuardedByAttr *clone(ASTContext &C) const; |
5294 | void printPretty(raw_ostream &OS, |
5295 | const PrintingPolicy &Policy) const; |
5296 | const char *getSpelling() const; |
5297 | Expr * getArg() const { |
5298 | return arg; |
5299 | } |
5300 | |
5301 | |
5302 | |
5303 | static bool classof(const Attr *A) { return A->getKind() == attr::GuardedBy; } |
5304 | }; |
5305 | |
5306 | class GuardedVarAttr : public InheritableAttr { |
5307 | public: |
5308 | enum Spelling { |
5309 | GNU_guarded_var = 0, |
5310 | CXX11_clang_guarded_var = 1, |
5311 | SpellingNotCalculated = 15 |
5312 | |
5313 | }; |
5314 | |
5315 | // Factory methods |
5316 | static GuardedVarAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
5317 | static GuardedVarAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
5318 | static GuardedVarAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_guarded_var); |
5319 | static GuardedVarAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_guarded_var); |
5320 | |
5321 | // Constructors |
5322 | GuardedVarAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
5323 | ); |
5324 | |
5325 | GuardedVarAttr *clone(ASTContext &C) const; |
5326 | void printPretty(raw_ostream &OS, |
5327 | const PrintingPolicy &Policy) const; |
5328 | const char *getSpelling() const; |
5329 | |
5330 | |
5331 | static bool classof(const Attr *A) { return A->getKind() == attr::GuardedVar; } |
5332 | }; |
5333 | |
5334 | class HIPManagedAttr : public InheritableAttr { |
5335 | public: |
5336 | enum Spelling { |
5337 | GNU_managed = 0, |
5338 | Declspec_managed = 1, |
5339 | SpellingNotCalculated = 15 |
5340 | |
5341 | }; |
5342 | |
5343 | // Factory methods |
5344 | static HIPManagedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
5345 | static HIPManagedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
5346 | static HIPManagedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_managed); |
5347 | static HIPManagedAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_managed); |
5348 | |
5349 | // Constructors |
5350 | HIPManagedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
5351 | ); |
5352 | |
5353 | HIPManagedAttr *clone(ASTContext &C) const; |
5354 | void printPretty(raw_ostream &OS, |
5355 | const PrintingPolicy &Policy) const; |
5356 | const char *getSpelling() const; |
5357 | |
5358 | |
5359 | static bool classof(const Attr *A) { return A->getKind() == attr::HIPManaged; } |
5360 | }; |
5361 | |
5362 | class HLSLGroupSharedAddressSpaceAttr : public TypeAttr { |
5363 | public: |
5364 | // Factory methods |
5365 | static HLSLGroupSharedAddressSpaceAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
5366 | static HLSLGroupSharedAddressSpaceAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
5367 | static HLSLGroupSharedAddressSpaceAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
5368 | static HLSLGroupSharedAddressSpaceAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
5369 | |
5370 | // Constructors |
5371 | HLSLGroupSharedAddressSpaceAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
5372 | ); |
5373 | |
5374 | HLSLGroupSharedAddressSpaceAttr *clone(ASTContext &C) const; |
5375 | void printPretty(raw_ostream &OS, |
5376 | const PrintingPolicy &Policy) const; |
5377 | const char *getSpelling() const; |
5378 | |
5379 | |
5380 | static bool classof(const Attr *A) { return A->getKind() == attr::HLSLGroupSharedAddressSpace; } |
5381 | }; |
5382 | |
5383 | class HLSLLoopHintAttr : public StmtAttr { |
5384 | unsigned directive; |
5385 | |
5386 | public: |
5387 | enum Spelling { |
5388 | Microsoft_unroll = 0, |
5389 | Microsoft_loop = 1, |
5390 | SpellingNotCalculated = 15 |
5391 | |
5392 | }; |
5393 | |
5394 | // Factory methods |
5395 | static HLSLLoopHintAttr *CreateImplicit(ASTContext &Ctx, unsigned Directive, const AttributeCommonInfo &CommonInfo); |
5396 | static HLSLLoopHintAttr *Create(ASTContext &Ctx, unsigned Directive, const AttributeCommonInfo &CommonInfo); |
5397 | static HLSLLoopHintAttr *CreateImplicit(ASTContext &Ctx, unsigned Directive, SourceRange Range = {}, Spelling S = Microsoft_unroll); |
5398 | static HLSLLoopHintAttr *Create(ASTContext &Ctx, unsigned Directive, SourceRange Range = {}, Spelling S = Microsoft_unroll); |
5399 | |
5400 | // Constructors |
5401 | HLSLLoopHintAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
5402 | , unsigned Directive |
5403 | ); |
5404 | HLSLLoopHintAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
5405 | ); |
5406 | |
5407 | HLSLLoopHintAttr *clone(ASTContext &C) const; |
5408 | void printPretty(raw_ostream &OS, |
5409 | const PrintingPolicy &Policy) const; |
5410 | const char *getSpelling() const; |
5411 | Spelling getSemanticSpelling() const; |
5412 | unsigned getDirective() const { |
5413 | return directive; |
5414 | } |
5415 | |
5416 | |
5417 | |
5418 | static bool classof(const Attr *A) { return A->getKind() == attr::HLSLLoopHint; } |
5419 | }; |
5420 | |
5421 | class HLSLNumThreadsAttr : public InheritableAttr { |
5422 | int x; |
5423 | |
5424 | int y; |
5425 | |
5426 | int z; |
5427 | |
5428 | public: |
5429 | // Factory methods |
5430 | static HLSLNumThreadsAttr *CreateImplicit(ASTContext &Ctx, int X, int Y, int Z, const AttributeCommonInfo &CommonInfo); |
5431 | static HLSLNumThreadsAttr *Create(ASTContext &Ctx, int X, int Y, int Z, const AttributeCommonInfo &CommonInfo); |
5432 | static HLSLNumThreadsAttr *CreateImplicit(ASTContext &Ctx, int X, int Y, int Z, SourceRange Range = {}); |
5433 | static HLSLNumThreadsAttr *Create(ASTContext &Ctx, int X, int Y, int Z, SourceRange Range = {}); |
5434 | |
5435 | // Constructors |
5436 | HLSLNumThreadsAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
5437 | , int X |
5438 | , int Y |
5439 | , int Z |
5440 | ); |
5441 | |
5442 | HLSLNumThreadsAttr *clone(ASTContext &C) const; |
5443 | void printPretty(raw_ostream &OS, |
5444 | const PrintingPolicy &Policy) const; |
5445 | const char *getSpelling() const; |
5446 | int getX() const { |
5447 | return x; |
5448 | } |
5449 | |
5450 | int getY() const { |
5451 | return y; |
5452 | } |
5453 | |
5454 | int getZ() const { |
5455 | return z; |
5456 | } |
5457 | |
5458 | |
5459 | |
5460 | static bool classof(const Attr *A) { return A->getKind() == attr::HLSLNumThreads; } |
5461 | }; |
5462 | |
5463 | class HLSLPackOffsetAttr : public HLSLAnnotationAttr { |
5464 | int subcomponent; |
5465 | |
5466 | int component; |
5467 | |
5468 | public: |
5469 | // Factory methods |
5470 | static HLSLPackOffsetAttr *CreateImplicit(ASTContext &Ctx, int Subcomponent, int Component, const AttributeCommonInfo &CommonInfo); |
5471 | static HLSLPackOffsetAttr *Create(ASTContext &Ctx, int Subcomponent, int Component, const AttributeCommonInfo &CommonInfo); |
5472 | static HLSLPackOffsetAttr *CreateImplicit(ASTContext &Ctx, int Subcomponent, int Component, SourceRange Range = {}); |
5473 | static HLSLPackOffsetAttr *Create(ASTContext &Ctx, int Subcomponent, int Component, SourceRange Range = {}); |
5474 | |
5475 | // Constructors |
5476 | HLSLPackOffsetAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
5477 | , int Subcomponent |
5478 | , int Component |
5479 | ); |
5480 | |
5481 | HLSLPackOffsetAttr *clone(ASTContext &C) const; |
5482 | void printPretty(raw_ostream &OS, |
5483 | const PrintingPolicy &Policy) const; |
5484 | const char *getSpelling() const; |
5485 | int getSubcomponent() const { |
5486 | return subcomponent; |
5487 | } |
5488 | |
5489 | int getComponent() const { |
5490 | return component; |
5491 | } |
5492 | |
5493 | |
5494 | unsigned getOffset() { |
5495 | return subcomponent * 4 + component; |
5496 | } |
5497 | |
5498 | |
5499 | static bool classof(const Attr *A) { return A->getKind() == attr::HLSLPackOffset; } |
5500 | }; |
5501 | |
5502 | class HLSLParamModifierAttr : public TypeAttr { |
5503 | bool mergedSpelling; |
5504 | |
5505 | public: |
5506 | enum Spelling { |
5507 | Keyword_in = 0, |
5508 | Keyword_inout = 1, |
5509 | Keyword_out = 2, |
5510 | SpellingNotCalculated = 15 |
5511 | |
5512 | }; |
5513 | |
5514 | // Factory methods |
5515 | static HLSLParamModifierAttr *CreateImplicit(ASTContext &Ctx, bool MergedSpelling, const AttributeCommonInfo &CommonInfo); |
5516 | static HLSLParamModifierAttr *Create(ASTContext &Ctx, bool MergedSpelling, const AttributeCommonInfo &CommonInfo); |
5517 | static HLSLParamModifierAttr *CreateImplicit(ASTContext &Ctx, bool MergedSpelling, SourceRange Range = {}, Spelling S = Keyword_in); |
5518 | static HLSLParamModifierAttr *Create(ASTContext &Ctx, bool MergedSpelling, SourceRange Range = {}, Spelling S = Keyword_in); |
5519 | static HLSLParamModifierAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
5520 | static HLSLParamModifierAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
5521 | static HLSLParamModifierAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = Keyword_in); |
5522 | static HLSLParamModifierAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = Keyword_in); |
5523 | |
5524 | // Constructors |
5525 | HLSLParamModifierAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
5526 | , bool MergedSpelling |
5527 | ); |
5528 | HLSLParamModifierAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
5529 | ); |
5530 | |
5531 | HLSLParamModifierAttr *clone(ASTContext &C) const; |
5532 | void printPretty(raw_ostream &OS, |
5533 | const PrintingPolicy &Policy) const; |
5534 | const char *getSpelling() const; |
5535 | Spelling getSemanticSpelling() const; |
5536 | bool isIn() const { return getAttributeSpellingListIndex() == 0; } |
5537 | bool isInOut() const { return getAttributeSpellingListIndex() == 1; } |
5538 | bool isOut() const { return getAttributeSpellingListIndex() == 2; } |
5539 | bool isAnyOut() const { return getAttributeSpellingListIndex() == 2 || |
5540 | getAttributeSpellingListIndex() == 1; } |
5541 | bool isAnyIn() const { return getAttributeSpellingListIndex() == 0 || |
5542 | getAttributeSpellingListIndex() == 1; } |
5543 | bool getMergedSpelling() const { |
5544 | return mergedSpelling; |
5545 | } |
5546 | |
5547 | static const bool DefaultMergedSpelling = false; |
5548 | |
5549 | |
5550 | |
5551 | static bool classof(const Attr *A) { return A->getKind() == attr::HLSLParamModifier; } |
5552 | }; |
5553 | |
5554 | class HLSLResourceAttr : public InheritableAttr { |
5555 | private: |
5556 | llvm::hlsl::ResourceKind resourceKind; |
5557 | |
5558 | bool isROV; |
5559 | |
5560 | public: |
5561 | // Factory methods |
5562 | static HLSLResourceAttr *CreateImplicit(ASTContext &Ctx, llvm::hlsl::ResourceKind ResourceKind, bool IsROV, const AttributeCommonInfo &CommonInfo); |
5563 | static HLSLResourceAttr *Create(ASTContext &Ctx, llvm::hlsl::ResourceKind ResourceKind, bool IsROV, const AttributeCommonInfo &CommonInfo); |
5564 | static HLSLResourceAttr *CreateImplicit(ASTContext &Ctx, llvm::hlsl::ResourceKind ResourceKind, bool IsROV, SourceRange Range = {}); |
5565 | static HLSLResourceAttr *Create(ASTContext &Ctx, llvm::hlsl::ResourceKind ResourceKind, bool IsROV, SourceRange Range = {}); |
5566 | |
5567 | // Constructors |
5568 | HLSLResourceAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
5569 | , llvm::hlsl::ResourceKind ResourceKind |
5570 | , bool IsROV |
5571 | ); |
5572 | HLSLResourceAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
5573 | , llvm::hlsl::ResourceKind ResourceKind |
5574 | ); |
5575 | |
5576 | HLSLResourceAttr *clone(ASTContext &C) const; |
5577 | void printPretty(raw_ostream &OS, |
5578 | const PrintingPolicy &Policy) const; |
5579 | const char *getSpelling() const; |
5580 | llvm::hlsl::ResourceKind getResourceKind() const { |
5581 | return resourceKind; |
5582 | } |
5583 | |
5584 | static bool ConvertStrToResourceKind(StringRef Val, llvm::hlsl::ResourceKind &Out); |
5585 | static const char *ConvertResourceKindToStr(llvm::hlsl::ResourceKind Val); |
5586 | bool getIsROV() const { |
5587 | return isROV; |
5588 | } |
5589 | |
5590 | static const bool DefaultIsROV = false; |
5591 | |
5592 | |
5593 | |
5594 | static bool classof(const Attr *A) { return A->getKind() == attr::HLSLResource; } |
5595 | }; |
5596 | |
5597 | class HLSLResourceBindingAttr : public InheritableAttr { |
5598 | unsigned slotLength; |
5599 | char *slot; |
5600 | |
5601 | unsigned spaceLength; |
5602 | char *space; |
5603 | |
5604 | public: |
5605 | // Factory methods |
5606 | static HLSLResourceBindingAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Slot, llvm::StringRef Space, const AttributeCommonInfo &CommonInfo); |
5607 | static HLSLResourceBindingAttr *Create(ASTContext &Ctx, llvm::StringRef Slot, llvm::StringRef Space, const AttributeCommonInfo &CommonInfo); |
5608 | static HLSLResourceBindingAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Slot, llvm::StringRef Space, SourceRange Range = {}); |
5609 | static HLSLResourceBindingAttr *Create(ASTContext &Ctx, llvm::StringRef Slot, llvm::StringRef Space, SourceRange Range = {}); |
5610 | |
5611 | // Constructors |
5612 | HLSLResourceBindingAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
5613 | , llvm::StringRef Slot |
5614 | , llvm::StringRef Space |
5615 | ); |
5616 | HLSLResourceBindingAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
5617 | , llvm::StringRef Slot |
5618 | ); |
5619 | |
5620 | HLSLResourceBindingAttr *clone(ASTContext &C) const; |
5621 | void printPretty(raw_ostream &OS, |
5622 | const PrintingPolicy &Policy) const; |
5623 | const char *getSpelling() const; |
5624 | llvm::StringRef getSlot() const { |
5625 | return llvm::StringRef(slot, slotLength); |
5626 | } |
5627 | unsigned getSlotLength() const { |
5628 | return slotLength; |
5629 | } |
5630 | void setSlot(ASTContext &C, llvm::StringRef S) { |
5631 | slotLength = S.size(); |
5632 | this->slot = new (C, 1) char [slotLength]; |
5633 | if (!S.empty()) |
5634 | std::memcpy(dest: this->slot, src: S.data(), n: slotLength); |
5635 | } |
5636 | |
5637 | llvm::StringRef getSpace() const { |
5638 | return llvm::StringRef(space, spaceLength); |
5639 | } |
5640 | unsigned getSpaceLength() const { |
5641 | return spaceLength; |
5642 | } |
5643 | void setSpace(ASTContext &C, llvm::StringRef S) { |
5644 | spaceLength = S.size(); |
5645 | this->space = new (C, 1) char [spaceLength]; |
5646 | if (!S.empty()) |
5647 | std::memcpy(dest: this->space, src: S.data(), n: spaceLength); |
5648 | } |
5649 | |
5650 | |
5651 | |
5652 | static bool classof(const Attr *A) { return A->getKind() == attr::HLSLResourceBinding; } |
5653 | }; |
5654 | |
5655 | class HLSLResourceClassAttr : public InheritableAttr { |
5656 | private: |
5657 | llvm::hlsl::ResourceClass resourceClass; |
5658 | |
5659 | public: |
5660 | // Factory methods |
5661 | static HLSLResourceClassAttr *CreateImplicit(ASTContext &Ctx, llvm::hlsl::ResourceClass ResourceClass, const AttributeCommonInfo &CommonInfo); |
5662 | static HLSLResourceClassAttr *Create(ASTContext &Ctx, llvm::hlsl::ResourceClass ResourceClass, const AttributeCommonInfo &CommonInfo); |
5663 | static HLSLResourceClassAttr *CreateImplicit(ASTContext &Ctx, llvm::hlsl::ResourceClass ResourceClass, SourceRange Range = {}); |
5664 | static HLSLResourceClassAttr *Create(ASTContext &Ctx, llvm::hlsl::ResourceClass ResourceClass, SourceRange Range = {}); |
5665 | |
5666 | // Constructors |
5667 | HLSLResourceClassAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
5668 | , llvm::hlsl::ResourceClass ResourceClass |
5669 | ); |
5670 | |
5671 | HLSLResourceClassAttr *clone(ASTContext &C) const; |
5672 | void printPretty(raw_ostream &OS, |
5673 | const PrintingPolicy &Policy) const; |
5674 | const char *getSpelling() const; |
5675 | llvm::hlsl::ResourceClass getResourceClass() const { |
5676 | return resourceClass; |
5677 | } |
5678 | |
5679 | static bool ConvertStrToResourceClass(StringRef Val, llvm::hlsl::ResourceClass &Out); |
5680 | static const char *ConvertResourceClassToStr(llvm::hlsl::ResourceClass Val); |
5681 | |
5682 | |
5683 | static bool classof(const Attr *A) { return A->getKind() == attr::HLSLResourceClass; } |
5684 | }; |
5685 | |
5686 | class HLSLSV_DispatchThreadIDAttr : public HLSLAnnotationAttr { |
5687 | public: |
5688 | // Factory methods |
5689 | static HLSLSV_DispatchThreadIDAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
5690 | static HLSLSV_DispatchThreadIDAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
5691 | static HLSLSV_DispatchThreadIDAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
5692 | static HLSLSV_DispatchThreadIDAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
5693 | |
5694 | // Constructors |
5695 | HLSLSV_DispatchThreadIDAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
5696 | ); |
5697 | |
5698 | HLSLSV_DispatchThreadIDAttr *clone(ASTContext &C) const; |
5699 | void printPretty(raw_ostream &OS, |
5700 | const PrintingPolicy &Policy) const; |
5701 | const char *getSpelling() const; |
5702 | |
5703 | |
5704 | static bool classof(const Attr *A) { return A->getKind() == attr::HLSLSV_DispatchThreadID; } |
5705 | }; |
5706 | |
5707 | class HLSLSV_GroupIndexAttr : public HLSLAnnotationAttr { |
5708 | public: |
5709 | // Factory methods |
5710 | static HLSLSV_GroupIndexAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
5711 | static HLSLSV_GroupIndexAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
5712 | static HLSLSV_GroupIndexAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
5713 | static HLSLSV_GroupIndexAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
5714 | |
5715 | // Constructors |
5716 | HLSLSV_GroupIndexAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
5717 | ); |
5718 | |
5719 | HLSLSV_GroupIndexAttr *clone(ASTContext &C) const; |
5720 | void printPretty(raw_ostream &OS, |
5721 | const PrintingPolicy &Policy) const; |
5722 | const char *getSpelling() const; |
5723 | |
5724 | |
5725 | static bool classof(const Attr *A) { return A->getKind() == attr::HLSLSV_GroupIndex; } |
5726 | }; |
5727 | |
5728 | class HLSLShaderAttr : public InheritableAttr { |
5729 | private: |
5730 | llvm::Triple::EnvironmentType type; |
5731 | |
5732 | public: |
5733 | // Factory methods |
5734 | static HLSLShaderAttr *CreateImplicit(ASTContext &Ctx, llvm::Triple::EnvironmentType Type, const AttributeCommonInfo &CommonInfo); |
5735 | static HLSLShaderAttr *Create(ASTContext &Ctx, llvm::Triple::EnvironmentType Type, const AttributeCommonInfo &CommonInfo); |
5736 | static HLSLShaderAttr *CreateImplicit(ASTContext &Ctx, llvm::Triple::EnvironmentType Type, SourceRange Range = {}); |
5737 | static HLSLShaderAttr *Create(ASTContext &Ctx, llvm::Triple::EnvironmentType Type, SourceRange Range = {}); |
5738 | |
5739 | // Constructors |
5740 | HLSLShaderAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
5741 | , llvm::Triple::EnvironmentType Type |
5742 | ); |
5743 | |
5744 | HLSLShaderAttr *clone(ASTContext &C) const; |
5745 | void printPretty(raw_ostream &OS, |
5746 | const PrintingPolicy &Policy) const; |
5747 | const char *getSpelling() const; |
5748 | llvm::Triple::EnvironmentType getType() const { |
5749 | return type; |
5750 | } |
5751 | |
5752 | static bool ConvertStrToEnvironmentType(StringRef Val, llvm::Triple::EnvironmentType &Out); |
5753 | static const char *ConvertEnvironmentTypeToStr(llvm::Triple::EnvironmentType Val); |
5754 | |
5755 | static bool isValidShaderType(llvm::Triple::EnvironmentType ShaderType) { |
5756 | return ShaderType >= llvm::Triple::Pixel && ShaderType <= llvm::Triple::Amplification; |
5757 | } |
5758 | |
5759 | |
5760 | static bool classof(const Attr *A) { return A->getKind() == attr::HLSLShader; } |
5761 | }; |
5762 | |
5763 | class HotAttr : public InheritableAttr { |
5764 | public: |
5765 | enum Spelling { |
5766 | GNU_hot = 0, |
5767 | CXX11_gnu_hot = 1, |
5768 | C23_gnu_hot = 2, |
5769 | SpellingNotCalculated = 15 |
5770 | |
5771 | }; |
5772 | |
5773 | // Factory methods |
5774 | static HotAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
5775 | static HotAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
5776 | static HotAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_hot); |
5777 | static HotAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_hot); |
5778 | |
5779 | // Constructors |
5780 | HotAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
5781 | ); |
5782 | |
5783 | HotAttr *clone(ASTContext &C) const; |
5784 | void printPretty(raw_ostream &OS, |
5785 | const PrintingPolicy &Policy) const; |
5786 | const char *getSpelling() const; |
5787 | |
5788 | |
5789 | static bool classof(const Attr *A) { return A->getKind() == attr::Hot; } |
5790 | }; |
5791 | |
5792 | class HybridPatchableAttr : public InheritableAttr { |
5793 | public: |
5794 | enum Spelling { |
5795 | Declspec_hybrid_patchable = 0, |
5796 | GNU_hybrid_patchable = 1, |
5797 | CXX11_clang_hybrid_patchable = 2, |
5798 | C23_clang_hybrid_patchable = 3, |
5799 | SpellingNotCalculated = 15 |
5800 | |
5801 | }; |
5802 | |
5803 | // Factory methods |
5804 | static HybridPatchableAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
5805 | static HybridPatchableAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
5806 | static HybridPatchableAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = Declspec_hybrid_patchable); |
5807 | static HybridPatchableAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = Declspec_hybrid_patchable); |
5808 | |
5809 | // Constructors |
5810 | HybridPatchableAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
5811 | ); |
5812 | |
5813 | HybridPatchableAttr *clone(ASTContext &C) const; |
5814 | void printPretty(raw_ostream &OS, |
5815 | const PrintingPolicy &Policy) const; |
5816 | const char *getSpelling() const; |
5817 | |
5818 | |
5819 | static bool classof(const Attr *A) { return A->getKind() == attr::HybridPatchable; } |
5820 | }; |
5821 | |
5822 | class IBActionAttr : public InheritableAttr { |
5823 | public: |
5824 | enum Spelling { |
5825 | GNU_ibaction = 0, |
5826 | CXX11_clang_ibaction = 1, |
5827 | C23_clang_ibaction = 2, |
5828 | SpellingNotCalculated = 15 |
5829 | |
5830 | }; |
5831 | |
5832 | // Factory methods |
5833 | static IBActionAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
5834 | static IBActionAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
5835 | static IBActionAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_ibaction); |
5836 | static IBActionAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_ibaction); |
5837 | |
5838 | // Constructors |
5839 | IBActionAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
5840 | ); |
5841 | |
5842 | IBActionAttr *clone(ASTContext &C) const; |
5843 | void printPretty(raw_ostream &OS, |
5844 | const PrintingPolicy &Policy) const; |
5845 | const char *getSpelling() const; |
5846 | |
5847 | |
5848 | static bool classof(const Attr *A) { return A->getKind() == attr::IBAction; } |
5849 | }; |
5850 | |
5851 | class IBOutletAttr : public InheritableAttr { |
5852 | public: |
5853 | enum Spelling { |
5854 | GNU_iboutlet = 0, |
5855 | CXX11_clang_iboutlet = 1, |
5856 | C23_clang_iboutlet = 2, |
5857 | SpellingNotCalculated = 15 |
5858 | |
5859 | }; |
5860 | |
5861 | // Factory methods |
5862 | static IBOutletAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
5863 | static IBOutletAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
5864 | static IBOutletAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_iboutlet); |
5865 | static IBOutletAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_iboutlet); |
5866 | |
5867 | // Constructors |
5868 | IBOutletAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
5869 | ); |
5870 | |
5871 | IBOutletAttr *clone(ASTContext &C) const; |
5872 | void printPretty(raw_ostream &OS, |
5873 | const PrintingPolicy &Policy) const; |
5874 | const char *getSpelling() const; |
5875 | |
5876 | |
5877 | static bool classof(const Attr *A) { return A->getKind() == attr::IBOutlet; } |
5878 | }; |
5879 | |
5880 | class IBOutletCollectionAttr : public InheritableAttr { |
5881 | TypeSourceInfo * interface_; |
5882 | |
5883 | public: |
5884 | enum Spelling { |
5885 | GNU_iboutletcollection = 0, |
5886 | CXX11_clang_iboutletcollection = 1, |
5887 | C23_clang_iboutletcollection = 2, |
5888 | SpellingNotCalculated = 15 |
5889 | |
5890 | }; |
5891 | |
5892 | // Factory methods |
5893 | static IBOutletCollectionAttr *CreateImplicit(ASTContext &Ctx, TypeSourceInfo * Interface, const AttributeCommonInfo &CommonInfo); |
5894 | static IBOutletCollectionAttr *Create(ASTContext &Ctx, TypeSourceInfo * Interface, const AttributeCommonInfo &CommonInfo); |
5895 | static IBOutletCollectionAttr *CreateImplicit(ASTContext &Ctx, TypeSourceInfo * Interface, SourceRange Range = {}, Spelling S = GNU_iboutletcollection); |
5896 | static IBOutletCollectionAttr *Create(ASTContext &Ctx, TypeSourceInfo * Interface, SourceRange Range = {}, Spelling S = GNU_iboutletcollection); |
5897 | |
5898 | // Constructors |
5899 | IBOutletCollectionAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
5900 | , TypeSourceInfo * Interface |
5901 | ); |
5902 | IBOutletCollectionAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
5903 | ); |
5904 | |
5905 | IBOutletCollectionAttr *clone(ASTContext &C) const; |
5906 | void printPretty(raw_ostream &OS, |
5907 | const PrintingPolicy &Policy) const; |
5908 | const char *getSpelling() const; |
5909 | QualType getInterface() const { |
5910 | return interface_->getType(); |
5911 | } TypeSourceInfo * getInterfaceLoc() const { |
5912 | return interface_; |
5913 | } |
5914 | |
5915 | |
5916 | |
5917 | static bool classof(const Attr *A) { return A->getKind() == attr::IBOutletCollection; } |
5918 | }; |
5919 | |
5920 | class IFuncAttr : public Attr { |
5921 | unsigned resolverLength; |
5922 | char *resolver; |
5923 | |
5924 | public: |
5925 | enum Spelling { |
5926 | GNU_ifunc = 0, |
5927 | CXX11_gnu_ifunc = 1, |
5928 | C23_gnu_ifunc = 2, |
5929 | SpellingNotCalculated = 15 |
5930 | |
5931 | }; |
5932 | |
5933 | // Factory methods |
5934 | static IFuncAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Resolver, const AttributeCommonInfo &CommonInfo); |
5935 | static IFuncAttr *Create(ASTContext &Ctx, llvm::StringRef Resolver, const AttributeCommonInfo &CommonInfo); |
5936 | static IFuncAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Resolver, SourceRange Range = {}, Spelling S = GNU_ifunc); |
5937 | static IFuncAttr *Create(ASTContext &Ctx, llvm::StringRef Resolver, SourceRange Range = {}, Spelling S = GNU_ifunc); |
5938 | |
5939 | // Constructors |
5940 | IFuncAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
5941 | , llvm::StringRef Resolver |
5942 | ); |
5943 | |
5944 | IFuncAttr *clone(ASTContext &C) const; |
5945 | void printPretty(raw_ostream &OS, |
5946 | const PrintingPolicy &Policy) const; |
5947 | const char *getSpelling() const; |
5948 | llvm::StringRef getResolver() const { |
5949 | return llvm::StringRef(resolver, resolverLength); |
5950 | } |
5951 | unsigned getResolverLength() const { |
5952 | return resolverLength; |
5953 | } |
5954 | void setResolver(ASTContext &C, llvm::StringRef S) { |
5955 | resolverLength = S.size(); |
5956 | this->resolver = new (C, 1) char [resolverLength]; |
5957 | if (!S.empty()) |
5958 | std::memcpy(dest: this->resolver, src: S.data(), n: resolverLength); |
5959 | } |
5960 | |
5961 | |
5962 | |
5963 | static bool classof(const Attr *A) { return A->getKind() == attr::IFunc; } |
5964 | }; |
5965 | |
5966 | class InitPriorityAttr : public InheritableAttr { |
5967 | unsigned priority; |
5968 | |
5969 | public: |
5970 | enum Spelling { |
5971 | GNU_init_priority = 0, |
5972 | CXX11_gnu_init_priority = 1, |
5973 | SpellingNotCalculated = 15 |
5974 | |
5975 | }; |
5976 | |
5977 | // Factory methods |
5978 | static InitPriorityAttr *CreateImplicit(ASTContext &Ctx, unsigned Priority, const AttributeCommonInfo &CommonInfo); |
5979 | static InitPriorityAttr *Create(ASTContext &Ctx, unsigned Priority, const AttributeCommonInfo &CommonInfo); |
5980 | static InitPriorityAttr *CreateImplicit(ASTContext &Ctx, unsigned Priority, SourceRange Range = {}, Spelling S = GNU_init_priority); |
5981 | static InitPriorityAttr *Create(ASTContext &Ctx, unsigned Priority, SourceRange Range = {}, Spelling S = GNU_init_priority); |
5982 | |
5983 | // Constructors |
5984 | InitPriorityAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
5985 | , unsigned Priority |
5986 | ); |
5987 | |
5988 | InitPriorityAttr *clone(ASTContext &C) const; |
5989 | void printPretty(raw_ostream &OS, |
5990 | const PrintingPolicy &Policy) const; |
5991 | const char *getSpelling() const; |
5992 | unsigned getPriority() const { |
5993 | return priority; |
5994 | } |
5995 | |
5996 | |
5997 | |
5998 | static bool classof(const Attr *A) { return A->getKind() == attr::InitPriority; } |
5999 | }; |
6000 | |
6001 | class InitSegAttr : public Attr { |
6002 | unsigned sectionLength; |
6003 | char *section; |
6004 | |
6005 | public: |
6006 | // Factory methods |
6007 | static InitSegAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Section, const AttributeCommonInfo &CommonInfo); |
6008 | static InitSegAttr *Create(ASTContext &Ctx, llvm::StringRef Section, const AttributeCommonInfo &CommonInfo); |
6009 | static InitSegAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Section, SourceRange Range = {}); |
6010 | static InitSegAttr *Create(ASTContext &Ctx, llvm::StringRef Section, SourceRange Range = {}); |
6011 | |
6012 | // Constructors |
6013 | InitSegAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
6014 | , llvm::StringRef Section |
6015 | ); |
6016 | |
6017 | InitSegAttr *clone(ASTContext &C) const; |
6018 | void printPretty(raw_ostream &OS, |
6019 | const PrintingPolicy &Policy) const; |
6020 | const char *getSpelling() const; |
6021 | llvm::StringRef getSection() const { |
6022 | return llvm::StringRef(section, sectionLength); |
6023 | } |
6024 | unsigned getSectionLength() const { |
6025 | return sectionLength; |
6026 | } |
6027 | void setSection(ASTContext &C, llvm::StringRef S) { |
6028 | sectionLength = S.size(); |
6029 | this->section = new (C, 1) char [sectionLength]; |
6030 | if (!S.empty()) |
6031 | std::memcpy(dest: this->section, src: S.data(), n: sectionLength); |
6032 | } |
6033 | |
6034 | |
6035 | void printPrettyPragma(raw_ostream &OS, const PrintingPolicy &Policy) const { |
6036 | OS << " (" << getSection() << ')'; |
6037 | } |
6038 | |
6039 | |
6040 | static bool classof(const Attr *A) { return A->getKind() == attr::InitSeg; } |
6041 | }; |
6042 | |
6043 | class IntelOclBiccAttr : public InheritableAttr { |
6044 | public: |
6045 | enum Spelling { |
6046 | GNU_intel_ocl_bicc = 0, |
6047 | CXX11_clang_intel_ocl_bicc = 1, |
6048 | SpellingNotCalculated = 15 |
6049 | |
6050 | }; |
6051 | |
6052 | // Factory methods |
6053 | static IntelOclBiccAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
6054 | static IntelOclBiccAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
6055 | static IntelOclBiccAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_intel_ocl_bicc); |
6056 | static IntelOclBiccAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_intel_ocl_bicc); |
6057 | |
6058 | // Constructors |
6059 | IntelOclBiccAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
6060 | ); |
6061 | |
6062 | IntelOclBiccAttr *clone(ASTContext &C) const; |
6063 | void printPretty(raw_ostream &OS, |
6064 | const PrintingPolicy &Policy) const; |
6065 | const char *getSpelling() const; |
6066 | |
6067 | |
6068 | static bool classof(const Attr *A) { return A->getKind() == attr::IntelOclBicc; } |
6069 | }; |
6070 | |
6071 | class InternalLinkageAttr : public InheritableAttr { |
6072 | public: |
6073 | enum Spelling { |
6074 | GNU_internal_linkage = 0, |
6075 | CXX11_clang_internal_linkage = 1, |
6076 | C23_clang_internal_linkage = 2, |
6077 | SpellingNotCalculated = 15 |
6078 | |
6079 | }; |
6080 | |
6081 | // Factory methods |
6082 | static InternalLinkageAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
6083 | static InternalLinkageAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
6084 | static InternalLinkageAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_internal_linkage); |
6085 | static InternalLinkageAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_internal_linkage); |
6086 | |
6087 | // Constructors |
6088 | InternalLinkageAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
6089 | ); |
6090 | |
6091 | InternalLinkageAttr *clone(ASTContext &C) const; |
6092 | void printPretty(raw_ostream &OS, |
6093 | const PrintingPolicy &Policy) const; |
6094 | const char *getSpelling() const; |
6095 | |
6096 | |
6097 | static bool classof(const Attr *A) { return A->getKind() == attr::InternalLinkage; } |
6098 | }; |
6099 | |
6100 | class LTOVisibilityPublicAttr : public InheritableAttr { |
6101 | public: |
6102 | enum Spelling { |
6103 | GNU_lto_visibility_public = 0, |
6104 | CXX11_clang_lto_visibility_public = 1, |
6105 | C23_clang_lto_visibility_public = 2, |
6106 | SpellingNotCalculated = 15 |
6107 | |
6108 | }; |
6109 | |
6110 | // Factory methods |
6111 | static LTOVisibilityPublicAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
6112 | static LTOVisibilityPublicAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
6113 | static LTOVisibilityPublicAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_lto_visibility_public); |
6114 | static LTOVisibilityPublicAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_lto_visibility_public); |
6115 | |
6116 | // Constructors |
6117 | LTOVisibilityPublicAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
6118 | ); |
6119 | |
6120 | LTOVisibilityPublicAttr *clone(ASTContext &C) const; |
6121 | void printPretty(raw_ostream &OS, |
6122 | const PrintingPolicy &Policy) const; |
6123 | const char *getSpelling() const; |
6124 | |
6125 | |
6126 | static bool classof(const Attr *A) { return A->getKind() == attr::LTOVisibilityPublic; } |
6127 | }; |
6128 | |
6129 | class LayoutVersionAttr : public InheritableAttr { |
6130 | unsigned version; |
6131 | |
6132 | public: |
6133 | // Factory methods |
6134 | static LayoutVersionAttr *CreateImplicit(ASTContext &Ctx, unsigned Version, const AttributeCommonInfo &CommonInfo); |
6135 | static LayoutVersionAttr *Create(ASTContext &Ctx, unsigned Version, const AttributeCommonInfo &CommonInfo); |
6136 | static LayoutVersionAttr *CreateImplicit(ASTContext &Ctx, unsigned Version, SourceRange Range = {}); |
6137 | static LayoutVersionAttr *Create(ASTContext &Ctx, unsigned Version, SourceRange Range = {}); |
6138 | |
6139 | // Constructors |
6140 | LayoutVersionAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
6141 | , unsigned Version |
6142 | ); |
6143 | |
6144 | LayoutVersionAttr *clone(ASTContext &C) const; |
6145 | void printPretty(raw_ostream &OS, |
6146 | const PrintingPolicy &Policy) const; |
6147 | const char *getSpelling() const; |
6148 | unsigned getVersion() const { |
6149 | return version; |
6150 | } |
6151 | |
6152 | |
6153 | |
6154 | static bool classof(const Attr *A) { return A->getKind() == attr::LayoutVersion; } |
6155 | }; |
6156 | |
6157 | class LeafAttr : public InheritableAttr { |
6158 | public: |
6159 | enum Spelling { |
6160 | GNU_leaf = 0, |
6161 | CXX11_gnu_leaf = 1, |
6162 | C23_gnu_leaf = 2, |
6163 | SpellingNotCalculated = 15 |
6164 | |
6165 | }; |
6166 | |
6167 | // Factory methods |
6168 | static LeafAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
6169 | static LeafAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
6170 | static LeafAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_leaf); |
6171 | static LeafAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_leaf); |
6172 | |
6173 | // Constructors |
6174 | LeafAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
6175 | ); |
6176 | |
6177 | LeafAttr *clone(ASTContext &C) const; |
6178 | void printPretty(raw_ostream &OS, |
6179 | const PrintingPolicy &Policy) const; |
6180 | const char *getSpelling() const; |
6181 | |
6182 | |
6183 | static bool classof(const Attr *A) { return A->getKind() == attr::Leaf; } |
6184 | }; |
6185 | |
6186 | class LifetimeBoundAttr : public InheritableAttr { |
6187 | public: |
6188 | enum Spelling { |
6189 | GNU_lifetimebound = 0, |
6190 | CXX11_clang_lifetimebound = 1, |
6191 | SpellingNotCalculated = 15 |
6192 | |
6193 | }; |
6194 | |
6195 | // Factory methods |
6196 | static LifetimeBoundAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
6197 | static LifetimeBoundAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
6198 | static LifetimeBoundAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_lifetimebound); |
6199 | static LifetimeBoundAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_lifetimebound); |
6200 | |
6201 | // Constructors |
6202 | LifetimeBoundAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
6203 | ); |
6204 | |
6205 | LifetimeBoundAttr *clone(ASTContext &C) const; |
6206 | void printPretty(raw_ostream &OS, |
6207 | const PrintingPolicy &Policy) const; |
6208 | const char *getSpelling() const; |
6209 | |
6210 | |
6211 | static bool classof(const Attr *A) { return A->getKind() == attr::LifetimeBound; } |
6212 | }; |
6213 | |
6214 | class LikelyAttr : public StmtAttr { |
6215 | public: |
6216 | enum Spelling { |
6217 | CXX11_likely = 0, |
6218 | C23_clang_likely = 1, |
6219 | SpellingNotCalculated = 15 |
6220 | |
6221 | }; |
6222 | |
6223 | // Factory methods |
6224 | static LikelyAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
6225 | static LikelyAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
6226 | static LikelyAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = CXX11_likely); |
6227 | static LikelyAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = CXX11_likely); |
6228 | |
6229 | // Constructors |
6230 | LikelyAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
6231 | ); |
6232 | |
6233 | LikelyAttr *clone(ASTContext &C) const; |
6234 | void printPretty(raw_ostream &OS, |
6235 | const PrintingPolicy &Policy) const; |
6236 | const char *getSpelling() const; |
6237 | |
6238 | |
6239 | static bool classof(const Attr *A) { return A->getKind() == attr::Likely; } |
6240 | }; |
6241 | |
6242 | class LoaderUninitializedAttr : public Attr { |
6243 | public: |
6244 | enum Spelling { |
6245 | GNU_loader_uninitialized = 0, |
6246 | CXX11_clang_loader_uninitialized = 1, |
6247 | C23_clang_loader_uninitialized = 2, |
6248 | SpellingNotCalculated = 15 |
6249 | |
6250 | }; |
6251 | |
6252 | // Factory methods |
6253 | static LoaderUninitializedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
6254 | static LoaderUninitializedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
6255 | static LoaderUninitializedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_loader_uninitialized); |
6256 | static LoaderUninitializedAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_loader_uninitialized); |
6257 | |
6258 | // Constructors |
6259 | LoaderUninitializedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
6260 | ); |
6261 | |
6262 | LoaderUninitializedAttr *clone(ASTContext &C) const; |
6263 | void printPretty(raw_ostream &OS, |
6264 | const PrintingPolicy &Policy) const; |
6265 | const char *getSpelling() const; |
6266 | |
6267 | |
6268 | static bool classof(const Attr *A) { return A->getKind() == attr::LoaderUninitialized; } |
6269 | }; |
6270 | |
6271 | class LockReturnedAttr : public InheritableAttr { |
6272 | Expr * arg; |
6273 | |
6274 | public: |
6275 | // Factory methods |
6276 | static LockReturnedAttr *CreateImplicit(ASTContext &Ctx, Expr * Arg, const AttributeCommonInfo &CommonInfo); |
6277 | static LockReturnedAttr *Create(ASTContext &Ctx, Expr * Arg, const AttributeCommonInfo &CommonInfo); |
6278 | static LockReturnedAttr *CreateImplicit(ASTContext &Ctx, Expr * Arg, SourceRange Range = {}); |
6279 | static LockReturnedAttr *Create(ASTContext &Ctx, Expr * Arg, SourceRange Range = {}); |
6280 | |
6281 | // Constructors |
6282 | LockReturnedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
6283 | , Expr * Arg |
6284 | ); |
6285 | |
6286 | LockReturnedAttr *clone(ASTContext &C) const; |
6287 | void printPretty(raw_ostream &OS, |
6288 | const PrintingPolicy &Policy) const; |
6289 | const char *getSpelling() const; |
6290 | Expr * getArg() const { |
6291 | return arg; |
6292 | } |
6293 | |
6294 | |
6295 | |
6296 | static bool classof(const Attr *A) { return A->getKind() == attr::LockReturned; } |
6297 | }; |
6298 | |
6299 | class LocksExcludedAttr : public InheritableAttr { |
6300 | unsigned args_Size; |
6301 | Expr * *args_; |
6302 | |
6303 | public: |
6304 | // Factory methods |
6305 | static LocksExcludedAttr *CreateImplicit(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo); |
6306 | static LocksExcludedAttr *Create(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo); |
6307 | static LocksExcludedAttr *CreateImplicit(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, SourceRange Range = {}); |
6308 | static LocksExcludedAttr *Create(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, SourceRange Range = {}); |
6309 | |
6310 | // Constructors |
6311 | LocksExcludedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
6312 | , Expr * *Args, unsigned ArgsSize |
6313 | ); |
6314 | LocksExcludedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
6315 | ); |
6316 | |
6317 | LocksExcludedAttr *clone(ASTContext &C) const; |
6318 | void printPretty(raw_ostream &OS, |
6319 | const PrintingPolicy &Policy) const; |
6320 | const char *getSpelling() const; |
6321 | typedef Expr ** args_iterator; |
6322 | args_iterator args_begin() const { return args_; } |
6323 | args_iterator args_end() const { return args_ + args_Size; } |
6324 | unsigned args_size() const { return args_Size; } |
6325 | llvm::iterator_range<args_iterator> args() const { return llvm::make_range(x: args_begin(), y: args_end()); } |
6326 | |
6327 | |
6328 | |
6329 | |
6330 | static bool classof(const Attr *A) { return A->getKind() == attr::LocksExcluded; } |
6331 | }; |
6332 | |
6333 | class LoopHintAttr : public Attr { |
6334 | public: |
6335 | enum OptionType { |
6336 | Vectorize, |
6337 | VectorizeWidth, |
6338 | Interleave, |
6339 | InterleaveCount, |
6340 | Unroll, |
6341 | UnrollCount, |
6342 | UnrollAndJam, |
6343 | UnrollAndJamCount, |
6344 | PipelineDisabled, |
6345 | PipelineInitiationInterval, |
6346 | Distribute, |
6347 | VectorizePredicate |
6348 | }; |
6349 | private: |
6350 | LoopHintAttr::OptionType option; |
6351 | |
6352 | public: |
6353 | enum LoopHintState { |
6354 | Enable, |
6355 | Disable, |
6356 | Numeric, |
6357 | FixedWidth, |
6358 | ScalableWidth, |
6359 | AssumeSafety, |
6360 | Full |
6361 | }; |
6362 | private: |
6363 | LoopHintAttr::LoopHintState state; |
6364 | |
6365 | Expr * value; |
6366 | |
6367 | public: |
6368 | enum Spelling { |
6369 | Pragma_clang_loop = 0, |
6370 | Pragma_unroll = 1, |
6371 | Pragma_nounroll = 2, |
6372 | Pragma_unroll_and_jam = 3, |
6373 | Pragma_nounroll_and_jam = 4, |
6374 | SpellingNotCalculated = 15 |
6375 | |
6376 | }; |
6377 | |
6378 | // Factory methods |
6379 | static LoopHintAttr *CreateImplicit(ASTContext &Ctx, LoopHintAttr::OptionType Option, LoopHintAttr::LoopHintState State, Expr * Value, const AttributeCommonInfo &CommonInfo); |
6380 | static LoopHintAttr *Create(ASTContext &Ctx, LoopHintAttr::OptionType Option, LoopHintAttr::LoopHintState State, Expr * Value, const AttributeCommonInfo &CommonInfo); |
6381 | static LoopHintAttr *CreateImplicit(ASTContext &Ctx, LoopHintAttr::OptionType Option, LoopHintAttr::LoopHintState State, Expr * Value, SourceRange Range = {}, Spelling S = Pragma_clang_loop); |
6382 | static LoopHintAttr *Create(ASTContext &Ctx, LoopHintAttr::OptionType Option, LoopHintAttr::LoopHintState State, Expr * Value, SourceRange Range = {}, Spelling S = Pragma_clang_loop); |
6383 | |
6384 | // Constructors |
6385 | LoopHintAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
6386 | , LoopHintAttr::OptionType Option |
6387 | , LoopHintAttr::LoopHintState State |
6388 | , Expr * Value |
6389 | ); |
6390 | |
6391 | LoopHintAttr *clone(ASTContext &C) const; |
6392 | void printPretty(raw_ostream &OS, |
6393 | const PrintingPolicy &Policy) const; |
6394 | const char *getSpelling() const; |
6395 | Spelling getSemanticSpelling() const; |
6396 | LoopHintAttr::OptionType getOption() const { |
6397 | return option; |
6398 | } |
6399 | |
6400 | static bool ConvertStrToOptionType(StringRef Val, LoopHintAttr::OptionType &Out); |
6401 | static const char *ConvertOptionTypeToStr(LoopHintAttr::OptionType Val); |
6402 | LoopHintAttr::LoopHintState getState() const { |
6403 | return state; |
6404 | } |
6405 | |
6406 | static bool ConvertStrToLoopHintState(StringRef Val, LoopHintAttr::LoopHintState &Out); |
6407 | static const char *ConvertLoopHintStateToStr(LoopHintAttr::LoopHintState Val); |
6408 | Expr * getValue() const { |
6409 | return value; |
6410 | } |
6411 | |
6412 | |
6413 | static const char *getOptionName(int Option) { |
6414 | switch(Option) { |
6415 | case Vectorize: return "vectorize" ; |
6416 | case VectorizeWidth: return "vectorize_width" ; |
6417 | case Interleave: return "interleave" ; |
6418 | case InterleaveCount: return "interleave_count" ; |
6419 | case Unroll: return "unroll" ; |
6420 | case UnrollCount: return "unroll_count" ; |
6421 | case UnrollAndJam: return "unroll_and_jam" ; |
6422 | case UnrollAndJamCount: return "unroll_and_jam_count" ; |
6423 | case PipelineDisabled: return "pipeline" ; |
6424 | case PipelineInitiationInterval: return "pipeline_initiation_interval" ; |
6425 | case Distribute: return "distribute" ; |
6426 | case VectorizePredicate: return "vectorize_predicate" ; |
6427 | } |
6428 | llvm_unreachable("Unhandled LoopHint option." ); |
6429 | } |
6430 | |
6431 | void printPrettyPragma(raw_ostream &OS, const PrintingPolicy &Policy) const; |
6432 | |
6433 | // Return a string containing the loop hint argument including the |
6434 | // enclosing parentheses. |
6435 | std::string getValueString(const PrintingPolicy &Policy) const; |
6436 | |
6437 | // Return a string suitable for identifying this attribute in diagnostics. |
6438 | std::string getDiagnosticName(const PrintingPolicy &Policy) const; |
6439 | |
6440 | |
6441 | static bool classof(const Attr *A) { return A->getKind() == attr::LoopHint; } |
6442 | }; |
6443 | |
6444 | class M68kInterruptAttr : public InheritableAttr { |
6445 | unsigned number; |
6446 | |
6447 | public: |
6448 | // Factory methods |
6449 | static M68kInterruptAttr *CreateImplicit(ASTContext &Ctx, unsigned Number, const AttributeCommonInfo &CommonInfo); |
6450 | static M68kInterruptAttr *Create(ASTContext &Ctx, unsigned Number, const AttributeCommonInfo &CommonInfo); |
6451 | static M68kInterruptAttr *CreateImplicit(ASTContext &Ctx, unsigned Number, SourceRange Range = {}); |
6452 | static M68kInterruptAttr *Create(ASTContext &Ctx, unsigned Number, SourceRange Range = {}); |
6453 | |
6454 | // Constructors |
6455 | M68kInterruptAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
6456 | , unsigned Number |
6457 | ); |
6458 | |
6459 | M68kInterruptAttr *clone(ASTContext &C) const; |
6460 | void printPretty(raw_ostream &OS, |
6461 | const PrintingPolicy &Policy) const; |
6462 | const char *getSpelling() const; |
6463 | unsigned getNumber() const { |
6464 | return number; |
6465 | } |
6466 | |
6467 | |
6468 | |
6469 | static bool classof(const Attr *A) { return A->getKind() == attr::M68kInterrupt; } |
6470 | }; |
6471 | |
6472 | class M68kRTDAttr : public InheritableAttr { |
6473 | public: |
6474 | enum Spelling { |
6475 | GNU_m68k_rtd = 0, |
6476 | CXX11_clang_m68k_rtd = 1, |
6477 | C23_clang_m68k_rtd = 2, |
6478 | SpellingNotCalculated = 15 |
6479 | |
6480 | }; |
6481 | |
6482 | // Factory methods |
6483 | static M68kRTDAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
6484 | static M68kRTDAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
6485 | static M68kRTDAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_m68k_rtd); |
6486 | static M68kRTDAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_m68k_rtd); |
6487 | |
6488 | // Constructors |
6489 | M68kRTDAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
6490 | ); |
6491 | |
6492 | M68kRTDAttr *clone(ASTContext &C) const; |
6493 | void printPretty(raw_ostream &OS, |
6494 | const PrintingPolicy &Policy) const; |
6495 | const char *getSpelling() const; |
6496 | |
6497 | |
6498 | static bool classof(const Attr *A) { return A->getKind() == attr::M68kRTD; } |
6499 | }; |
6500 | |
6501 | class MIGServerRoutineAttr : public InheritableAttr { |
6502 | public: |
6503 | enum Spelling { |
6504 | GNU_mig_server_routine = 0, |
6505 | CXX11_clang_mig_server_routine = 1, |
6506 | C23_clang_mig_server_routine = 2, |
6507 | SpellingNotCalculated = 15 |
6508 | |
6509 | }; |
6510 | |
6511 | // Factory methods |
6512 | static MIGServerRoutineAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
6513 | static MIGServerRoutineAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
6514 | static MIGServerRoutineAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_mig_server_routine); |
6515 | static MIGServerRoutineAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_mig_server_routine); |
6516 | |
6517 | // Constructors |
6518 | MIGServerRoutineAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
6519 | ); |
6520 | |
6521 | MIGServerRoutineAttr *clone(ASTContext &C) const; |
6522 | void printPretty(raw_ostream &OS, |
6523 | const PrintingPolicy &Policy) const; |
6524 | const char *getSpelling() const; |
6525 | |
6526 | |
6527 | static bool classof(const Attr *A) { return A->getKind() == attr::MIGServerRoutine; } |
6528 | }; |
6529 | |
6530 | class MSABIAttr : public InheritableAttr { |
6531 | public: |
6532 | enum Spelling { |
6533 | GNU_ms_abi = 0, |
6534 | CXX11_gnu_ms_abi = 1, |
6535 | C23_gnu_ms_abi = 2, |
6536 | SpellingNotCalculated = 15 |
6537 | |
6538 | }; |
6539 | |
6540 | // Factory methods |
6541 | static MSABIAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
6542 | static MSABIAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
6543 | static MSABIAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_ms_abi); |
6544 | static MSABIAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_ms_abi); |
6545 | |
6546 | // Constructors |
6547 | MSABIAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
6548 | ); |
6549 | |
6550 | MSABIAttr *clone(ASTContext &C) const; |
6551 | void printPretty(raw_ostream &OS, |
6552 | const PrintingPolicy &Policy) const; |
6553 | const char *getSpelling() const; |
6554 | |
6555 | |
6556 | static bool classof(const Attr *A) { return A->getKind() == attr::MSABI; } |
6557 | }; |
6558 | |
6559 | class MSAllocatorAttr : public InheritableAttr { |
6560 | public: |
6561 | // Factory methods |
6562 | static MSAllocatorAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
6563 | static MSAllocatorAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
6564 | static MSAllocatorAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
6565 | static MSAllocatorAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
6566 | |
6567 | // Constructors |
6568 | MSAllocatorAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
6569 | ); |
6570 | |
6571 | MSAllocatorAttr *clone(ASTContext &C) const; |
6572 | void printPretty(raw_ostream &OS, |
6573 | const PrintingPolicy &Policy) const; |
6574 | const char *getSpelling() const; |
6575 | |
6576 | |
6577 | static bool classof(const Attr *A) { return A->getKind() == attr::MSAllocator; } |
6578 | }; |
6579 | |
6580 | class MSConstexprAttr : public InheritableAttr { |
6581 | public: |
6582 | // Factory methods |
6583 | static MSConstexprAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
6584 | static MSConstexprAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
6585 | static MSConstexprAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
6586 | static MSConstexprAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
6587 | |
6588 | // Constructors |
6589 | MSConstexprAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
6590 | ); |
6591 | |
6592 | MSConstexprAttr *clone(ASTContext &C) const; |
6593 | void printPretty(raw_ostream &OS, |
6594 | const PrintingPolicy &Policy) const; |
6595 | const char *getSpelling() const; |
6596 | |
6597 | |
6598 | static bool classof(const Attr *A) { return A->getKind() == attr::MSConstexpr; } |
6599 | }; |
6600 | |
6601 | class MSInheritanceAttr : public InheritableAttr { |
6602 | bool bestCase; |
6603 | |
6604 | public: |
6605 | enum Spelling { |
6606 | Keyword_single_inheritance = 0, |
6607 | Keyword_multiple_inheritance = 1, |
6608 | Keyword_virtual_inheritance = 2, |
6609 | Keyword_unspecified_inheritance = 3, |
6610 | SpellingNotCalculated = 15 |
6611 | |
6612 | }; |
6613 | |
6614 | // Factory methods |
6615 | static MSInheritanceAttr *CreateImplicit(ASTContext &Ctx, bool BestCase, const AttributeCommonInfo &CommonInfo); |
6616 | static MSInheritanceAttr *Create(ASTContext &Ctx, bool BestCase, const AttributeCommonInfo &CommonInfo); |
6617 | static MSInheritanceAttr *CreateImplicit(ASTContext &Ctx, bool BestCase, SourceRange Range = {}, Spelling S = Keyword_single_inheritance); |
6618 | static MSInheritanceAttr *Create(ASTContext &Ctx, bool BestCase, SourceRange Range = {}, Spelling S = Keyword_single_inheritance); |
6619 | static MSInheritanceAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
6620 | static MSInheritanceAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
6621 | static MSInheritanceAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = Keyword_single_inheritance); |
6622 | static MSInheritanceAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = Keyword_single_inheritance); |
6623 | |
6624 | // Constructors |
6625 | MSInheritanceAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
6626 | , bool BestCase |
6627 | ); |
6628 | MSInheritanceAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
6629 | ); |
6630 | |
6631 | MSInheritanceAttr *clone(ASTContext &C) const; |
6632 | void printPretty(raw_ostream &OS, |
6633 | const PrintingPolicy &Policy) const; |
6634 | const char *getSpelling() const; |
6635 | Spelling getSemanticSpelling() const; |
6636 | bool getBestCase() const { |
6637 | return bestCase; |
6638 | } |
6639 | |
6640 | static const bool DefaultBestCase = true; |
6641 | |
6642 | |
6643 | MSInheritanceModel getInheritanceModel() const { |
6644 | // The spelling enum should agree with MSInheritanceModel. |
6645 | return MSInheritanceModel(getSemanticSpelling()); |
6646 | } |
6647 | |
6648 | |
6649 | static bool classof(const Attr *A) { return A->getKind() == attr::MSInheritance; } |
6650 | }; |
6651 | |
6652 | class MSNoVTableAttr : public InheritableAttr { |
6653 | public: |
6654 | // Factory methods |
6655 | static MSNoVTableAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
6656 | static MSNoVTableAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
6657 | static MSNoVTableAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
6658 | static MSNoVTableAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
6659 | |
6660 | // Constructors |
6661 | MSNoVTableAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
6662 | ); |
6663 | |
6664 | MSNoVTableAttr *clone(ASTContext &C) const; |
6665 | void printPretty(raw_ostream &OS, |
6666 | const PrintingPolicy &Policy) const; |
6667 | const char *getSpelling() const; |
6668 | |
6669 | |
6670 | static bool classof(const Attr *A) { return A->getKind() == attr::MSNoVTable; } |
6671 | }; |
6672 | |
6673 | class MSP430InterruptAttr : public InheritableAttr { |
6674 | unsigned number; |
6675 | |
6676 | public: |
6677 | enum Spelling { |
6678 | GNU_interrupt = 0, |
6679 | CXX11_gnu_interrupt = 1, |
6680 | C23_gnu_interrupt = 2, |
6681 | SpellingNotCalculated = 15 |
6682 | |
6683 | }; |
6684 | |
6685 | // Factory methods |
6686 | static MSP430InterruptAttr *CreateImplicit(ASTContext &Ctx, unsigned Number, const AttributeCommonInfo &CommonInfo); |
6687 | static MSP430InterruptAttr *Create(ASTContext &Ctx, unsigned Number, const AttributeCommonInfo &CommonInfo); |
6688 | static MSP430InterruptAttr *CreateImplicit(ASTContext &Ctx, unsigned Number, SourceRange Range = {}, Spelling S = GNU_interrupt); |
6689 | static MSP430InterruptAttr *Create(ASTContext &Ctx, unsigned Number, SourceRange Range = {}, Spelling S = GNU_interrupt); |
6690 | |
6691 | // Constructors |
6692 | MSP430InterruptAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
6693 | , unsigned Number |
6694 | ); |
6695 | |
6696 | MSP430InterruptAttr *clone(ASTContext &C) const; |
6697 | void printPretty(raw_ostream &OS, |
6698 | const PrintingPolicy &Policy) const; |
6699 | const char *getSpelling() const; |
6700 | unsigned getNumber() const { |
6701 | return number; |
6702 | } |
6703 | |
6704 | |
6705 | |
6706 | static bool classof(const Attr *A) { return A->getKind() == attr::MSP430Interrupt; } |
6707 | }; |
6708 | |
6709 | class MSStructAttr : public InheritableAttr { |
6710 | public: |
6711 | enum Spelling { |
6712 | GNU_ms_struct = 0, |
6713 | CXX11_gnu_ms_struct = 1, |
6714 | C23_gnu_ms_struct = 2, |
6715 | SpellingNotCalculated = 15 |
6716 | |
6717 | }; |
6718 | |
6719 | // Factory methods |
6720 | static MSStructAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
6721 | static MSStructAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
6722 | static MSStructAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_ms_struct); |
6723 | static MSStructAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_ms_struct); |
6724 | |
6725 | // Constructors |
6726 | MSStructAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
6727 | ); |
6728 | |
6729 | MSStructAttr *clone(ASTContext &C) const; |
6730 | void printPretty(raw_ostream &OS, |
6731 | const PrintingPolicy &Policy) const; |
6732 | const char *getSpelling() const; |
6733 | |
6734 | |
6735 | static bool classof(const Attr *A) { return A->getKind() == attr::MSStruct; } |
6736 | }; |
6737 | |
6738 | class MSVtorDispAttr : public InheritableAttr { |
6739 | unsigned vdm; |
6740 | |
6741 | public: |
6742 | // Factory methods |
6743 | static MSVtorDispAttr *CreateImplicit(ASTContext &Ctx, unsigned Vdm, const AttributeCommonInfo &CommonInfo); |
6744 | static MSVtorDispAttr *Create(ASTContext &Ctx, unsigned Vdm, const AttributeCommonInfo &CommonInfo); |
6745 | static MSVtorDispAttr *CreateImplicit(ASTContext &Ctx, unsigned Vdm, SourceRange Range = {}); |
6746 | static MSVtorDispAttr *Create(ASTContext &Ctx, unsigned Vdm, SourceRange Range = {}); |
6747 | |
6748 | // Constructors |
6749 | MSVtorDispAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
6750 | , unsigned Vdm |
6751 | ); |
6752 | |
6753 | MSVtorDispAttr *clone(ASTContext &C) const; |
6754 | void printPretty(raw_ostream &OS, |
6755 | const PrintingPolicy &Policy) const; |
6756 | const char *getSpelling() const; |
6757 | unsigned getVdm() const { |
6758 | return vdm; |
6759 | } |
6760 | |
6761 | |
6762 | MSVtorDispMode getVtorDispMode() const { return MSVtorDispMode(vdm); } |
6763 | |
6764 | |
6765 | static bool classof(const Attr *A) { return A->getKind() == attr::MSVtorDisp; } |
6766 | }; |
6767 | |
6768 | class MaxFieldAlignmentAttr : public InheritableAttr { |
6769 | unsigned alignment; |
6770 | |
6771 | public: |
6772 | // Factory methods |
6773 | static MaxFieldAlignmentAttr *CreateImplicit(ASTContext &Ctx, unsigned Alignment, const AttributeCommonInfo &CommonInfo); |
6774 | static MaxFieldAlignmentAttr *Create(ASTContext &Ctx, unsigned Alignment, const AttributeCommonInfo &CommonInfo); |
6775 | static MaxFieldAlignmentAttr *CreateImplicit(ASTContext &Ctx, unsigned Alignment, SourceRange Range = {}); |
6776 | static MaxFieldAlignmentAttr *Create(ASTContext &Ctx, unsigned Alignment, SourceRange Range = {}); |
6777 | |
6778 | // Constructors |
6779 | MaxFieldAlignmentAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
6780 | , unsigned Alignment |
6781 | ); |
6782 | |
6783 | MaxFieldAlignmentAttr *clone(ASTContext &C) const; |
6784 | void printPretty(raw_ostream &OS, |
6785 | const PrintingPolicy &Policy) const; |
6786 | const char *getSpelling() const; |
6787 | unsigned getAlignment() const { |
6788 | return alignment; |
6789 | } |
6790 | |
6791 | |
6792 | |
6793 | static bool classof(const Attr *A) { return A->getKind() == attr::MaxFieldAlignment; } |
6794 | }; |
6795 | |
6796 | class MayAliasAttr : public InheritableAttr { |
6797 | public: |
6798 | enum Spelling { |
6799 | GNU_may_alias = 0, |
6800 | CXX11_gnu_may_alias = 1, |
6801 | C23_gnu_may_alias = 2, |
6802 | SpellingNotCalculated = 15 |
6803 | |
6804 | }; |
6805 | |
6806 | // Factory methods |
6807 | static MayAliasAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
6808 | static MayAliasAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
6809 | static MayAliasAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_may_alias); |
6810 | static MayAliasAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_may_alias); |
6811 | |
6812 | // Constructors |
6813 | MayAliasAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
6814 | ); |
6815 | |
6816 | MayAliasAttr *clone(ASTContext &C) const; |
6817 | void printPretty(raw_ostream &OS, |
6818 | const PrintingPolicy &Policy) const; |
6819 | const char *getSpelling() const; |
6820 | |
6821 | |
6822 | static bool classof(const Attr *A) { return A->getKind() == attr::MayAlias; } |
6823 | }; |
6824 | |
6825 | class MaybeUndefAttr : public InheritableAttr { |
6826 | public: |
6827 | enum Spelling { |
6828 | GNU_maybe_undef = 0, |
6829 | CXX11_clang_maybe_undef = 1, |
6830 | C23_clang_maybe_undef = 2, |
6831 | SpellingNotCalculated = 15 |
6832 | |
6833 | }; |
6834 | |
6835 | // Factory methods |
6836 | static MaybeUndefAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
6837 | static MaybeUndefAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
6838 | static MaybeUndefAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_maybe_undef); |
6839 | static MaybeUndefAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_maybe_undef); |
6840 | |
6841 | // Constructors |
6842 | MaybeUndefAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
6843 | ); |
6844 | |
6845 | MaybeUndefAttr *clone(ASTContext &C) const; |
6846 | void printPretty(raw_ostream &OS, |
6847 | const PrintingPolicy &Policy) const; |
6848 | const char *getSpelling() const; |
6849 | |
6850 | |
6851 | static bool classof(const Attr *A) { return A->getKind() == attr::MaybeUndef; } |
6852 | }; |
6853 | |
6854 | class MicroMipsAttr : public InheritableAttr { |
6855 | public: |
6856 | enum Spelling { |
6857 | GNU_micromips = 0, |
6858 | CXX11_gnu_micromips = 1, |
6859 | C23_gnu_micromips = 2, |
6860 | SpellingNotCalculated = 15 |
6861 | |
6862 | }; |
6863 | |
6864 | // Factory methods |
6865 | static MicroMipsAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
6866 | static MicroMipsAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
6867 | static MicroMipsAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_micromips); |
6868 | static MicroMipsAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_micromips); |
6869 | |
6870 | // Constructors |
6871 | MicroMipsAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
6872 | ); |
6873 | |
6874 | MicroMipsAttr *clone(ASTContext &C) const; |
6875 | void printPretty(raw_ostream &OS, |
6876 | const PrintingPolicy &Policy) const; |
6877 | const char *getSpelling() const; |
6878 | |
6879 | |
6880 | static bool classof(const Attr *A) { return A->getKind() == attr::MicroMips; } |
6881 | }; |
6882 | |
6883 | class MinSizeAttr : public InheritableAttr { |
6884 | public: |
6885 | enum Spelling { |
6886 | GNU_minsize = 0, |
6887 | CXX11_clang_minsize = 1, |
6888 | C23_clang_minsize = 2, |
6889 | SpellingNotCalculated = 15 |
6890 | |
6891 | }; |
6892 | |
6893 | // Factory methods |
6894 | static MinSizeAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
6895 | static MinSizeAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
6896 | static MinSizeAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_minsize); |
6897 | static MinSizeAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_minsize); |
6898 | |
6899 | // Constructors |
6900 | MinSizeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
6901 | ); |
6902 | |
6903 | MinSizeAttr *clone(ASTContext &C) const; |
6904 | void printPretty(raw_ostream &OS, |
6905 | const PrintingPolicy &Policy) const; |
6906 | const char *getSpelling() const; |
6907 | |
6908 | |
6909 | static bool classof(const Attr *A) { return A->getKind() == attr::MinSize; } |
6910 | }; |
6911 | |
6912 | class MinVectorWidthAttr : public InheritableAttr { |
6913 | unsigned vectorWidth; |
6914 | |
6915 | public: |
6916 | enum Spelling { |
6917 | GNU_min_vector_width = 0, |
6918 | CXX11_clang_min_vector_width = 1, |
6919 | C23_clang_min_vector_width = 2, |
6920 | SpellingNotCalculated = 15 |
6921 | |
6922 | }; |
6923 | |
6924 | // Factory methods |
6925 | static MinVectorWidthAttr *CreateImplicit(ASTContext &Ctx, unsigned VectorWidth, const AttributeCommonInfo &CommonInfo); |
6926 | static MinVectorWidthAttr *Create(ASTContext &Ctx, unsigned VectorWidth, const AttributeCommonInfo &CommonInfo); |
6927 | static MinVectorWidthAttr *CreateImplicit(ASTContext &Ctx, unsigned VectorWidth, SourceRange Range = {}, Spelling S = GNU_min_vector_width); |
6928 | static MinVectorWidthAttr *Create(ASTContext &Ctx, unsigned VectorWidth, SourceRange Range = {}, Spelling S = GNU_min_vector_width); |
6929 | |
6930 | // Constructors |
6931 | MinVectorWidthAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
6932 | , unsigned VectorWidth |
6933 | ); |
6934 | |
6935 | MinVectorWidthAttr *clone(ASTContext &C) const; |
6936 | void printPretty(raw_ostream &OS, |
6937 | const PrintingPolicy &Policy) const; |
6938 | const char *getSpelling() const; |
6939 | unsigned getVectorWidth() const { |
6940 | return vectorWidth; |
6941 | } |
6942 | |
6943 | |
6944 | |
6945 | static bool classof(const Attr *A) { return A->getKind() == attr::MinVectorWidth; } |
6946 | }; |
6947 | |
6948 | class Mips16Attr : public InheritableAttr { |
6949 | public: |
6950 | enum Spelling { |
6951 | GNU_mips16 = 0, |
6952 | CXX11_gnu_mips16 = 1, |
6953 | C23_gnu_mips16 = 2, |
6954 | SpellingNotCalculated = 15 |
6955 | |
6956 | }; |
6957 | |
6958 | // Factory methods |
6959 | static Mips16Attr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
6960 | static Mips16Attr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
6961 | static Mips16Attr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_mips16); |
6962 | static Mips16Attr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_mips16); |
6963 | |
6964 | // Constructors |
6965 | Mips16Attr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
6966 | ); |
6967 | |
6968 | Mips16Attr *clone(ASTContext &C) const; |
6969 | void printPretty(raw_ostream &OS, |
6970 | const PrintingPolicy &Policy) const; |
6971 | const char *getSpelling() const; |
6972 | |
6973 | |
6974 | static bool classof(const Attr *A) { return A->getKind() == attr::Mips16; } |
6975 | }; |
6976 | |
6977 | class MipsInterruptAttr : public InheritableAttr { |
6978 | public: |
6979 | enum InterruptType { |
6980 | sw0, |
6981 | sw1, |
6982 | hw0, |
6983 | hw1, |
6984 | hw2, |
6985 | hw3, |
6986 | hw4, |
6987 | hw5, |
6988 | eic |
6989 | }; |
6990 | private: |
6991 | MipsInterruptAttr::InterruptType interrupt; |
6992 | |
6993 | public: |
6994 | enum Spelling { |
6995 | GNU_interrupt = 0, |
6996 | CXX11_gnu_interrupt = 1, |
6997 | C23_gnu_interrupt = 2, |
6998 | SpellingNotCalculated = 15 |
6999 | |
7000 | }; |
7001 | |
7002 | // Factory methods |
7003 | static MipsInterruptAttr *CreateImplicit(ASTContext &Ctx, MipsInterruptAttr::InterruptType Interrupt, const AttributeCommonInfo &CommonInfo); |
7004 | static MipsInterruptAttr *Create(ASTContext &Ctx, MipsInterruptAttr::InterruptType Interrupt, const AttributeCommonInfo &CommonInfo); |
7005 | static MipsInterruptAttr *CreateImplicit(ASTContext &Ctx, MipsInterruptAttr::InterruptType Interrupt, SourceRange Range = {}, Spelling S = GNU_interrupt); |
7006 | static MipsInterruptAttr *Create(ASTContext &Ctx, MipsInterruptAttr::InterruptType Interrupt, SourceRange Range = {}, Spelling S = GNU_interrupt); |
7007 | |
7008 | // Constructors |
7009 | MipsInterruptAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
7010 | , MipsInterruptAttr::InterruptType Interrupt |
7011 | ); |
7012 | |
7013 | MipsInterruptAttr *clone(ASTContext &C) const; |
7014 | void printPretty(raw_ostream &OS, |
7015 | const PrintingPolicy &Policy) const; |
7016 | const char *getSpelling() const; |
7017 | MipsInterruptAttr::InterruptType getInterrupt() const { |
7018 | return interrupt; |
7019 | } |
7020 | |
7021 | static bool ConvertStrToInterruptType(StringRef Val, MipsInterruptAttr::InterruptType &Out); |
7022 | static const char *ConvertInterruptTypeToStr(MipsInterruptAttr::InterruptType Val); |
7023 | |
7024 | |
7025 | static bool classof(const Attr *A) { return A->getKind() == attr::MipsInterrupt; } |
7026 | }; |
7027 | |
7028 | class MipsLongCallAttr : public InheritableAttr { |
7029 | public: |
7030 | enum Spelling { |
7031 | GNU_long_call = 0, |
7032 | CXX11_gnu_long_call = 1, |
7033 | C23_gnu_long_call = 2, |
7034 | GNU_far = 3, |
7035 | CXX11_gnu_far = 4, |
7036 | C23_gnu_far = 5, |
7037 | SpellingNotCalculated = 15 |
7038 | |
7039 | }; |
7040 | |
7041 | // Factory methods |
7042 | static MipsLongCallAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7043 | static MipsLongCallAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7044 | static MipsLongCallAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_long_call); |
7045 | static MipsLongCallAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_long_call); |
7046 | |
7047 | // Constructors |
7048 | MipsLongCallAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
7049 | ); |
7050 | |
7051 | MipsLongCallAttr *clone(ASTContext &C) const; |
7052 | void printPretty(raw_ostream &OS, |
7053 | const PrintingPolicy &Policy) const; |
7054 | const char *getSpelling() const; |
7055 | Spelling getSemanticSpelling() const; |
7056 | |
7057 | |
7058 | static bool classof(const Attr *A) { return A->getKind() == attr::MipsLongCall; } |
7059 | }; |
7060 | |
7061 | class MipsShortCallAttr : public InheritableAttr { |
7062 | public: |
7063 | enum Spelling { |
7064 | GNU_short_call = 0, |
7065 | CXX11_gnu_short_call = 1, |
7066 | C23_gnu_short_call = 2, |
7067 | GNU_near = 3, |
7068 | CXX11_gnu_near = 4, |
7069 | C23_gnu_near = 5, |
7070 | SpellingNotCalculated = 15 |
7071 | |
7072 | }; |
7073 | |
7074 | // Factory methods |
7075 | static MipsShortCallAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7076 | static MipsShortCallAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7077 | static MipsShortCallAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_short_call); |
7078 | static MipsShortCallAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_short_call); |
7079 | |
7080 | // Constructors |
7081 | MipsShortCallAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
7082 | ); |
7083 | |
7084 | MipsShortCallAttr *clone(ASTContext &C) const; |
7085 | void printPretty(raw_ostream &OS, |
7086 | const PrintingPolicy &Policy) const; |
7087 | const char *getSpelling() const; |
7088 | Spelling getSemanticSpelling() const; |
7089 | |
7090 | |
7091 | static bool classof(const Attr *A) { return A->getKind() == attr::MipsShortCall; } |
7092 | }; |
7093 | |
7094 | class ModeAttr : public Attr { |
7095 | IdentifierInfo * mode; |
7096 | |
7097 | public: |
7098 | enum Spelling { |
7099 | GNU_mode = 0, |
7100 | CXX11_gnu_mode = 1, |
7101 | C23_gnu_mode = 2, |
7102 | SpellingNotCalculated = 15 |
7103 | |
7104 | }; |
7105 | |
7106 | // Factory methods |
7107 | static ModeAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * Mode, const AttributeCommonInfo &CommonInfo); |
7108 | static ModeAttr *Create(ASTContext &Ctx, IdentifierInfo * Mode, const AttributeCommonInfo &CommonInfo); |
7109 | static ModeAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * Mode, SourceRange Range = {}, Spelling S = GNU_mode); |
7110 | static ModeAttr *Create(ASTContext &Ctx, IdentifierInfo * Mode, SourceRange Range = {}, Spelling S = GNU_mode); |
7111 | |
7112 | // Constructors |
7113 | ModeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
7114 | , IdentifierInfo * Mode |
7115 | ); |
7116 | |
7117 | ModeAttr *clone(ASTContext &C) const; |
7118 | void printPretty(raw_ostream &OS, |
7119 | const PrintingPolicy &Policy) const; |
7120 | const char *getSpelling() const; |
7121 | IdentifierInfo * getMode() const { |
7122 | return mode; |
7123 | } |
7124 | |
7125 | |
7126 | |
7127 | static bool classof(const Attr *A) { return A->getKind() == attr::Mode; } |
7128 | }; |
7129 | |
7130 | class MustTailAttr : public StmtAttr { |
7131 | public: |
7132 | enum Spelling { |
7133 | GNU_musttail = 0, |
7134 | CXX11_clang_musttail = 1, |
7135 | C23_clang_musttail = 2, |
7136 | SpellingNotCalculated = 15 |
7137 | |
7138 | }; |
7139 | |
7140 | // Factory methods |
7141 | static MustTailAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7142 | static MustTailAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7143 | static MustTailAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_musttail); |
7144 | static MustTailAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_musttail); |
7145 | |
7146 | // Constructors |
7147 | MustTailAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
7148 | ); |
7149 | |
7150 | MustTailAttr *clone(ASTContext &C) const; |
7151 | void printPretty(raw_ostream &OS, |
7152 | const PrintingPolicy &Policy) const; |
7153 | const char *getSpelling() const; |
7154 | |
7155 | |
7156 | static bool classof(const Attr *A) { return A->getKind() == attr::MustTail; } |
7157 | }; |
7158 | |
7159 | class NSConsumedAttr : public InheritableParamAttr { |
7160 | public: |
7161 | enum Spelling { |
7162 | GNU_ns_consumed = 0, |
7163 | CXX11_clang_ns_consumed = 1, |
7164 | C23_clang_ns_consumed = 2, |
7165 | SpellingNotCalculated = 15 |
7166 | |
7167 | }; |
7168 | |
7169 | // Factory methods |
7170 | static NSConsumedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7171 | static NSConsumedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7172 | static NSConsumedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_ns_consumed); |
7173 | static NSConsumedAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_ns_consumed); |
7174 | |
7175 | // Constructors |
7176 | NSConsumedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
7177 | ); |
7178 | |
7179 | NSConsumedAttr *clone(ASTContext &C) const; |
7180 | void printPretty(raw_ostream &OS, |
7181 | const PrintingPolicy &Policy) const; |
7182 | const char *getSpelling() const; |
7183 | |
7184 | |
7185 | static bool classof(const Attr *A) { return A->getKind() == attr::NSConsumed; } |
7186 | }; |
7187 | |
7188 | class NSConsumesSelfAttr : public InheritableAttr { |
7189 | public: |
7190 | enum Spelling { |
7191 | GNU_ns_consumes_self = 0, |
7192 | CXX11_clang_ns_consumes_self = 1, |
7193 | C23_clang_ns_consumes_self = 2, |
7194 | SpellingNotCalculated = 15 |
7195 | |
7196 | }; |
7197 | |
7198 | // Factory methods |
7199 | static NSConsumesSelfAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7200 | static NSConsumesSelfAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7201 | static NSConsumesSelfAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_ns_consumes_self); |
7202 | static NSConsumesSelfAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_ns_consumes_self); |
7203 | |
7204 | // Constructors |
7205 | NSConsumesSelfAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
7206 | ); |
7207 | |
7208 | NSConsumesSelfAttr *clone(ASTContext &C) const; |
7209 | void printPretty(raw_ostream &OS, |
7210 | const PrintingPolicy &Policy) const; |
7211 | const char *getSpelling() const; |
7212 | |
7213 | |
7214 | static bool classof(const Attr *A) { return A->getKind() == attr::NSConsumesSelf; } |
7215 | }; |
7216 | |
7217 | class NSErrorDomainAttr : public InheritableAttr { |
7218 | IdentifierInfo * errorDomain; |
7219 | |
7220 | public: |
7221 | // Factory methods |
7222 | static NSErrorDomainAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * ErrorDomain, const AttributeCommonInfo &CommonInfo); |
7223 | static NSErrorDomainAttr *Create(ASTContext &Ctx, IdentifierInfo * ErrorDomain, const AttributeCommonInfo &CommonInfo); |
7224 | static NSErrorDomainAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * ErrorDomain, SourceRange Range = {}); |
7225 | static NSErrorDomainAttr *Create(ASTContext &Ctx, IdentifierInfo * ErrorDomain, SourceRange Range = {}); |
7226 | |
7227 | // Constructors |
7228 | NSErrorDomainAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
7229 | , IdentifierInfo * ErrorDomain |
7230 | ); |
7231 | |
7232 | NSErrorDomainAttr *clone(ASTContext &C) const; |
7233 | void printPretty(raw_ostream &OS, |
7234 | const PrintingPolicy &Policy) const; |
7235 | const char *getSpelling() const; |
7236 | IdentifierInfo * getErrorDomain() const { |
7237 | return errorDomain; |
7238 | } |
7239 | |
7240 | |
7241 | |
7242 | static bool classof(const Attr *A) { return A->getKind() == attr::NSErrorDomain; } |
7243 | }; |
7244 | |
7245 | class NSReturnsAutoreleasedAttr : public InheritableAttr { |
7246 | public: |
7247 | enum Spelling { |
7248 | GNU_ns_returns_autoreleased = 0, |
7249 | CXX11_clang_ns_returns_autoreleased = 1, |
7250 | C23_clang_ns_returns_autoreleased = 2, |
7251 | SpellingNotCalculated = 15 |
7252 | |
7253 | }; |
7254 | |
7255 | // Factory methods |
7256 | static NSReturnsAutoreleasedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7257 | static NSReturnsAutoreleasedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7258 | static NSReturnsAutoreleasedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_ns_returns_autoreleased); |
7259 | static NSReturnsAutoreleasedAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_ns_returns_autoreleased); |
7260 | |
7261 | // Constructors |
7262 | NSReturnsAutoreleasedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
7263 | ); |
7264 | |
7265 | NSReturnsAutoreleasedAttr *clone(ASTContext &C) const; |
7266 | void printPretty(raw_ostream &OS, |
7267 | const PrintingPolicy &Policy) const; |
7268 | const char *getSpelling() const; |
7269 | |
7270 | |
7271 | static bool classof(const Attr *A) { return A->getKind() == attr::NSReturnsAutoreleased; } |
7272 | }; |
7273 | |
7274 | class NSReturnsNotRetainedAttr : public InheritableAttr { |
7275 | public: |
7276 | enum Spelling { |
7277 | GNU_ns_returns_not_retained = 0, |
7278 | CXX11_clang_ns_returns_not_retained = 1, |
7279 | C23_clang_ns_returns_not_retained = 2, |
7280 | SpellingNotCalculated = 15 |
7281 | |
7282 | }; |
7283 | |
7284 | // Factory methods |
7285 | static NSReturnsNotRetainedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7286 | static NSReturnsNotRetainedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7287 | static NSReturnsNotRetainedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_ns_returns_not_retained); |
7288 | static NSReturnsNotRetainedAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_ns_returns_not_retained); |
7289 | |
7290 | // Constructors |
7291 | NSReturnsNotRetainedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
7292 | ); |
7293 | |
7294 | NSReturnsNotRetainedAttr *clone(ASTContext &C) const; |
7295 | void printPretty(raw_ostream &OS, |
7296 | const PrintingPolicy &Policy) const; |
7297 | const char *getSpelling() const; |
7298 | |
7299 | |
7300 | static bool classof(const Attr *A) { return A->getKind() == attr::NSReturnsNotRetained; } |
7301 | }; |
7302 | |
7303 | class NSReturnsRetainedAttr : public InheritableAttr { |
7304 | public: |
7305 | enum Spelling { |
7306 | GNU_ns_returns_retained = 0, |
7307 | CXX11_clang_ns_returns_retained = 1, |
7308 | C23_clang_ns_returns_retained = 2, |
7309 | SpellingNotCalculated = 15 |
7310 | |
7311 | }; |
7312 | |
7313 | // Factory methods |
7314 | static NSReturnsRetainedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7315 | static NSReturnsRetainedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7316 | static NSReturnsRetainedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_ns_returns_retained); |
7317 | static NSReturnsRetainedAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_ns_returns_retained); |
7318 | |
7319 | // Constructors |
7320 | NSReturnsRetainedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
7321 | ); |
7322 | |
7323 | NSReturnsRetainedAttr *clone(ASTContext &C) const; |
7324 | void printPretty(raw_ostream &OS, |
7325 | const PrintingPolicy &Policy) const; |
7326 | const char *getSpelling() const; |
7327 | |
7328 | |
7329 | static bool classof(const Attr *A) { return A->getKind() == attr::NSReturnsRetained; } |
7330 | }; |
7331 | |
7332 | class NVPTXKernelAttr : public InheritableAttr { |
7333 | public: |
7334 | enum Spelling { |
7335 | GNU_nvptx_kernel = 0, |
7336 | CXX11_clang_nvptx_kernel = 1, |
7337 | C23_clang_nvptx_kernel = 2, |
7338 | SpellingNotCalculated = 15 |
7339 | |
7340 | }; |
7341 | |
7342 | // Factory methods |
7343 | static NVPTXKernelAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7344 | static NVPTXKernelAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7345 | static NVPTXKernelAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_nvptx_kernel); |
7346 | static NVPTXKernelAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_nvptx_kernel); |
7347 | |
7348 | // Constructors |
7349 | NVPTXKernelAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
7350 | ); |
7351 | |
7352 | NVPTXKernelAttr *clone(ASTContext &C) const; |
7353 | void printPretty(raw_ostream &OS, |
7354 | const PrintingPolicy &Policy) const; |
7355 | const char *getSpelling() const; |
7356 | |
7357 | |
7358 | static bool classof(const Attr *A) { return A->getKind() == attr::NVPTXKernel; } |
7359 | }; |
7360 | |
7361 | class NakedAttr : public InheritableAttr { |
7362 | public: |
7363 | enum Spelling { |
7364 | GNU_naked = 0, |
7365 | CXX11_gnu_naked = 1, |
7366 | C23_gnu_naked = 2, |
7367 | Declspec_naked = 3, |
7368 | SpellingNotCalculated = 15 |
7369 | |
7370 | }; |
7371 | |
7372 | // Factory methods |
7373 | static NakedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7374 | static NakedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7375 | static NakedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_naked); |
7376 | static NakedAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_naked); |
7377 | |
7378 | // Constructors |
7379 | NakedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
7380 | ); |
7381 | |
7382 | NakedAttr *clone(ASTContext &C) const; |
7383 | void printPretty(raw_ostream &OS, |
7384 | const PrintingPolicy &Policy) const; |
7385 | const char *getSpelling() const; |
7386 | |
7387 | |
7388 | static bool classof(const Attr *A) { return A->getKind() == attr::Naked; } |
7389 | }; |
7390 | |
7391 | class NoAliasAttr : public InheritableAttr { |
7392 | public: |
7393 | // Factory methods |
7394 | static NoAliasAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7395 | static NoAliasAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7396 | static NoAliasAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
7397 | static NoAliasAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
7398 | |
7399 | // Constructors |
7400 | NoAliasAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
7401 | ); |
7402 | |
7403 | NoAliasAttr *clone(ASTContext &C) const; |
7404 | void printPretty(raw_ostream &OS, |
7405 | const PrintingPolicy &Policy) const; |
7406 | const char *getSpelling() const; |
7407 | |
7408 | |
7409 | static bool classof(const Attr *A) { return A->getKind() == attr::NoAlias; } |
7410 | }; |
7411 | |
7412 | class NoBuiltinAttr : public Attr { |
7413 | unsigned builtinNames_Size; |
7414 | StringRef *builtinNames_; |
7415 | |
7416 | public: |
7417 | enum Spelling { |
7418 | GNU_no_builtin = 0, |
7419 | CXX11_clang_no_builtin = 1, |
7420 | C23_clang_no_builtin = 2, |
7421 | SpellingNotCalculated = 15 |
7422 | |
7423 | }; |
7424 | |
7425 | // Factory methods |
7426 | static NoBuiltinAttr *CreateImplicit(ASTContext &Ctx, StringRef *BuiltinNames, unsigned BuiltinNamesSize, const AttributeCommonInfo &CommonInfo); |
7427 | static NoBuiltinAttr *Create(ASTContext &Ctx, StringRef *BuiltinNames, unsigned BuiltinNamesSize, const AttributeCommonInfo &CommonInfo); |
7428 | static NoBuiltinAttr *CreateImplicit(ASTContext &Ctx, StringRef *BuiltinNames, unsigned BuiltinNamesSize, SourceRange Range = {}, Spelling S = GNU_no_builtin); |
7429 | static NoBuiltinAttr *Create(ASTContext &Ctx, StringRef *BuiltinNames, unsigned BuiltinNamesSize, SourceRange Range = {}, Spelling S = GNU_no_builtin); |
7430 | |
7431 | // Constructors |
7432 | NoBuiltinAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
7433 | , StringRef *BuiltinNames, unsigned BuiltinNamesSize |
7434 | ); |
7435 | NoBuiltinAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
7436 | ); |
7437 | |
7438 | NoBuiltinAttr *clone(ASTContext &C) const; |
7439 | void printPretty(raw_ostream &OS, |
7440 | const PrintingPolicy &Policy) const; |
7441 | const char *getSpelling() const; |
7442 | typedef StringRef* builtinNames_iterator; |
7443 | builtinNames_iterator builtinNames_begin() const { return builtinNames_; } |
7444 | builtinNames_iterator builtinNames_end() const { return builtinNames_ + builtinNames_Size; } |
7445 | unsigned builtinNames_size() const { return builtinNames_Size; } |
7446 | llvm::iterator_range<builtinNames_iterator> builtinNames() const { return llvm::make_range(x: builtinNames_begin(), y: builtinNames_end()); } |
7447 | |
7448 | |
7449 | |
7450 | |
7451 | static bool classof(const Attr *A) { return A->getKind() == attr::NoBuiltin; } |
7452 | }; |
7453 | |
7454 | class NoCommonAttr : public InheritableAttr { |
7455 | public: |
7456 | enum Spelling { |
7457 | GNU_nocommon = 0, |
7458 | CXX11_gnu_nocommon = 1, |
7459 | C23_gnu_nocommon = 2, |
7460 | SpellingNotCalculated = 15 |
7461 | |
7462 | }; |
7463 | |
7464 | // Factory methods |
7465 | static NoCommonAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7466 | static NoCommonAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7467 | static NoCommonAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_nocommon); |
7468 | static NoCommonAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_nocommon); |
7469 | |
7470 | // Constructors |
7471 | NoCommonAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
7472 | ); |
7473 | |
7474 | NoCommonAttr *clone(ASTContext &C) const; |
7475 | void printPretty(raw_ostream &OS, |
7476 | const PrintingPolicy &Policy) const; |
7477 | const char *getSpelling() const; |
7478 | |
7479 | |
7480 | static bool classof(const Attr *A) { return A->getKind() == attr::NoCommon; } |
7481 | }; |
7482 | |
7483 | class NoDebugAttr : public InheritableAttr { |
7484 | public: |
7485 | enum Spelling { |
7486 | GNU_nodebug = 0, |
7487 | CXX11_gnu_nodebug = 1, |
7488 | C23_gnu_nodebug = 2, |
7489 | SpellingNotCalculated = 15 |
7490 | |
7491 | }; |
7492 | |
7493 | // Factory methods |
7494 | static NoDebugAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7495 | static NoDebugAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7496 | static NoDebugAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_nodebug); |
7497 | static NoDebugAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_nodebug); |
7498 | |
7499 | // Constructors |
7500 | NoDebugAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
7501 | ); |
7502 | |
7503 | NoDebugAttr *clone(ASTContext &C) const; |
7504 | void printPretty(raw_ostream &OS, |
7505 | const PrintingPolicy &Policy) const; |
7506 | const char *getSpelling() const; |
7507 | |
7508 | |
7509 | static bool classof(const Attr *A) { return A->getKind() == attr::NoDebug; } |
7510 | }; |
7511 | |
7512 | class NoDerefAttr : public TypeAttr { |
7513 | public: |
7514 | enum Spelling { |
7515 | GNU_noderef = 0, |
7516 | CXX11_clang_noderef = 1, |
7517 | C23_clang_noderef = 2, |
7518 | SpellingNotCalculated = 15 |
7519 | |
7520 | }; |
7521 | |
7522 | // Factory methods |
7523 | static NoDerefAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7524 | static NoDerefAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7525 | static NoDerefAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_noderef); |
7526 | static NoDerefAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_noderef); |
7527 | |
7528 | // Constructors |
7529 | NoDerefAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
7530 | ); |
7531 | |
7532 | NoDerefAttr *clone(ASTContext &C) const; |
7533 | void printPretty(raw_ostream &OS, |
7534 | const PrintingPolicy &Policy) const; |
7535 | const char *getSpelling() const; |
7536 | |
7537 | |
7538 | static bool classof(const Attr *A) { return A->getKind() == attr::NoDeref; } |
7539 | }; |
7540 | |
7541 | class NoDestroyAttr : public InheritableAttr { |
7542 | public: |
7543 | enum Spelling { |
7544 | GNU_no_destroy = 0, |
7545 | CXX11_clang_no_destroy = 1, |
7546 | SpellingNotCalculated = 15 |
7547 | |
7548 | }; |
7549 | |
7550 | // Factory methods |
7551 | static NoDestroyAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7552 | static NoDestroyAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7553 | static NoDestroyAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_no_destroy); |
7554 | static NoDestroyAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_no_destroy); |
7555 | |
7556 | // Constructors |
7557 | NoDestroyAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
7558 | ); |
7559 | |
7560 | NoDestroyAttr *clone(ASTContext &C) const; |
7561 | void printPretty(raw_ostream &OS, |
7562 | const PrintingPolicy &Policy) const; |
7563 | const char *getSpelling() const; |
7564 | |
7565 | |
7566 | static bool classof(const Attr *A) { return A->getKind() == attr::NoDestroy; } |
7567 | }; |
7568 | |
7569 | class NoDuplicateAttr : public InheritableAttr { |
7570 | public: |
7571 | enum Spelling { |
7572 | GNU_noduplicate = 0, |
7573 | CXX11_clang_noduplicate = 1, |
7574 | C23_clang_noduplicate = 2, |
7575 | SpellingNotCalculated = 15 |
7576 | |
7577 | }; |
7578 | |
7579 | // Factory methods |
7580 | static NoDuplicateAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7581 | static NoDuplicateAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7582 | static NoDuplicateAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_noduplicate); |
7583 | static NoDuplicateAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_noduplicate); |
7584 | |
7585 | // Constructors |
7586 | NoDuplicateAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
7587 | ); |
7588 | |
7589 | NoDuplicateAttr *clone(ASTContext &C) const; |
7590 | void printPretty(raw_ostream &OS, |
7591 | const PrintingPolicy &Policy) const; |
7592 | const char *getSpelling() const; |
7593 | |
7594 | |
7595 | static bool classof(const Attr *A) { return A->getKind() == attr::NoDuplicate; } |
7596 | }; |
7597 | |
7598 | class NoEscapeAttr : public Attr { |
7599 | public: |
7600 | enum Spelling { |
7601 | GNU_noescape = 0, |
7602 | CXX11_clang_noescape = 1, |
7603 | C23_clang_noescape = 2, |
7604 | SpellingNotCalculated = 15 |
7605 | |
7606 | }; |
7607 | |
7608 | // Factory methods |
7609 | static NoEscapeAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7610 | static NoEscapeAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7611 | static NoEscapeAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_noescape); |
7612 | static NoEscapeAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_noescape); |
7613 | |
7614 | // Constructors |
7615 | NoEscapeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
7616 | ); |
7617 | |
7618 | NoEscapeAttr *clone(ASTContext &C) const; |
7619 | void printPretty(raw_ostream &OS, |
7620 | const PrintingPolicy &Policy) const; |
7621 | const char *getSpelling() const; |
7622 | |
7623 | |
7624 | static bool classof(const Attr *A) { return A->getKind() == attr::NoEscape; } |
7625 | }; |
7626 | |
7627 | class NoInlineAttr : public DeclOrStmtAttr { |
7628 | public: |
7629 | enum Spelling { |
7630 | Keyword_noinline = 0, |
7631 | GNU_noinline = 1, |
7632 | CXX11_gnu_noinline = 2, |
7633 | C23_gnu_noinline = 3, |
7634 | CXX11_clang_noinline = 4, |
7635 | C23_clang_noinline = 5, |
7636 | CXX11_msvc_noinline = 6, |
7637 | C23_msvc_noinline = 7, |
7638 | Declspec_noinline = 8, |
7639 | SpellingNotCalculated = 15 |
7640 | |
7641 | }; |
7642 | |
7643 | // Factory methods |
7644 | static NoInlineAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7645 | static NoInlineAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7646 | static NoInlineAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = Keyword_noinline); |
7647 | static NoInlineAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = Keyword_noinline); |
7648 | |
7649 | // Constructors |
7650 | NoInlineAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
7651 | ); |
7652 | |
7653 | NoInlineAttr *clone(ASTContext &C) const; |
7654 | void printPretty(raw_ostream &OS, |
7655 | const PrintingPolicy &Policy) const; |
7656 | const char *getSpelling() const; |
7657 | bool isStmtNoInline() const { return getAttributeSpellingListIndex() == 4 || |
7658 | getAttributeSpellingListIndex() == 5 || |
7659 | getAttributeSpellingListIndex() == 6 || |
7660 | getAttributeSpellingListIndex() == 7; } |
7661 | |
7662 | |
7663 | static bool classof(const Attr *A) { return A->getKind() == attr::NoInline; } |
7664 | }; |
7665 | |
7666 | class NoInstrumentFunctionAttr : public InheritableAttr { |
7667 | public: |
7668 | enum Spelling { |
7669 | GNU_no_instrument_function = 0, |
7670 | CXX11_gnu_no_instrument_function = 1, |
7671 | C23_gnu_no_instrument_function = 2, |
7672 | SpellingNotCalculated = 15 |
7673 | |
7674 | }; |
7675 | |
7676 | // Factory methods |
7677 | static NoInstrumentFunctionAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7678 | static NoInstrumentFunctionAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7679 | static NoInstrumentFunctionAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_no_instrument_function); |
7680 | static NoInstrumentFunctionAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_no_instrument_function); |
7681 | |
7682 | // Constructors |
7683 | NoInstrumentFunctionAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
7684 | ); |
7685 | |
7686 | NoInstrumentFunctionAttr *clone(ASTContext &C) const; |
7687 | void printPretty(raw_ostream &OS, |
7688 | const PrintingPolicy &Policy) const; |
7689 | const char *getSpelling() const; |
7690 | |
7691 | |
7692 | static bool classof(const Attr *A) { return A->getKind() == attr::NoInstrumentFunction; } |
7693 | }; |
7694 | |
7695 | class NoMergeAttr : public DeclOrStmtAttr { |
7696 | public: |
7697 | enum Spelling { |
7698 | GNU_nomerge = 0, |
7699 | CXX11_clang_nomerge = 1, |
7700 | C23_clang_nomerge = 2, |
7701 | SpellingNotCalculated = 15 |
7702 | |
7703 | }; |
7704 | |
7705 | // Factory methods |
7706 | static NoMergeAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7707 | static NoMergeAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7708 | static NoMergeAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_nomerge); |
7709 | static NoMergeAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_nomerge); |
7710 | |
7711 | // Constructors |
7712 | NoMergeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
7713 | ); |
7714 | |
7715 | NoMergeAttr *clone(ASTContext &C) const; |
7716 | void printPretty(raw_ostream &OS, |
7717 | const PrintingPolicy &Policy) const; |
7718 | const char *getSpelling() const; |
7719 | |
7720 | |
7721 | static bool classof(const Attr *A) { return A->getKind() == attr::NoMerge; } |
7722 | }; |
7723 | |
7724 | class NoMicroMipsAttr : public InheritableAttr { |
7725 | public: |
7726 | enum Spelling { |
7727 | GNU_nomicromips = 0, |
7728 | CXX11_gnu_nomicromips = 1, |
7729 | C23_gnu_nomicromips = 2, |
7730 | SpellingNotCalculated = 15 |
7731 | |
7732 | }; |
7733 | |
7734 | // Factory methods |
7735 | static NoMicroMipsAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7736 | static NoMicroMipsAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7737 | static NoMicroMipsAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_nomicromips); |
7738 | static NoMicroMipsAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_nomicromips); |
7739 | |
7740 | // Constructors |
7741 | NoMicroMipsAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
7742 | ); |
7743 | |
7744 | NoMicroMipsAttr *clone(ASTContext &C) const; |
7745 | void printPretty(raw_ostream &OS, |
7746 | const PrintingPolicy &Policy) const; |
7747 | const char *getSpelling() const; |
7748 | |
7749 | |
7750 | static bool classof(const Attr *A) { return A->getKind() == attr::NoMicroMips; } |
7751 | }; |
7752 | |
7753 | class NoMips16Attr : public InheritableAttr { |
7754 | public: |
7755 | enum Spelling { |
7756 | GNU_nomips16 = 0, |
7757 | CXX11_gnu_nomips16 = 1, |
7758 | C23_gnu_nomips16 = 2, |
7759 | SpellingNotCalculated = 15 |
7760 | |
7761 | }; |
7762 | |
7763 | // Factory methods |
7764 | static NoMips16Attr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7765 | static NoMips16Attr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7766 | static NoMips16Attr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_nomips16); |
7767 | static NoMips16Attr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_nomips16); |
7768 | |
7769 | // Constructors |
7770 | NoMips16Attr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
7771 | ); |
7772 | |
7773 | NoMips16Attr *clone(ASTContext &C) const; |
7774 | void printPretty(raw_ostream &OS, |
7775 | const PrintingPolicy &Policy) const; |
7776 | const char *getSpelling() const; |
7777 | |
7778 | |
7779 | static bool classof(const Attr *A) { return A->getKind() == attr::NoMips16; } |
7780 | }; |
7781 | |
7782 | class NoProfileFunctionAttr : public InheritableAttr { |
7783 | public: |
7784 | enum Spelling { |
7785 | GNU_no_profile_instrument_function = 0, |
7786 | CXX11_gnu_no_profile_instrument_function = 1, |
7787 | C23_gnu_no_profile_instrument_function = 2, |
7788 | SpellingNotCalculated = 15 |
7789 | |
7790 | }; |
7791 | |
7792 | // Factory methods |
7793 | static NoProfileFunctionAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7794 | static NoProfileFunctionAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7795 | static NoProfileFunctionAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_no_profile_instrument_function); |
7796 | static NoProfileFunctionAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_no_profile_instrument_function); |
7797 | |
7798 | // Constructors |
7799 | NoProfileFunctionAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
7800 | ); |
7801 | |
7802 | NoProfileFunctionAttr *clone(ASTContext &C) const; |
7803 | void printPretty(raw_ostream &OS, |
7804 | const PrintingPolicy &Policy) const; |
7805 | const char *getSpelling() const; |
7806 | |
7807 | |
7808 | static bool classof(const Attr *A) { return A->getKind() == attr::NoProfileFunction; } |
7809 | }; |
7810 | |
7811 | class NoRandomizeLayoutAttr : public InheritableAttr { |
7812 | public: |
7813 | enum Spelling { |
7814 | GNU_no_randomize_layout = 0, |
7815 | CXX11_gnu_no_randomize_layout = 1, |
7816 | C23_gnu_no_randomize_layout = 2, |
7817 | SpellingNotCalculated = 15 |
7818 | |
7819 | }; |
7820 | |
7821 | // Factory methods |
7822 | static NoRandomizeLayoutAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7823 | static NoRandomizeLayoutAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7824 | static NoRandomizeLayoutAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_no_randomize_layout); |
7825 | static NoRandomizeLayoutAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_no_randomize_layout); |
7826 | |
7827 | // Constructors |
7828 | NoRandomizeLayoutAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
7829 | ); |
7830 | |
7831 | NoRandomizeLayoutAttr *clone(ASTContext &C) const; |
7832 | void printPretty(raw_ostream &OS, |
7833 | const PrintingPolicy &Policy) const; |
7834 | const char *getSpelling() const; |
7835 | |
7836 | |
7837 | static bool classof(const Attr *A) { return A->getKind() == attr::NoRandomizeLayout; } |
7838 | }; |
7839 | |
7840 | class NoReturnAttr : public InheritableAttr { |
7841 | public: |
7842 | enum Spelling { |
7843 | GNU_noreturn = 0, |
7844 | CXX11_gnu_noreturn = 1, |
7845 | C23_gnu_noreturn = 2, |
7846 | Declspec_noreturn = 3, |
7847 | SpellingNotCalculated = 15 |
7848 | |
7849 | }; |
7850 | |
7851 | // Factory methods |
7852 | static NoReturnAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7853 | static NoReturnAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7854 | static NoReturnAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_noreturn); |
7855 | static NoReturnAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_noreturn); |
7856 | |
7857 | // Constructors |
7858 | NoReturnAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
7859 | ); |
7860 | |
7861 | NoReturnAttr *clone(ASTContext &C) const; |
7862 | void printPretty(raw_ostream &OS, |
7863 | const PrintingPolicy &Policy) const; |
7864 | const char *getSpelling() const; |
7865 | |
7866 | |
7867 | static bool classof(const Attr *A) { return A->getKind() == attr::NoReturn; } |
7868 | }; |
7869 | |
7870 | class NoSanitizeAttr : public InheritableAttr { |
7871 | unsigned sanitizers_Size; |
7872 | StringRef *sanitizers_; |
7873 | |
7874 | public: |
7875 | enum Spelling { |
7876 | GNU_no_sanitize = 0, |
7877 | CXX11_clang_no_sanitize = 1, |
7878 | C23_clang_no_sanitize = 2, |
7879 | SpellingNotCalculated = 15 |
7880 | |
7881 | }; |
7882 | |
7883 | // Factory methods |
7884 | static NoSanitizeAttr *CreateImplicit(ASTContext &Ctx, StringRef *Sanitizers, unsigned , const AttributeCommonInfo &CommonInfo); |
7885 | static NoSanitizeAttr *Create(ASTContext &Ctx, StringRef *Sanitizers, unsigned , const AttributeCommonInfo &CommonInfo); |
7886 | static NoSanitizeAttr *CreateImplicit(ASTContext &Ctx, StringRef *Sanitizers, unsigned , SourceRange Range = {}, Spelling S = GNU_no_sanitize); |
7887 | static NoSanitizeAttr *Create(ASTContext &Ctx, StringRef *Sanitizers, unsigned , SourceRange Range = {}, Spelling S = GNU_no_sanitize); |
7888 | |
7889 | // Constructors |
7890 | NoSanitizeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
7891 | , StringRef *Sanitizers, unsigned |
7892 | ); |
7893 | NoSanitizeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
7894 | ); |
7895 | |
7896 | NoSanitizeAttr *clone(ASTContext &C) const; |
7897 | void printPretty(raw_ostream &OS, |
7898 | const PrintingPolicy &Policy) const; |
7899 | const char *getSpelling() const; |
7900 | typedef StringRef* sanitizers_iterator; |
7901 | sanitizers_iterator sanitizers_begin() const { return sanitizers_; } |
7902 | sanitizers_iterator sanitizers_end() const { return sanitizers_ + sanitizers_Size; } |
7903 | unsigned sanitizers_size() const { return sanitizers_Size; } |
7904 | llvm::iterator_range<sanitizers_iterator> sanitizers() const { return llvm::make_range(x: sanitizers_begin(), y: sanitizers_end()); } |
7905 | |
7906 | |
7907 | |
7908 | SanitizerMask getMask() const { |
7909 | SanitizerMask Mask; |
7910 | for (auto SanitizerName : sanitizers()) { |
7911 | SanitizerMask ParsedMask = |
7912 | parseSanitizerValue(Value: SanitizerName, /*AllowGroups=*/AllowGroups: true); |
7913 | Mask |= expandSanitizerGroups(Kinds: ParsedMask); |
7914 | } |
7915 | return Mask; |
7916 | } |
7917 | |
7918 | bool hasCoverage() const { |
7919 | return llvm::is_contained(Range: sanitizers(), Element: "coverage" ); |
7920 | } |
7921 | |
7922 | |
7923 | static bool classof(const Attr *A) { return A->getKind() == attr::NoSanitize; } |
7924 | }; |
7925 | |
7926 | class NoSpeculativeLoadHardeningAttr : public InheritableAttr { |
7927 | public: |
7928 | enum Spelling { |
7929 | GNU_no_speculative_load_hardening = 0, |
7930 | CXX11_clang_no_speculative_load_hardening = 1, |
7931 | C23_clang_no_speculative_load_hardening = 2, |
7932 | SpellingNotCalculated = 15 |
7933 | |
7934 | }; |
7935 | |
7936 | // Factory methods |
7937 | static NoSpeculativeLoadHardeningAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7938 | static NoSpeculativeLoadHardeningAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7939 | static NoSpeculativeLoadHardeningAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_no_speculative_load_hardening); |
7940 | static NoSpeculativeLoadHardeningAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_no_speculative_load_hardening); |
7941 | |
7942 | // Constructors |
7943 | NoSpeculativeLoadHardeningAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
7944 | ); |
7945 | |
7946 | NoSpeculativeLoadHardeningAttr *clone(ASTContext &C) const; |
7947 | void printPretty(raw_ostream &OS, |
7948 | const PrintingPolicy &Policy) const; |
7949 | const char *getSpelling() const; |
7950 | |
7951 | |
7952 | static bool classof(const Attr *A) { return A->getKind() == attr::NoSpeculativeLoadHardening; } |
7953 | }; |
7954 | |
7955 | class NoSplitStackAttr : public InheritableAttr { |
7956 | public: |
7957 | enum Spelling { |
7958 | GNU_no_split_stack = 0, |
7959 | CXX11_gnu_no_split_stack = 1, |
7960 | C23_gnu_no_split_stack = 2, |
7961 | SpellingNotCalculated = 15 |
7962 | |
7963 | }; |
7964 | |
7965 | // Factory methods |
7966 | static NoSplitStackAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7967 | static NoSplitStackAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7968 | static NoSplitStackAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_no_split_stack); |
7969 | static NoSplitStackAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_no_split_stack); |
7970 | |
7971 | // Constructors |
7972 | NoSplitStackAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
7973 | ); |
7974 | |
7975 | NoSplitStackAttr *clone(ASTContext &C) const; |
7976 | void printPretty(raw_ostream &OS, |
7977 | const PrintingPolicy &Policy) const; |
7978 | const char *getSpelling() const; |
7979 | |
7980 | |
7981 | static bool classof(const Attr *A) { return A->getKind() == attr::NoSplitStack; } |
7982 | }; |
7983 | |
7984 | class NoStackProtectorAttr : public InheritableAttr { |
7985 | public: |
7986 | enum Spelling { |
7987 | GNU_no_stack_protector = 0, |
7988 | CXX11_clang_no_stack_protector = 1, |
7989 | C23_clang_no_stack_protector = 2, |
7990 | CXX11_gnu_no_stack_protector = 3, |
7991 | C23_gnu_no_stack_protector = 4, |
7992 | Declspec_safebuffers = 5, |
7993 | SpellingNotCalculated = 15 |
7994 | |
7995 | }; |
7996 | |
7997 | // Factory methods |
7998 | static NoStackProtectorAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
7999 | static NoStackProtectorAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
8000 | static NoStackProtectorAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_no_stack_protector); |
8001 | static NoStackProtectorAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_no_stack_protector); |
8002 | |
8003 | // Constructors |
8004 | NoStackProtectorAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
8005 | ); |
8006 | |
8007 | NoStackProtectorAttr *clone(ASTContext &C) const; |
8008 | void printPretty(raw_ostream &OS, |
8009 | const PrintingPolicy &Policy) const; |
8010 | const char *getSpelling() const; |
8011 | Spelling getSemanticSpelling() const; |
8012 | |
8013 | |
8014 | static bool classof(const Attr *A) { return A->getKind() == attr::NoStackProtector; } |
8015 | }; |
8016 | |
8017 | class NoThreadSafetyAnalysisAttr : public InheritableAttr { |
8018 | public: |
8019 | enum Spelling { |
8020 | GNU_no_thread_safety_analysis = 0, |
8021 | CXX11_clang_no_thread_safety_analysis = 1, |
8022 | C23_clang_no_thread_safety_analysis = 2, |
8023 | SpellingNotCalculated = 15 |
8024 | |
8025 | }; |
8026 | |
8027 | // Factory methods |
8028 | static NoThreadSafetyAnalysisAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
8029 | static NoThreadSafetyAnalysisAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
8030 | static NoThreadSafetyAnalysisAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_no_thread_safety_analysis); |
8031 | static NoThreadSafetyAnalysisAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_no_thread_safety_analysis); |
8032 | |
8033 | // Constructors |
8034 | NoThreadSafetyAnalysisAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
8035 | ); |
8036 | |
8037 | NoThreadSafetyAnalysisAttr *clone(ASTContext &C) const; |
8038 | void printPretty(raw_ostream &OS, |
8039 | const PrintingPolicy &Policy) const; |
8040 | const char *getSpelling() const; |
8041 | |
8042 | |
8043 | static bool classof(const Attr *A) { return A->getKind() == attr::NoThreadSafetyAnalysis; } |
8044 | }; |
8045 | |
8046 | class NoThrowAttr : public InheritableAttr { |
8047 | public: |
8048 | enum Spelling { |
8049 | GNU_nothrow = 0, |
8050 | CXX11_gnu_nothrow = 1, |
8051 | C23_gnu_nothrow = 2, |
8052 | Declspec_nothrow = 3, |
8053 | SpellingNotCalculated = 15 |
8054 | |
8055 | }; |
8056 | |
8057 | // Factory methods |
8058 | static NoThrowAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
8059 | static NoThrowAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
8060 | static NoThrowAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_nothrow); |
8061 | static NoThrowAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_nothrow); |
8062 | |
8063 | // Constructors |
8064 | NoThrowAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
8065 | ); |
8066 | |
8067 | NoThrowAttr *clone(ASTContext &C) const; |
8068 | void printPretty(raw_ostream &OS, |
8069 | const PrintingPolicy &Policy) const; |
8070 | const char *getSpelling() const; |
8071 | |
8072 | |
8073 | static bool classof(const Attr *A) { return A->getKind() == attr::NoThrow; } |
8074 | }; |
8075 | |
8076 | class NoUniqueAddressAttr : public InheritableAttr { |
8077 | public: |
8078 | enum Spelling { |
8079 | CXX11_no_unique_address = 0, |
8080 | CXX11_msvc_no_unique_address = 1, |
8081 | SpellingNotCalculated = 15 |
8082 | |
8083 | }; |
8084 | |
8085 | // Factory methods |
8086 | static NoUniqueAddressAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
8087 | static NoUniqueAddressAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
8088 | static NoUniqueAddressAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = CXX11_no_unique_address); |
8089 | static NoUniqueAddressAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = CXX11_no_unique_address); |
8090 | |
8091 | // Constructors |
8092 | NoUniqueAddressAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
8093 | ); |
8094 | |
8095 | NoUniqueAddressAttr *clone(ASTContext &C) const; |
8096 | void printPretty(raw_ostream &OS, |
8097 | const PrintingPolicy &Policy) const; |
8098 | const char *getSpelling() const; |
8099 | |
8100 | |
8101 | static bool classof(const Attr *A) { return A->getKind() == attr::NoUniqueAddress; } |
8102 | }; |
8103 | |
8104 | class NoUwtableAttr : public InheritableAttr { |
8105 | public: |
8106 | enum Spelling { |
8107 | GNU_nouwtable = 0, |
8108 | CXX11_clang_nouwtable = 1, |
8109 | C23_clang_nouwtable = 2, |
8110 | SpellingNotCalculated = 15 |
8111 | |
8112 | }; |
8113 | |
8114 | // Factory methods |
8115 | static NoUwtableAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
8116 | static NoUwtableAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
8117 | static NoUwtableAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_nouwtable); |
8118 | static NoUwtableAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_nouwtable); |
8119 | |
8120 | // Constructors |
8121 | NoUwtableAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
8122 | ); |
8123 | |
8124 | NoUwtableAttr *clone(ASTContext &C) const; |
8125 | void printPretty(raw_ostream &OS, |
8126 | const PrintingPolicy &Policy) const; |
8127 | const char *getSpelling() const; |
8128 | |
8129 | |
8130 | static bool classof(const Attr *A) { return A->getKind() == attr::NoUwtable; } |
8131 | }; |
8132 | |
8133 | class NonAllocatingAttr : public TypeAttr { |
8134 | Expr * cond; |
8135 | |
8136 | public: |
8137 | enum Spelling { |
8138 | GNU_nonallocating = 0, |
8139 | CXX11_clang_nonallocating = 1, |
8140 | C23_clang_nonallocating = 2, |
8141 | SpellingNotCalculated = 15 |
8142 | |
8143 | }; |
8144 | |
8145 | // Factory methods |
8146 | static NonAllocatingAttr *CreateImplicit(ASTContext &Ctx, Expr * Cond, const AttributeCommonInfo &CommonInfo); |
8147 | static NonAllocatingAttr *Create(ASTContext &Ctx, Expr * Cond, const AttributeCommonInfo &CommonInfo); |
8148 | static NonAllocatingAttr *CreateImplicit(ASTContext &Ctx, Expr * Cond, SourceRange Range = {}, Spelling S = GNU_nonallocating); |
8149 | static NonAllocatingAttr *Create(ASTContext &Ctx, Expr * Cond, SourceRange Range = {}, Spelling S = GNU_nonallocating); |
8150 | |
8151 | // Constructors |
8152 | NonAllocatingAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
8153 | , Expr * Cond |
8154 | ); |
8155 | NonAllocatingAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
8156 | ); |
8157 | |
8158 | NonAllocatingAttr *clone(ASTContext &C) const; |
8159 | void printPretty(raw_ostream &OS, |
8160 | const PrintingPolicy &Policy) const; |
8161 | const char *getSpelling() const; |
8162 | Expr * getCond() const { |
8163 | return cond; |
8164 | } |
8165 | |
8166 | |
8167 | |
8168 | static bool classof(const Attr *A) { return A->getKind() == attr::NonAllocating; } |
8169 | }; |
8170 | |
8171 | class NonBlockingAttr : public TypeAttr { |
8172 | Expr * cond; |
8173 | |
8174 | public: |
8175 | enum Spelling { |
8176 | GNU_nonblocking = 0, |
8177 | CXX11_clang_nonblocking = 1, |
8178 | C23_clang_nonblocking = 2, |
8179 | SpellingNotCalculated = 15 |
8180 | |
8181 | }; |
8182 | |
8183 | // Factory methods |
8184 | static NonBlockingAttr *CreateImplicit(ASTContext &Ctx, Expr * Cond, const AttributeCommonInfo &CommonInfo); |
8185 | static NonBlockingAttr *Create(ASTContext &Ctx, Expr * Cond, const AttributeCommonInfo &CommonInfo); |
8186 | static NonBlockingAttr *CreateImplicit(ASTContext &Ctx, Expr * Cond, SourceRange Range = {}, Spelling S = GNU_nonblocking); |
8187 | static NonBlockingAttr *Create(ASTContext &Ctx, Expr * Cond, SourceRange Range = {}, Spelling S = GNU_nonblocking); |
8188 | |
8189 | // Constructors |
8190 | NonBlockingAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
8191 | , Expr * Cond |
8192 | ); |
8193 | NonBlockingAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
8194 | ); |
8195 | |
8196 | NonBlockingAttr *clone(ASTContext &C) const; |
8197 | void printPretty(raw_ostream &OS, |
8198 | const PrintingPolicy &Policy) const; |
8199 | const char *getSpelling() const; |
8200 | Expr * getCond() const { |
8201 | return cond; |
8202 | } |
8203 | |
8204 | |
8205 | |
8206 | static bool classof(const Attr *A) { return A->getKind() == attr::NonBlocking; } |
8207 | }; |
8208 | |
8209 | class NonNullAttr : public InheritableParamAttr { |
8210 | unsigned args_Size; |
8211 | ParamIdx *args_; |
8212 | |
8213 | public: |
8214 | enum Spelling { |
8215 | GNU_nonnull = 0, |
8216 | CXX11_gnu_nonnull = 1, |
8217 | C23_gnu_nonnull = 2, |
8218 | SpellingNotCalculated = 15 |
8219 | |
8220 | }; |
8221 | |
8222 | // Factory methods |
8223 | static NonNullAttr *CreateImplicit(ASTContext &Ctx, ParamIdx *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo); |
8224 | static NonNullAttr *Create(ASTContext &Ctx, ParamIdx *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo); |
8225 | static NonNullAttr *CreateImplicit(ASTContext &Ctx, ParamIdx *Args, unsigned ArgsSize, SourceRange Range = {}, Spelling S = GNU_nonnull); |
8226 | static NonNullAttr *Create(ASTContext &Ctx, ParamIdx *Args, unsigned ArgsSize, SourceRange Range = {}, Spelling S = GNU_nonnull); |
8227 | |
8228 | // Constructors |
8229 | NonNullAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
8230 | , ParamIdx *Args, unsigned ArgsSize |
8231 | ); |
8232 | NonNullAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
8233 | ); |
8234 | |
8235 | NonNullAttr *clone(ASTContext &C) const; |
8236 | void printPretty(raw_ostream &OS, |
8237 | const PrintingPolicy &Policy) const; |
8238 | const char *getSpelling() const; |
8239 | typedef ParamIdx* args_iterator; |
8240 | args_iterator args_begin() const { return args_; } |
8241 | args_iterator args_end() const { return args_ + args_Size; } |
8242 | unsigned args_size() const { return args_Size; } |
8243 | llvm::iterator_range<args_iterator> args() const { return llvm::make_range(x: args_begin(), y: args_end()); } |
8244 | |
8245 | |
8246 | |
8247 | bool isNonNull(unsigned IdxAST) const { |
8248 | if (!args_size()) |
8249 | return true; |
8250 | return llvm::any_of(Range: args(), P: [=](const ParamIdx &Idx) { |
8251 | return Idx.getASTIndex() == IdxAST; |
8252 | }); |
8253 | } |
8254 | |
8255 | |
8256 | static bool classof(const Attr *A) { return A->getKind() == attr::NonNull; } |
8257 | }; |
8258 | |
8259 | class NotTailCalledAttr : public InheritableAttr { |
8260 | public: |
8261 | enum Spelling { |
8262 | GNU_not_tail_called = 0, |
8263 | CXX11_clang_not_tail_called = 1, |
8264 | C23_clang_not_tail_called = 2, |
8265 | SpellingNotCalculated = 15 |
8266 | |
8267 | }; |
8268 | |
8269 | // Factory methods |
8270 | static NotTailCalledAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
8271 | static NotTailCalledAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
8272 | static NotTailCalledAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_not_tail_called); |
8273 | static NotTailCalledAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_not_tail_called); |
8274 | |
8275 | // Constructors |
8276 | NotTailCalledAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
8277 | ); |
8278 | |
8279 | NotTailCalledAttr *clone(ASTContext &C) const; |
8280 | void printPretty(raw_ostream &OS, |
8281 | const PrintingPolicy &Policy) const; |
8282 | const char *getSpelling() const; |
8283 | |
8284 | |
8285 | static bool classof(const Attr *A) { return A->getKind() == attr::NotTailCalled; } |
8286 | }; |
8287 | |
8288 | class OMPAllocateDeclAttr : public InheritableAttr { |
8289 | public: |
8290 | enum AllocatorTypeTy { |
8291 | OMPNullMemAlloc, |
8292 | OMPDefaultMemAlloc, |
8293 | OMPLargeCapMemAlloc, |
8294 | OMPConstMemAlloc, |
8295 | OMPHighBWMemAlloc, |
8296 | OMPLowLatMemAlloc, |
8297 | OMPCGroupMemAlloc, |
8298 | OMPPTeamMemAlloc, |
8299 | OMPThreadMemAlloc, |
8300 | OMPUserDefinedMemAlloc |
8301 | }; |
8302 | private: |
8303 | OMPAllocateDeclAttr::AllocatorTypeTy allocatorType; |
8304 | |
8305 | Expr * allocator; |
8306 | |
8307 | Expr * alignment; |
8308 | |
8309 | public: |
8310 | // Factory methods |
8311 | static OMPAllocateDeclAttr *CreateImplicit(ASTContext &Ctx, OMPAllocateDeclAttr::AllocatorTypeTy AllocatorType, Expr * Allocator, Expr * Alignment, const AttributeCommonInfo &CommonInfo); |
8312 | static OMPAllocateDeclAttr *Create(ASTContext &Ctx, OMPAllocateDeclAttr::AllocatorTypeTy AllocatorType, Expr * Allocator, Expr * Alignment, const AttributeCommonInfo &CommonInfo); |
8313 | static OMPAllocateDeclAttr *CreateImplicit(ASTContext &Ctx, OMPAllocateDeclAttr::AllocatorTypeTy AllocatorType, Expr * Allocator, Expr * Alignment, SourceRange Range = {}); |
8314 | static OMPAllocateDeclAttr *Create(ASTContext &Ctx, OMPAllocateDeclAttr::AllocatorTypeTy AllocatorType, Expr * Allocator, Expr * Alignment, SourceRange Range = {}); |
8315 | |
8316 | // Constructors |
8317 | OMPAllocateDeclAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
8318 | , OMPAllocateDeclAttr::AllocatorTypeTy AllocatorType |
8319 | , Expr * Allocator |
8320 | , Expr * Alignment |
8321 | ); |
8322 | |
8323 | OMPAllocateDeclAttr *clone(ASTContext &C) const; |
8324 | void printPretty(raw_ostream &OS, |
8325 | const PrintingPolicy &Policy) const; |
8326 | const char *getSpelling() const; |
8327 | OMPAllocateDeclAttr::AllocatorTypeTy getAllocatorType() const { |
8328 | return allocatorType; |
8329 | } |
8330 | |
8331 | static bool ConvertStrToAllocatorTypeTy(StringRef Val, OMPAllocateDeclAttr::AllocatorTypeTy &Out); |
8332 | static const char *ConvertAllocatorTypeTyToStr(OMPAllocateDeclAttr::AllocatorTypeTy Val); |
8333 | Expr * getAllocator() const { |
8334 | return allocator; |
8335 | } |
8336 | |
8337 | Expr * getAlignment() const { |
8338 | return alignment; |
8339 | } |
8340 | |
8341 | |
8342 | |
8343 | static bool classof(const Attr *A) { return A->getKind() == attr::OMPAllocateDecl; } |
8344 | }; |
8345 | |
8346 | class OMPAssumeAttr : public InheritableAttr { |
8347 | unsigned assumptionLength; |
8348 | char *assumption; |
8349 | |
8350 | public: |
8351 | // Factory methods |
8352 | static OMPAssumeAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Assumption, const AttributeCommonInfo &CommonInfo); |
8353 | static OMPAssumeAttr *Create(ASTContext &Ctx, llvm::StringRef Assumption, const AttributeCommonInfo &CommonInfo); |
8354 | static OMPAssumeAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Assumption, SourceRange Range = {}); |
8355 | static OMPAssumeAttr *Create(ASTContext &Ctx, llvm::StringRef Assumption, SourceRange Range = {}); |
8356 | |
8357 | // Constructors |
8358 | OMPAssumeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
8359 | , llvm::StringRef Assumption |
8360 | ); |
8361 | |
8362 | OMPAssumeAttr *clone(ASTContext &C) const; |
8363 | void printPretty(raw_ostream &OS, |
8364 | const PrintingPolicy &Policy) const; |
8365 | const char *getSpelling() const; |
8366 | llvm::StringRef getAssumption() const { |
8367 | return llvm::StringRef(assumption, assumptionLength); |
8368 | } |
8369 | unsigned getAssumptionLength() const { |
8370 | return assumptionLength; |
8371 | } |
8372 | void setAssumption(ASTContext &C, llvm::StringRef S) { |
8373 | assumptionLength = S.size(); |
8374 | this->assumption = new (C, 1) char [assumptionLength]; |
8375 | if (!S.empty()) |
8376 | std::memcpy(dest: this->assumption, src: S.data(), n: assumptionLength); |
8377 | } |
8378 | |
8379 | |
8380 | |
8381 | static bool classof(const Attr *A) { return A->getKind() == attr::OMPAssume; } |
8382 | }; |
8383 | |
8384 | class OMPCaptureKindAttr : public Attr { |
8385 | unsigned captureKindVal; |
8386 | |
8387 | public: |
8388 | // Factory methods |
8389 | static OMPCaptureKindAttr *CreateImplicit(ASTContext &Ctx, unsigned CaptureKindVal, const AttributeCommonInfo &CommonInfo); |
8390 | static OMPCaptureKindAttr *Create(ASTContext &Ctx, unsigned CaptureKindVal, const AttributeCommonInfo &CommonInfo); |
8391 | static OMPCaptureKindAttr *CreateImplicit(ASTContext &Ctx, unsigned CaptureKindVal, SourceRange Range = {}); |
8392 | static OMPCaptureKindAttr *Create(ASTContext &Ctx, unsigned CaptureKindVal, SourceRange Range = {}); |
8393 | |
8394 | // Constructors |
8395 | OMPCaptureKindAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
8396 | , unsigned CaptureKindVal |
8397 | ); |
8398 | |
8399 | OMPCaptureKindAttr *clone(ASTContext &C) const; |
8400 | void printPretty(raw_ostream &OS, |
8401 | const PrintingPolicy &Policy) const; |
8402 | const char *getSpelling() const; |
8403 | unsigned getCaptureKindVal() const { |
8404 | return captureKindVal; |
8405 | } |
8406 | |
8407 | |
8408 | llvm::omp::Clause getCaptureKind() const { |
8409 | return static_cast<llvm::omp::Clause>(getCaptureKindVal()); |
8410 | } |
8411 | |
8412 | |
8413 | static bool classof(const Attr *A) { return A->getKind() == attr::OMPCaptureKind; } |
8414 | }; |
8415 | |
8416 | class OMPCaptureNoInitAttr : public InheritableAttr { |
8417 | public: |
8418 | // Factory methods |
8419 | static OMPCaptureNoInitAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
8420 | static OMPCaptureNoInitAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
8421 | static OMPCaptureNoInitAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
8422 | static OMPCaptureNoInitAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
8423 | |
8424 | // Constructors |
8425 | OMPCaptureNoInitAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
8426 | ); |
8427 | |
8428 | OMPCaptureNoInitAttr *clone(ASTContext &C) const; |
8429 | void printPretty(raw_ostream &OS, |
8430 | const PrintingPolicy &Policy) const; |
8431 | const char *getSpelling() const; |
8432 | |
8433 | |
8434 | static bool classof(const Attr *A) { return A->getKind() == attr::OMPCaptureNoInit; } |
8435 | }; |
8436 | |
8437 | class OMPDeclareSimdDeclAttr : public Attr { |
8438 | public: |
8439 | enum BranchStateTy { |
8440 | BS_Undefined, |
8441 | BS_Inbranch, |
8442 | BS_Notinbranch |
8443 | }; |
8444 | private: |
8445 | OMPDeclareSimdDeclAttr::BranchStateTy branchState; |
8446 | |
8447 | Expr * simdlen; |
8448 | |
8449 | unsigned uniforms_Size; |
8450 | Expr * *uniforms_; |
8451 | |
8452 | unsigned aligneds_Size; |
8453 | Expr * *aligneds_; |
8454 | |
8455 | unsigned alignments_Size; |
8456 | Expr * *alignments_; |
8457 | |
8458 | unsigned linears_Size; |
8459 | Expr * *linears_; |
8460 | |
8461 | unsigned modifiers_Size; |
8462 | unsigned *modifiers_; |
8463 | |
8464 | unsigned steps_Size; |
8465 | Expr * *steps_; |
8466 | |
8467 | public: |
8468 | // Factory methods |
8469 | static OMPDeclareSimdDeclAttr *CreateImplicit(ASTContext &Ctx, OMPDeclareSimdDeclAttr::BranchStateTy BranchState, Expr * Simdlen, Expr * *Uniforms, unsigned UniformsSize, Expr * *Aligneds, unsigned AlignedsSize, Expr * *Alignments, unsigned AlignmentsSize, Expr * *Linears, unsigned , unsigned *Modifiers, unsigned , Expr * *Steps, unsigned StepsSize, const AttributeCommonInfo &CommonInfo); |
8470 | static OMPDeclareSimdDeclAttr *Create(ASTContext &Ctx, OMPDeclareSimdDeclAttr::BranchStateTy BranchState, Expr * Simdlen, Expr * *Uniforms, unsigned UniformsSize, Expr * *Aligneds, unsigned AlignedsSize, Expr * *Alignments, unsigned AlignmentsSize, Expr * *Linears, unsigned , unsigned *Modifiers, unsigned , Expr * *Steps, unsigned StepsSize, const AttributeCommonInfo &CommonInfo); |
8471 | static OMPDeclareSimdDeclAttr *CreateImplicit(ASTContext &Ctx, OMPDeclareSimdDeclAttr::BranchStateTy BranchState, Expr * Simdlen, Expr * *Uniforms, unsigned UniformsSize, Expr * *Aligneds, unsigned AlignedsSize, Expr * *Alignments, unsigned AlignmentsSize, Expr * *Linears, unsigned , unsigned *Modifiers, unsigned , Expr * *Steps, unsigned StepsSize, SourceRange Range = {}); |
8472 | static OMPDeclareSimdDeclAttr *Create(ASTContext &Ctx, OMPDeclareSimdDeclAttr::BranchStateTy BranchState, Expr * Simdlen, Expr * *Uniforms, unsigned UniformsSize, Expr * *Aligneds, unsigned AlignedsSize, Expr * *Alignments, unsigned AlignmentsSize, Expr * *Linears, unsigned , unsigned *Modifiers, unsigned , Expr * *Steps, unsigned StepsSize, SourceRange Range = {}); |
8473 | |
8474 | // Constructors |
8475 | OMPDeclareSimdDeclAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
8476 | , OMPDeclareSimdDeclAttr::BranchStateTy BranchState |
8477 | , Expr * Simdlen |
8478 | , Expr * *Uniforms, unsigned UniformsSize |
8479 | , Expr * *Aligneds, unsigned AlignedsSize |
8480 | , Expr * *Alignments, unsigned AlignmentsSize |
8481 | , Expr * *Linears, unsigned |
8482 | , unsigned *Modifiers, unsigned |
8483 | , Expr * *Steps, unsigned StepsSize |
8484 | ); |
8485 | OMPDeclareSimdDeclAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
8486 | , OMPDeclareSimdDeclAttr::BranchStateTy BranchState |
8487 | , Expr * Simdlen |
8488 | ); |
8489 | |
8490 | OMPDeclareSimdDeclAttr *clone(ASTContext &C) const; |
8491 | void printPretty(raw_ostream &OS, |
8492 | const PrintingPolicy &Policy) const; |
8493 | const char *getSpelling() const; |
8494 | OMPDeclareSimdDeclAttr::BranchStateTy getBranchState() const { |
8495 | return branchState; |
8496 | } |
8497 | |
8498 | static bool ConvertStrToBranchStateTy(StringRef Val, OMPDeclareSimdDeclAttr::BranchStateTy &Out); |
8499 | static const char *ConvertBranchStateTyToStr(OMPDeclareSimdDeclAttr::BranchStateTy Val); |
8500 | Expr * getSimdlen() const { |
8501 | return simdlen; |
8502 | } |
8503 | |
8504 | typedef Expr ** uniforms_iterator; |
8505 | uniforms_iterator uniforms_begin() const { return uniforms_; } |
8506 | uniforms_iterator uniforms_end() const { return uniforms_ + uniforms_Size; } |
8507 | unsigned uniforms_size() const { return uniforms_Size; } |
8508 | llvm::iterator_range<uniforms_iterator> uniforms() const { return llvm::make_range(x: uniforms_begin(), y: uniforms_end()); } |
8509 | |
8510 | |
8511 | typedef Expr ** aligneds_iterator; |
8512 | aligneds_iterator aligneds_begin() const { return aligneds_; } |
8513 | aligneds_iterator aligneds_end() const { return aligneds_ + aligneds_Size; } |
8514 | unsigned aligneds_size() const { return aligneds_Size; } |
8515 | llvm::iterator_range<aligneds_iterator> aligneds() const { return llvm::make_range(x: aligneds_begin(), y: aligneds_end()); } |
8516 | |
8517 | |
8518 | typedef Expr ** alignments_iterator; |
8519 | alignments_iterator alignments_begin() const { return alignments_; } |
8520 | alignments_iterator alignments_end() const { return alignments_ + alignments_Size; } |
8521 | unsigned alignments_size() const { return alignments_Size; } |
8522 | llvm::iterator_range<alignments_iterator> alignments() const { return llvm::make_range(x: alignments_begin(), y: alignments_end()); } |
8523 | |
8524 | |
8525 | typedef Expr ** linears_iterator; |
8526 | linears_iterator linears_begin() const { return linears_; } |
8527 | linears_iterator linears_end() const { return linears_ + linears_Size; } |
8528 | unsigned linears_size() const { return linears_Size; } |
8529 | llvm::iterator_range<linears_iterator> linears() const { return llvm::make_range(x: linears_begin(), y: linears_end()); } |
8530 | |
8531 | |
8532 | typedef unsigned* modifiers_iterator; |
8533 | modifiers_iterator modifiers_begin() const { return modifiers_; } |
8534 | modifiers_iterator modifiers_end() const { return modifiers_ + modifiers_Size; } |
8535 | unsigned modifiers_size() const { return modifiers_Size; } |
8536 | llvm::iterator_range<modifiers_iterator> modifiers() const { return llvm::make_range(x: modifiers_begin(), y: modifiers_end()); } |
8537 | |
8538 | |
8539 | typedef Expr ** steps_iterator; |
8540 | steps_iterator steps_begin() const { return steps_; } |
8541 | steps_iterator steps_end() const { return steps_ + steps_Size; } |
8542 | unsigned steps_size() const { return steps_Size; } |
8543 | llvm::iterator_range<steps_iterator> steps() const { return llvm::make_range(x: steps_begin(), y: steps_end()); } |
8544 | |
8545 | |
8546 | |
8547 | void printPrettyPragma(raw_ostream & OS, const PrintingPolicy &Policy) |
8548 | const; |
8549 | |
8550 | |
8551 | static bool classof(const Attr *A) { return A->getKind() == attr::OMPDeclareSimdDecl; } |
8552 | }; |
8553 | |
8554 | class OMPDeclareTargetDeclAttr : public InheritableAttr { |
8555 | public: |
8556 | enum MapTypeTy { |
8557 | MT_To, |
8558 | MT_Enter, |
8559 | MT_Link |
8560 | }; |
8561 | private: |
8562 | OMPDeclareTargetDeclAttr::MapTypeTy mapType; |
8563 | |
8564 | public: |
8565 | enum DevTypeTy { |
8566 | DT_Host, |
8567 | DT_NoHost, |
8568 | DT_Any |
8569 | }; |
8570 | private: |
8571 | OMPDeclareTargetDeclAttr::DevTypeTy devType; |
8572 | |
8573 | Expr * indirectExpr; |
8574 | |
8575 | bool indirect; |
8576 | |
8577 | unsigned level; |
8578 | |
8579 | public: |
8580 | // Factory methods |
8581 | static OMPDeclareTargetDeclAttr *CreateImplicit(ASTContext &Ctx, OMPDeclareTargetDeclAttr::MapTypeTy MapType, OMPDeclareTargetDeclAttr::DevTypeTy DevType, Expr * IndirectExpr, bool Indirect, unsigned Level, const AttributeCommonInfo &CommonInfo); |
8582 | static OMPDeclareTargetDeclAttr *Create(ASTContext &Ctx, OMPDeclareTargetDeclAttr::MapTypeTy MapType, OMPDeclareTargetDeclAttr::DevTypeTy DevType, Expr * IndirectExpr, bool Indirect, unsigned Level, const AttributeCommonInfo &CommonInfo); |
8583 | static OMPDeclareTargetDeclAttr *CreateImplicit(ASTContext &Ctx, OMPDeclareTargetDeclAttr::MapTypeTy MapType, OMPDeclareTargetDeclAttr::DevTypeTy DevType, Expr * IndirectExpr, bool Indirect, unsigned Level, SourceRange Range = {}); |
8584 | static OMPDeclareTargetDeclAttr *Create(ASTContext &Ctx, OMPDeclareTargetDeclAttr::MapTypeTy MapType, OMPDeclareTargetDeclAttr::DevTypeTy DevType, Expr * IndirectExpr, bool Indirect, unsigned Level, SourceRange Range = {}); |
8585 | |
8586 | // Constructors |
8587 | OMPDeclareTargetDeclAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
8588 | , OMPDeclareTargetDeclAttr::MapTypeTy MapType |
8589 | , OMPDeclareTargetDeclAttr::DevTypeTy DevType |
8590 | , Expr * IndirectExpr |
8591 | , bool Indirect |
8592 | , unsigned Level |
8593 | ); |
8594 | |
8595 | OMPDeclareTargetDeclAttr *clone(ASTContext &C) const; |
8596 | void printPretty(raw_ostream &OS, |
8597 | const PrintingPolicy &Policy) const; |
8598 | const char *getSpelling() const; |
8599 | OMPDeclareTargetDeclAttr::MapTypeTy getMapType() const { |
8600 | return mapType; |
8601 | } |
8602 | |
8603 | static bool ConvertStrToMapTypeTy(StringRef Val, OMPDeclareTargetDeclAttr::MapTypeTy &Out); |
8604 | static const char *ConvertMapTypeTyToStr(OMPDeclareTargetDeclAttr::MapTypeTy Val); |
8605 | OMPDeclareTargetDeclAttr::DevTypeTy getDevType() const { |
8606 | return devType; |
8607 | } |
8608 | |
8609 | static bool ConvertStrToDevTypeTy(StringRef Val, OMPDeclareTargetDeclAttr::DevTypeTy &Out); |
8610 | static const char *ConvertDevTypeTyToStr(OMPDeclareTargetDeclAttr::DevTypeTy Val); |
8611 | Expr * getIndirectExpr() const { |
8612 | return indirectExpr; |
8613 | } |
8614 | |
8615 | bool getIndirect() const { |
8616 | return indirect; |
8617 | } |
8618 | |
8619 | unsigned getLevel() const { |
8620 | return level; |
8621 | } |
8622 | |
8623 | |
8624 | void printPrettyPragma(raw_ostream &OS, const PrintingPolicy &Policy) const; |
8625 | static std::optional<MapTypeTy> |
8626 | isDeclareTargetDeclaration(const ValueDecl *VD); |
8627 | static std::optional<OMPDeclareTargetDeclAttr*> getActiveAttr(const ValueDecl *VD); |
8628 | static std::optional<DevTypeTy> getDeviceType(const ValueDecl *VD); |
8629 | static std::optional<SourceLocation> getLocation(const ValueDecl *VD); |
8630 | |
8631 | |
8632 | static bool classof(const Attr *A) { return A->getKind() == attr::OMPDeclareTargetDecl; } |
8633 | }; |
8634 | |
8635 | class OMPDeclareVariantAttr : public InheritableAttr { |
8636 | Expr * variantFuncRef; |
8637 | |
8638 | OMPTraitInfo * traitInfos; |
8639 | |
8640 | unsigned adjustArgsNothing_Size; |
8641 | Expr * *adjustArgsNothing_; |
8642 | |
8643 | unsigned adjustArgsNeedDevicePtr_Size; |
8644 | Expr * *adjustArgsNeedDevicePtr_; |
8645 | |
8646 | unsigned appendArgs_Size; |
8647 | OMPInteropInfo *appendArgs_; |
8648 | |
8649 | public: |
8650 | // Factory methods |
8651 | static OMPDeclareVariantAttr *CreateImplicit(ASTContext &Ctx, Expr * VariantFuncRef, OMPTraitInfo * TraitInfos, Expr * *AdjustArgsNothing, unsigned AdjustArgsNothingSize, Expr * *AdjustArgsNeedDevicePtr, unsigned AdjustArgsNeedDevicePtrSize, OMPInteropInfo *AppendArgs, unsigned AppendArgsSize, const AttributeCommonInfo &CommonInfo); |
8652 | static OMPDeclareVariantAttr *Create(ASTContext &Ctx, Expr * VariantFuncRef, OMPTraitInfo * TraitInfos, Expr * *AdjustArgsNothing, unsigned AdjustArgsNothingSize, Expr * *AdjustArgsNeedDevicePtr, unsigned AdjustArgsNeedDevicePtrSize, OMPInteropInfo *AppendArgs, unsigned AppendArgsSize, const AttributeCommonInfo &CommonInfo); |
8653 | static OMPDeclareVariantAttr *CreateImplicit(ASTContext &Ctx, Expr * VariantFuncRef, OMPTraitInfo * TraitInfos, Expr * *AdjustArgsNothing, unsigned AdjustArgsNothingSize, Expr * *AdjustArgsNeedDevicePtr, unsigned AdjustArgsNeedDevicePtrSize, OMPInteropInfo *AppendArgs, unsigned AppendArgsSize, SourceRange Range = {}); |
8654 | static OMPDeclareVariantAttr *Create(ASTContext &Ctx, Expr * VariantFuncRef, OMPTraitInfo * TraitInfos, Expr * *AdjustArgsNothing, unsigned AdjustArgsNothingSize, Expr * *AdjustArgsNeedDevicePtr, unsigned AdjustArgsNeedDevicePtrSize, OMPInteropInfo *AppendArgs, unsigned AppendArgsSize, SourceRange Range = {}); |
8655 | |
8656 | // Constructors |
8657 | OMPDeclareVariantAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
8658 | , Expr * VariantFuncRef |
8659 | , OMPTraitInfo * TraitInfos |
8660 | , Expr * *AdjustArgsNothing, unsigned AdjustArgsNothingSize |
8661 | , Expr * *AdjustArgsNeedDevicePtr, unsigned AdjustArgsNeedDevicePtrSize |
8662 | , OMPInteropInfo *AppendArgs, unsigned AppendArgsSize |
8663 | ); |
8664 | OMPDeclareVariantAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
8665 | , Expr * VariantFuncRef |
8666 | , OMPTraitInfo * TraitInfos |
8667 | , OMPInteropInfo *AppendArgs, unsigned AppendArgsSize |
8668 | ); |
8669 | |
8670 | OMPDeclareVariantAttr *clone(ASTContext &C) const; |
8671 | void printPretty(raw_ostream &OS, |
8672 | const PrintingPolicy &Policy) const; |
8673 | const char *getSpelling() const; |
8674 | Expr * getVariantFuncRef() const { |
8675 | return variantFuncRef; |
8676 | } |
8677 | |
8678 | OMPTraitInfo * getTraitInfos() const { |
8679 | return traitInfos; |
8680 | } |
8681 | |
8682 | typedef Expr ** adjustArgsNothing_iterator; |
8683 | adjustArgsNothing_iterator adjustArgsNothing_begin() const { return adjustArgsNothing_; } |
8684 | adjustArgsNothing_iterator adjustArgsNothing_end() const { return adjustArgsNothing_ + adjustArgsNothing_Size; } |
8685 | unsigned adjustArgsNothing_size() const { return adjustArgsNothing_Size; } |
8686 | llvm::iterator_range<adjustArgsNothing_iterator> adjustArgsNothing() const { return llvm::make_range(x: adjustArgsNothing_begin(), y: adjustArgsNothing_end()); } |
8687 | |
8688 | |
8689 | typedef Expr ** adjustArgsNeedDevicePtr_iterator; |
8690 | adjustArgsNeedDevicePtr_iterator adjustArgsNeedDevicePtr_begin() const { return adjustArgsNeedDevicePtr_; } |
8691 | adjustArgsNeedDevicePtr_iterator adjustArgsNeedDevicePtr_end() const { return adjustArgsNeedDevicePtr_ + adjustArgsNeedDevicePtr_Size; } |
8692 | unsigned adjustArgsNeedDevicePtr_size() const { return adjustArgsNeedDevicePtr_Size; } |
8693 | llvm::iterator_range<adjustArgsNeedDevicePtr_iterator> adjustArgsNeedDevicePtr() const { return llvm::make_range(x: adjustArgsNeedDevicePtr_begin(), y: adjustArgsNeedDevicePtr_end()); } |
8694 | |
8695 | |
8696 | typedef OMPInteropInfo* appendArgs_iterator; |
8697 | appendArgs_iterator appendArgs_begin() const { return appendArgs_; } |
8698 | appendArgs_iterator appendArgs_end() const { return appendArgs_ + appendArgs_Size; } |
8699 | unsigned appendArgs_size() const { return appendArgs_Size; } |
8700 | llvm::iterator_range<appendArgs_iterator> appendArgs() const { return llvm::make_range(x: appendArgs_begin(), y: appendArgs_end()); } |
8701 | |
8702 | |
8703 | |
8704 | OMPTraitInfo &getTraitInfo() { return *traitInfos; } |
8705 | void printPrettyPragma(raw_ostream & OS, const PrintingPolicy &Policy) |
8706 | const; |
8707 | static StringRef getInteropTypeString(const OMPInteropInfo *I) { |
8708 | if (I->IsTarget && I->IsTargetSync) |
8709 | return "target,targetsync" ; |
8710 | if (I->IsTarget) |
8711 | return "target" ; |
8712 | return "targetsync" ; |
8713 | } |
8714 | |
8715 | |
8716 | static bool classof(const Attr *A) { return A->getKind() == attr::OMPDeclareVariant; } |
8717 | }; |
8718 | |
8719 | class OMPReferencedVarAttr : public Attr { |
8720 | Expr * ref; |
8721 | |
8722 | public: |
8723 | // Factory methods |
8724 | static OMPReferencedVarAttr *CreateImplicit(ASTContext &Ctx, Expr * Ref, const AttributeCommonInfo &CommonInfo); |
8725 | static OMPReferencedVarAttr *Create(ASTContext &Ctx, Expr * Ref, const AttributeCommonInfo &CommonInfo); |
8726 | static OMPReferencedVarAttr *CreateImplicit(ASTContext &Ctx, Expr * Ref, SourceRange Range = {}); |
8727 | static OMPReferencedVarAttr *Create(ASTContext &Ctx, Expr * Ref, SourceRange Range = {}); |
8728 | |
8729 | // Constructors |
8730 | OMPReferencedVarAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
8731 | , Expr * Ref |
8732 | ); |
8733 | |
8734 | OMPReferencedVarAttr *clone(ASTContext &C) const; |
8735 | void printPretty(raw_ostream &OS, |
8736 | const PrintingPolicy &Policy) const; |
8737 | const char *getSpelling() const; |
8738 | Expr * getRef() const { |
8739 | return ref; |
8740 | } |
8741 | |
8742 | |
8743 | |
8744 | static bool classof(const Attr *A) { return A->getKind() == attr::OMPReferencedVar; } |
8745 | }; |
8746 | |
8747 | class OMPThreadPrivateDeclAttr : public InheritableAttr { |
8748 | public: |
8749 | // Factory methods |
8750 | static OMPThreadPrivateDeclAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
8751 | static OMPThreadPrivateDeclAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
8752 | static OMPThreadPrivateDeclAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
8753 | static OMPThreadPrivateDeclAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
8754 | |
8755 | // Constructors |
8756 | OMPThreadPrivateDeclAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
8757 | ); |
8758 | |
8759 | OMPThreadPrivateDeclAttr *clone(ASTContext &C) const; |
8760 | void printPretty(raw_ostream &OS, |
8761 | const PrintingPolicy &Policy) const; |
8762 | const char *getSpelling() const; |
8763 | |
8764 | |
8765 | static bool classof(const Attr *A) { return A->getKind() == attr::OMPThreadPrivateDecl; } |
8766 | }; |
8767 | |
8768 | class OSConsumedAttr : public InheritableParamAttr { |
8769 | public: |
8770 | enum Spelling { |
8771 | GNU_os_consumed = 0, |
8772 | CXX11_clang_os_consumed = 1, |
8773 | C23_clang_os_consumed = 2, |
8774 | SpellingNotCalculated = 15 |
8775 | |
8776 | }; |
8777 | |
8778 | // Factory methods |
8779 | static OSConsumedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
8780 | static OSConsumedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
8781 | static OSConsumedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_os_consumed); |
8782 | static OSConsumedAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_os_consumed); |
8783 | |
8784 | // Constructors |
8785 | OSConsumedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
8786 | ); |
8787 | |
8788 | OSConsumedAttr *clone(ASTContext &C) const; |
8789 | void printPretty(raw_ostream &OS, |
8790 | const PrintingPolicy &Policy) const; |
8791 | const char *getSpelling() const; |
8792 | |
8793 | |
8794 | static bool classof(const Attr *A) { return A->getKind() == attr::OSConsumed; } |
8795 | }; |
8796 | |
8797 | class OSConsumesThisAttr : public InheritableAttr { |
8798 | public: |
8799 | enum Spelling { |
8800 | GNU_os_consumes_this = 0, |
8801 | CXX11_clang_os_consumes_this = 1, |
8802 | C23_clang_os_consumes_this = 2, |
8803 | SpellingNotCalculated = 15 |
8804 | |
8805 | }; |
8806 | |
8807 | // Factory methods |
8808 | static OSConsumesThisAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
8809 | static OSConsumesThisAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
8810 | static OSConsumesThisAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_os_consumes_this); |
8811 | static OSConsumesThisAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_os_consumes_this); |
8812 | |
8813 | // Constructors |
8814 | OSConsumesThisAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
8815 | ); |
8816 | |
8817 | OSConsumesThisAttr *clone(ASTContext &C) const; |
8818 | void printPretty(raw_ostream &OS, |
8819 | const PrintingPolicy &Policy) const; |
8820 | const char *getSpelling() const; |
8821 | |
8822 | |
8823 | static bool classof(const Attr *A) { return A->getKind() == attr::OSConsumesThis; } |
8824 | }; |
8825 | |
8826 | class OSReturnsNotRetainedAttr : public InheritableAttr { |
8827 | public: |
8828 | enum Spelling { |
8829 | GNU_os_returns_not_retained = 0, |
8830 | CXX11_clang_os_returns_not_retained = 1, |
8831 | C23_clang_os_returns_not_retained = 2, |
8832 | SpellingNotCalculated = 15 |
8833 | |
8834 | }; |
8835 | |
8836 | // Factory methods |
8837 | static OSReturnsNotRetainedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
8838 | static OSReturnsNotRetainedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
8839 | static OSReturnsNotRetainedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_os_returns_not_retained); |
8840 | static OSReturnsNotRetainedAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_os_returns_not_retained); |
8841 | |
8842 | // Constructors |
8843 | OSReturnsNotRetainedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
8844 | ); |
8845 | |
8846 | OSReturnsNotRetainedAttr *clone(ASTContext &C) const; |
8847 | void printPretty(raw_ostream &OS, |
8848 | const PrintingPolicy &Policy) const; |
8849 | const char *getSpelling() const; |
8850 | |
8851 | |
8852 | static bool classof(const Attr *A) { return A->getKind() == attr::OSReturnsNotRetained; } |
8853 | }; |
8854 | |
8855 | class OSReturnsRetainedAttr : public InheritableAttr { |
8856 | public: |
8857 | enum Spelling { |
8858 | GNU_os_returns_retained = 0, |
8859 | CXX11_clang_os_returns_retained = 1, |
8860 | C23_clang_os_returns_retained = 2, |
8861 | SpellingNotCalculated = 15 |
8862 | |
8863 | }; |
8864 | |
8865 | // Factory methods |
8866 | static OSReturnsRetainedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
8867 | static OSReturnsRetainedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
8868 | static OSReturnsRetainedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_os_returns_retained); |
8869 | static OSReturnsRetainedAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_os_returns_retained); |
8870 | |
8871 | // Constructors |
8872 | OSReturnsRetainedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
8873 | ); |
8874 | |
8875 | OSReturnsRetainedAttr *clone(ASTContext &C) const; |
8876 | void printPretty(raw_ostream &OS, |
8877 | const PrintingPolicy &Policy) const; |
8878 | const char *getSpelling() const; |
8879 | |
8880 | |
8881 | static bool classof(const Attr *A) { return A->getKind() == attr::OSReturnsRetained; } |
8882 | }; |
8883 | |
8884 | class OSReturnsRetainedOnNonZeroAttr : public InheritableAttr { |
8885 | public: |
8886 | enum Spelling { |
8887 | GNU_os_returns_retained_on_non_zero = 0, |
8888 | CXX11_clang_os_returns_retained_on_non_zero = 1, |
8889 | C23_clang_os_returns_retained_on_non_zero = 2, |
8890 | SpellingNotCalculated = 15 |
8891 | |
8892 | }; |
8893 | |
8894 | // Factory methods |
8895 | static OSReturnsRetainedOnNonZeroAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
8896 | static OSReturnsRetainedOnNonZeroAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
8897 | static OSReturnsRetainedOnNonZeroAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_os_returns_retained_on_non_zero); |
8898 | static OSReturnsRetainedOnNonZeroAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_os_returns_retained_on_non_zero); |
8899 | |
8900 | // Constructors |
8901 | OSReturnsRetainedOnNonZeroAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
8902 | ); |
8903 | |
8904 | OSReturnsRetainedOnNonZeroAttr *clone(ASTContext &C) const; |
8905 | void printPretty(raw_ostream &OS, |
8906 | const PrintingPolicy &Policy) const; |
8907 | const char *getSpelling() const; |
8908 | |
8909 | |
8910 | static bool classof(const Attr *A) { return A->getKind() == attr::OSReturnsRetainedOnNonZero; } |
8911 | }; |
8912 | |
8913 | class OSReturnsRetainedOnZeroAttr : public InheritableAttr { |
8914 | public: |
8915 | enum Spelling { |
8916 | GNU_os_returns_retained_on_zero = 0, |
8917 | CXX11_clang_os_returns_retained_on_zero = 1, |
8918 | C23_clang_os_returns_retained_on_zero = 2, |
8919 | SpellingNotCalculated = 15 |
8920 | |
8921 | }; |
8922 | |
8923 | // Factory methods |
8924 | static OSReturnsRetainedOnZeroAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
8925 | static OSReturnsRetainedOnZeroAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
8926 | static OSReturnsRetainedOnZeroAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_os_returns_retained_on_zero); |
8927 | static OSReturnsRetainedOnZeroAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_os_returns_retained_on_zero); |
8928 | |
8929 | // Constructors |
8930 | OSReturnsRetainedOnZeroAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
8931 | ); |
8932 | |
8933 | OSReturnsRetainedOnZeroAttr *clone(ASTContext &C) const; |
8934 | void printPretty(raw_ostream &OS, |
8935 | const PrintingPolicy &Policy) const; |
8936 | const char *getSpelling() const; |
8937 | |
8938 | |
8939 | static bool classof(const Attr *A) { return A->getKind() == attr::OSReturnsRetainedOnZero; } |
8940 | }; |
8941 | |
8942 | class ObjCBoxableAttr : public Attr { |
8943 | public: |
8944 | enum Spelling { |
8945 | GNU_objc_boxable = 0, |
8946 | CXX11_clang_objc_boxable = 1, |
8947 | C23_clang_objc_boxable = 2, |
8948 | SpellingNotCalculated = 15 |
8949 | |
8950 | }; |
8951 | |
8952 | // Factory methods |
8953 | static ObjCBoxableAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
8954 | static ObjCBoxableAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
8955 | static ObjCBoxableAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_objc_boxable); |
8956 | static ObjCBoxableAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_objc_boxable); |
8957 | |
8958 | // Constructors |
8959 | ObjCBoxableAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
8960 | ); |
8961 | |
8962 | ObjCBoxableAttr *clone(ASTContext &C) const; |
8963 | void printPretty(raw_ostream &OS, |
8964 | const PrintingPolicy &Policy) const; |
8965 | const char *getSpelling() const; |
8966 | |
8967 | |
8968 | static bool classof(const Attr *A) { return A->getKind() == attr::ObjCBoxable; } |
8969 | }; |
8970 | |
8971 | class ObjCBridgeAttr : public InheritableAttr { |
8972 | IdentifierInfo * bridgedType; |
8973 | |
8974 | public: |
8975 | enum Spelling { |
8976 | GNU_objc_bridge = 0, |
8977 | CXX11_clang_objc_bridge = 1, |
8978 | C23_clang_objc_bridge = 2, |
8979 | SpellingNotCalculated = 15 |
8980 | |
8981 | }; |
8982 | |
8983 | // Factory methods |
8984 | static ObjCBridgeAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * BridgedType, const AttributeCommonInfo &CommonInfo); |
8985 | static ObjCBridgeAttr *Create(ASTContext &Ctx, IdentifierInfo * BridgedType, const AttributeCommonInfo &CommonInfo); |
8986 | static ObjCBridgeAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * BridgedType, SourceRange Range = {}, Spelling S = GNU_objc_bridge); |
8987 | static ObjCBridgeAttr *Create(ASTContext &Ctx, IdentifierInfo * BridgedType, SourceRange Range = {}, Spelling S = GNU_objc_bridge); |
8988 | |
8989 | // Constructors |
8990 | ObjCBridgeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
8991 | , IdentifierInfo * BridgedType |
8992 | ); |
8993 | |
8994 | ObjCBridgeAttr *clone(ASTContext &C) const; |
8995 | void printPretty(raw_ostream &OS, |
8996 | const PrintingPolicy &Policy) const; |
8997 | const char *getSpelling() const; |
8998 | IdentifierInfo * getBridgedType() const { |
8999 | return bridgedType; |
9000 | } |
9001 | |
9002 | |
9003 | |
9004 | static bool classof(const Attr *A) { return A->getKind() == attr::ObjCBridge; } |
9005 | }; |
9006 | |
9007 | class ObjCBridgeMutableAttr : public InheritableAttr { |
9008 | IdentifierInfo * bridgedType; |
9009 | |
9010 | public: |
9011 | enum Spelling { |
9012 | GNU_objc_bridge_mutable = 0, |
9013 | CXX11_clang_objc_bridge_mutable = 1, |
9014 | C23_clang_objc_bridge_mutable = 2, |
9015 | SpellingNotCalculated = 15 |
9016 | |
9017 | }; |
9018 | |
9019 | // Factory methods |
9020 | static ObjCBridgeMutableAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * BridgedType, const AttributeCommonInfo &CommonInfo); |
9021 | static ObjCBridgeMutableAttr *Create(ASTContext &Ctx, IdentifierInfo * BridgedType, const AttributeCommonInfo &CommonInfo); |
9022 | static ObjCBridgeMutableAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * BridgedType, SourceRange Range = {}, Spelling S = GNU_objc_bridge_mutable); |
9023 | static ObjCBridgeMutableAttr *Create(ASTContext &Ctx, IdentifierInfo * BridgedType, SourceRange Range = {}, Spelling S = GNU_objc_bridge_mutable); |
9024 | |
9025 | // Constructors |
9026 | ObjCBridgeMutableAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
9027 | , IdentifierInfo * BridgedType |
9028 | ); |
9029 | |
9030 | ObjCBridgeMutableAttr *clone(ASTContext &C) const; |
9031 | void printPretty(raw_ostream &OS, |
9032 | const PrintingPolicy &Policy) const; |
9033 | const char *getSpelling() const; |
9034 | IdentifierInfo * getBridgedType() const { |
9035 | return bridgedType; |
9036 | } |
9037 | |
9038 | |
9039 | |
9040 | static bool classof(const Attr *A) { return A->getKind() == attr::ObjCBridgeMutable; } |
9041 | }; |
9042 | |
9043 | class ObjCBridgeRelatedAttr : public InheritableAttr { |
9044 | IdentifierInfo * relatedClass; |
9045 | |
9046 | IdentifierInfo * classMethod; |
9047 | |
9048 | IdentifierInfo * instanceMethod; |
9049 | |
9050 | public: |
9051 | enum Spelling { |
9052 | GNU_objc_bridge_related = 0, |
9053 | CXX11_clang_objc_bridge_related = 1, |
9054 | C23_clang_objc_bridge_related = 2, |
9055 | SpellingNotCalculated = 15 |
9056 | |
9057 | }; |
9058 | |
9059 | // Factory methods |
9060 | static ObjCBridgeRelatedAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * RelatedClass, IdentifierInfo * ClassMethod, IdentifierInfo * InstanceMethod, const AttributeCommonInfo &CommonInfo); |
9061 | static ObjCBridgeRelatedAttr *Create(ASTContext &Ctx, IdentifierInfo * RelatedClass, IdentifierInfo * ClassMethod, IdentifierInfo * InstanceMethod, const AttributeCommonInfo &CommonInfo); |
9062 | static ObjCBridgeRelatedAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * RelatedClass, IdentifierInfo * ClassMethod, IdentifierInfo * InstanceMethod, SourceRange Range = {}, Spelling S = GNU_objc_bridge_related); |
9063 | static ObjCBridgeRelatedAttr *Create(ASTContext &Ctx, IdentifierInfo * RelatedClass, IdentifierInfo * ClassMethod, IdentifierInfo * InstanceMethod, SourceRange Range = {}, Spelling S = GNU_objc_bridge_related); |
9064 | |
9065 | // Constructors |
9066 | ObjCBridgeRelatedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
9067 | , IdentifierInfo * RelatedClass |
9068 | , IdentifierInfo * ClassMethod |
9069 | , IdentifierInfo * InstanceMethod |
9070 | ); |
9071 | |
9072 | ObjCBridgeRelatedAttr *clone(ASTContext &C) const; |
9073 | void printPretty(raw_ostream &OS, |
9074 | const PrintingPolicy &Policy) const; |
9075 | const char *getSpelling() const; |
9076 | IdentifierInfo * getRelatedClass() const { |
9077 | return relatedClass; |
9078 | } |
9079 | |
9080 | IdentifierInfo * getClassMethod() const { |
9081 | return classMethod; |
9082 | } |
9083 | |
9084 | IdentifierInfo * getInstanceMethod() const { |
9085 | return instanceMethod; |
9086 | } |
9087 | |
9088 | |
9089 | |
9090 | static bool classof(const Attr *A) { return A->getKind() == attr::ObjCBridgeRelated; } |
9091 | }; |
9092 | |
9093 | class ObjCClassStubAttr : public Attr { |
9094 | public: |
9095 | enum Spelling { |
9096 | GNU_objc_class_stub = 0, |
9097 | CXX11_clang_objc_class_stub = 1, |
9098 | C23_clang_objc_class_stub = 2, |
9099 | SpellingNotCalculated = 15 |
9100 | |
9101 | }; |
9102 | |
9103 | // Factory methods |
9104 | static ObjCClassStubAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9105 | static ObjCClassStubAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9106 | static ObjCClassStubAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_objc_class_stub); |
9107 | static ObjCClassStubAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_objc_class_stub); |
9108 | |
9109 | // Constructors |
9110 | ObjCClassStubAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
9111 | ); |
9112 | |
9113 | ObjCClassStubAttr *clone(ASTContext &C) const; |
9114 | void printPretty(raw_ostream &OS, |
9115 | const PrintingPolicy &Policy) const; |
9116 | const char *getSpelling() const; |
9117 | |
9118 | |
9119 | static bool classof(const Attr *A) { return A->getKind() == attr::ObjCClassStub; } |
9120 | }; |
9121 | |
9122 | class ObjCDesignatedInitializerAttr : public Attr { |
9123 | public: |
9124 | enum Spelling { |
9125 | GNU_objc_designated_initializer = 0, |
9126 | CXX11_clang_objc_designated_initializer = 1, |
9127 | C23_clang_objc_designated_initializer = 2, |
9128 | SpellingNotCalculated = 15 |
9129 | |
9130 | }; |
9131 | |
9132 | // Factory methods |
9133 | static ObjCDesignatedInitializerAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9134 | static ObjCDesignatedInitializerAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9135 | static ObjCDesignatedInitializerAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_objc_designated_initializer); |
9136 | static ObjCDesignatedInitializerAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_objc_designated_initializer); |
9137 | |
9138 | // Constructors |
9139 | ObjCDesignatedInitializerAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
9140 | ); |
9141 | |
9142 | ObjCDesignatedInitializerAttr *clone(ASTContext &C) const; |
9143 | void printPretty(raw_ostream &OS, |
9144 | const PrintingPolicy &Policy) const; |
9145 | const char *getSpelling() const; |
9146 | |
9147 | |
9148 | static bool classof(const Attr *A) { return A->getKind() == attr::ObjCDesignatedInitializer; } |
9149 | }; |
9150 | |
9151 | class ObjCDirectAttr : public Attr { |
9152 | public: |
9153 | enum Spelling { |
9154 | GNU_objc_direct = 0, |
9155 | CXX11_clang_objc_direct = 1, |
9156 | C23_clang_objc_direct = 2, |
9157 | SpellingNotCalculated = 15 |
9158 | |
9159 | }; |
9160 | |
9161 | // Factory methods |
9162 | static ObjCDirectAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9163 | static ObjCDirectAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9164 | static ObjCDirectAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_objc_direct); |
9165 | static ObjCDirectAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_objc_direct); |
9166 | |
9167 | // Constructors |
9168 | ObjCDirectAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
9169 | ); |
9170 | |
9171 | ObjCDirectAttr *clone(ASTContext &C) const; |
9172 | void printPretty(raw_ostream &OS, |
9173 | const PrintingPolicy &Policy) const; |
9174 | const char *getSpelling() const; |
9175 | |
9176 | |
9177 | static bool classof(const Attr *A) { return A->getKind() == attr::ObjCDirect; } |
9178 | }; |
9179 | |
9180 | class ObjCDirectMembersAttr : public Attr { |
9181 | public: |
9182 | enum Spelling { |
9183 | GNU_objc_direct_members = 0, |
9184 | CXX11_clang_objc_direct_members = 1, |
9185 | C23_clang_objc_direct_members = 2, |
9186 | SpellingNotCalculated = 15 |
9187 | |
9188 | }; |
9189 | |
9190 | // Factory methods |
9191 | static ObjCDirectMembersAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9192 | static ObjCDirectMembersAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9193 | static ObjCDirectMembersAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_objc_direct_members); |
9194 | static ObjCDirectMembersAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_objc_direct_members); |
9195 | |
9196 | // Constructors |
9197 | ObjCDirectMembersAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
9198 | ); |
9199 | |
9200 | ObjCDirectMembersAttr *clone(ASTContext &C) const; |
9201 | void printPretty(raw_ostream &OS, |
9202 | const PrintingPolicy &Policy) const; |
9203 | const char *getSpelling() const; |
9204 | |
9205 | |
9206 | static bool classof(const Attr *A) { return A->getKind() == attr::ObjCDirectMembers; } |
9207 | }; |
9208 | |
9209 | class ObjCExceptionAttr : public InheritableAttr { |
9210 | public: |
9211 | enum Spelling { |
9212 | GNU_objc_exception = 0, |
9213 | CXX11_clang_objc_exception = 1, |
9214 | C23_clang_objc_exception = 2, |
9215 | SpellingNotCalculated = 15 |
9216 | |
9217 | }; |
9218 | |
9219 | // Factory methods |
9220 | static ObjCExceptionAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9221 | static ObjCExceptionAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9222 | static ObjCExceptionAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_objc_exception); |
9223 | static ObjCExceptionAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_objc_exception); |
9224 | |
9225 | // Constructors |
9226 | ObjCExceptionAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
9227 | ); |
9228 | |
9229 | ObjCExceptionAttr *clone(ASTContext &C) const; |
9230 | void printPretty(raw_ostream &OS, |
9231 | const PrintingPolicy &Policy) const; |
9232 | const char *getSpelling() const; |
9233 | |
9234 | |
9235 | static bool classof(const Attr *A) { return A->getKind() == attr::ObjCException; } |
9236 | }; |
9237 | |
9238 | class ObjCExplicitProtocolImplAttr : public InheritableAttr { |
9239 | public: |
9240 | enum Spelling { |
9241 | GNU_objc_protocol_requires_explicit_implementation = 0, |
9242 | CXX11_clang_objc_protocol_requires_explicit_implementation = 1, |
9243 | C23_clang_objc_protocol_requires_explicit_implementation = 2, |
9244 | SpellingNotCalculated = 15 |
9245 | |
9246 | }; |
9247 | |
9248 | // Factory methods |
9249 | static ObjCExplicitProtocolImplAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9250 | static ObjCExplicitProtocolImplAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9251 | static ObjCExplicitProtocolImplAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_objc_protocol_requires_explicit_implementation); |
9252 | static ObjCExplicitProtocolImplAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_objc_protocol_requires_explicit_implementation); |
9253 | |
9254 | // Constructors |
9255 | ObjCExplicitProtocolImplAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
9256 | ); |
9257 | |
9258 | ObjCExplicitProtocolImplAttr *clone(ASTContext &C) const; |
9259 | void printPretty(raw_ostream &OS, |
9260 | const PrintingPolicy &Policy) const; |
9261 | const char *getSpelling() const; |
9262 | |
9263 | |
9264 | static bool classof(const Attr *A) { return A->getKind() == attr::ObjCExplicitProtocolImpl; } |
9265 | }; |
9266 | |
9267 | class ObjCExternallyRetainedAttr : public InheritableAttr { |
9268 | public: |
9269 | enum Spelling { |
9270 | GNU_objc_externally_retained = 0, |
9271 | CXX11_clang_objc_externally_retained = 1, |
9272 | C23_clang_objc_externally_retained = 2, |
9273 | SpellingNotCalculated = 15 |
9274 | |
9275 | }; |
9276 | |
9277 | // Factory methods |
9278 | static ObjCExternallyRetainedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9279 | static ObjCExternallyRetainedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9280 | static ObjCExternallyRetainedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_objc_externally_retained); |
9281 | static ObjCExternallyRetainedAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_objc_externally_retained); |
9282 | |
9283 | // Constructors |
9284 | ObjCExternallyRetainedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
9285 | ); |
9286 | |
9287 | ObjCExternallyRetainedAttr *clone(ASTContext &C) const; |
9288 | void printPretty(raw_ostream &OS, |
9289 | const PrintingPolicy &Policy) const; |
9290 | const char *getSpelling() const; |
9291 | |
9292 | |
9293 | static bool classof(const Attr *A) { return A->getKind() == attr::ObjCExternallyRetained; } |
9294 | }; |
9295 | |
9296 | class ObjCGCAttr : public TypeAttr { |
9297 | IdentifierInfo * kind; |
9298 | |
9299 | public: |
9300 | enum Spelling { |
9301 | GNU_objc_gc = 0, |
9302 | CXX11_clang_objc_gc = 1, |
9303 | C23_clang_objc_gc = 2, |
9304 | SpellingNotCalculated = 15 |
9305 | |
9306 | }; |
9307 | |
9308 | // Factory methods |
9309 | static ObjCGCAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * Kind, const AttributeCommonInfo &CommonInfo); |
9310 | static ObjCGCAttr *Create(ASTContext &Ctx, IdentifierInfo * Kind, const AttributeCommonInfo &CommonInfo); |
9311 | static ObjCGCAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * Kind, SourceRange Range = {}, Spelling S = GNU_objc_gc); |
9312 | static ObjCGCAttr *Create(ASTContext &Ctx, IdentifierInfo * Kind, SourceRange Range = {}, Spelling S = GNU_objc_gc); |
9313 | |
9314 | // Constructors |
9315 | ObjCGCAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
9316 | , IdentifierInfo * Kind |
9317 | ); |
9318 | |
9319 | ObjCGCAttr *clone(ASTContext &C) const; |
9320 | void printPretty(raw_ostream &OS, |
9321 | const PrintingPolicy &Policy) const; |
9322 | const char *getSpelling() const; |
9323 | IdentifierInfo * getKind() const { |
9324 | return kind; |
9325 | } |
9326 | |
9327 | |
9328 | |
9329 | static bool classof(const Attr *A) { return A->getKind() == attr::ObjCGC; } |
9330 | }; |
9331 | |
9332 | class ObjCIndependentClassAttr : public InheritableAttr { |
9333 | public: |
9334 | enum Spelling { |
9335 | GNU_objc_independent_class = 0, |
9336 | CXX11_clang_objc_independent_class = 1, |
9337 | C23_clang_objc_independent_class = 2, |
9338 | SpellingNotCalculated = 15 |
9339 | |
9340 | }; |
9341 | |
9342 | // Factory methods |
9343 | static ObjCIndependentClassAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9344 | static ObjCIndependentClassAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9345 | static ObjCIndependentClassAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_objc_independent_class); |
9346 | static ObjCIndependentClassAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_objc_independent_class); |
9347 | |
9348 | // Constructors |
9349 | ObjCIndependentClassAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
9350 | ); |
9351 | |
9352 | ObjCIndependentClassAttr *clone(ASTContext &C) const; |
9353 | void printPretty(raw_ostream &OS, |
9354 | const PrintingPolicy &Policy) const; |
9355 | const char *getSpelling() const; |
9356 | |
9357 | |
9358 | static bool classof(const Attr *A) { return A->getKind() == attr::ObjCIndependentClass; } |
9359 | }; |
9360 | |
9361 | class ObjCInertUnsafeUnretainedAttr : public TypeAttr { |
9362 | public: |
9363 | // Factory methods |
9364 | static ObjCInertUnsafeUnretainedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9365 | static ObjCInertUnsafeUnretainedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9366 | static ObjCInertUnsafeUnretainedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
9367 | static ObjCInertUnsafeUnretainedAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
9368 | |
9369 | // Constructors |
9370 | ObjCInertUnsafeUnretainedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
9371 | ); |
9372 | |
9373 | ObjCInertUnsafeUnretainedAttr *clone(ASTContext &C) const; |
9374 | void printPretty(raw_ostream &OS, |
9375 | const PrintingPolicy &Policy) const; |
9376 | const char *getSpelling() const; |
9377 | |
9378 | |
9379 | static bool classof(const Attr *A) { return A->getKind() == attr::ObjCInertUnsafeUnretained; } |
9380 | }; |
9381 | |
9382 | class ObjCKindOfAttr : public TypeAttr { |
9383 | public: |
9384 | // Factory methods |
9385 | static ObjCKindOfAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9386 | static ObjCKindOfAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9387 | static ObjCKindOfAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
9388 | static ObjCKindOfAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
9389 | |
9390 | // Constructors |
9391 | ObjCKindOfAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
9392 | ); |
9393 | |
9394 | ObjCKindOfAttr *clone(ASTContext &C) const; |
9395 | void printPretty(raw_ostream &OS, |
9396 | const PrintingPolicy &Policy) const; |
9397 | const char *getSpelling() const; |
9398 | |
9399 | |
9400 | static bool classof(const Attr *A) { return A->getKind() == attr::ObjCKindOf; } |
9401 | }; |
9402 | |
9403 | class ObjCMethodFamilyAttr : public InheritableAttr { |
9404 | public: |
9405 | enum FamilyKind { |
9406 | OMF_None, |
9407 | OMF_alloc, |
9408 | OMF_copy, |
9409 | OMF_init, |
9410 | OMF_mutableCopy, |
9411 | OMF_new |
9412 | }; |
9413 | private: |
9414 | ObjCMethodFamilyAttr::FamilyKind family; |
9415 | |
9416 | public: |
9417 | enum Spelling { |
9418 | GNU_objc_method_family = 0, |
9419 | CXX11_clang_objc_method_family = 1, |
9420 | C23_clang_objc_method_family = 2, |
9421 | SpellingNotCalculated = 15 |
9422 | |
9423 | }; |
9424 | |
9425 | // Factory methods |
9426 | static ObjCMethodFamilyAttr *CreateImplicit(ASTContext &Ctx, ObjCMethodFamilyAttr::FamilyKind Family, const AttributeCommonInfo &CommonInfo); |
9427 | static ObjCMethodFamilyAttr *Create(ASTContext &Ctx, ObjCMethodFamilyAttr::FamilyKind Family, const AttributeCommonInfo &CommonInfo); |
9428 | static ObjCMethodFamilyAttr *CreateImplicit(ASTContext &Ctx, ObjCMethodFamilyAttr::FamilyKind Family, SourceRange Range = {}, Spelling S = GNU_objc_method_family); |
9429 | static ObjCMethodFamilyAttr *Create(ASTContext &Ctx, ObjCMethodFamilyAttr::FamilyKind Family, SourceRange Range = {}, Spelling S = GNU_objc_method_family); |
9430 | |
9431 | // Constructors |
9432 | ObjCMethodFamilyAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
9433 | , ObjCMethodFamilyAttr::FamilyKind Family |
9434 | ); |
9435 | |
9436 | ObjCMethodFamilyAttr *clone(ASTContext &C) const; |
9437 | void printPretty(raw_ostream &OS, |
9438 | const PrintingPolicy &Policy) const; |
9439 | const char *getSpelling() const; |
9440 | ObjCMethodFamilyAttr::FamilyKind getFamily() const { |
9441 | return family; |
9442 | } |
9443 | |
9444 | static bool ConvertStrToFamilyKind(StringRef Val, ObjCMethodFamilyAttr::FamilyKind &Out); |
9445 | static const char *ConvertFamilyKindToStr(ObjCMethodFamilyAttr::FamilyKind Val); |
9446 | |
9447 | |
9448 | static bool classof(const Attr *A) { return A->getKind() == attr::ObjCMethodFamily; } |
9449 | }; |
9450 | |
9451 | class ObjCNSObjectAttr : public InheritableAttr { |
9452 | public: |
9453 | enum Spelling { |
9454 | GNU_NSObject = 0, |
9455 | CXX11_clang_NSObject = 1, |
9456 | C23_clang_NSObject = 2, |
9457 | SpellingNotCalculated = 15 |
9458 | |
9459 | }; |
9460 | |
9461 | // Factory methods |
9462 | static ObjCNSObjectAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9463 | static ObjCNSObjectAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9464 | static ObjCNSObjectAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_NSObject); |
9465 | static ObjCNSObjectAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_NSObject); |
9466 | |
9467 | // Constructors |
9468 | ObjCNSObjectAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
9469 | ); |
9470 | |
9471 | ObjCNSObjectAttr *clone(ASTContext &C) const; |
9472 | void printPretty(raw_ostream &OS, |
9473 | const PrintingPolicy &Policy) const; |
9474 | const char *getSpelling() const; |
9475 | |
9476 | |
9477 | static bool classof(const Attr *A) { return A->getKind() == attr::ObjCNSObject; } |
9478 | }; |
9479 | |
9480 | class ObjCNonLazyClassAttr : public Attr { |
9481 | public: |
9482 | enum Spelling { |
9483 | GNU_objc_nonlazy_class = 0, |
9484 | CXX11_clang_objc_nonlazy_class = 1, |
9485 | C23_clang_objc_nonlazy_class = 2, |
9486 | SpellingNotCalculated = 15 |
9487 | |
9488 | }; |
9489 | |
9490 | // Factory methods |
9491 | static ObjCNonLazyClassAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9492 | static ObjCNonLazyClassAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9493 | static ObjCNonLazyClassAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_objc_nonlazy_class); |
9494 | static ObjCNonLazyClassAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_objc_nonlazy_class); |
9495 | |
9496 | // Constructors |
9497 | ObjCNonLazyClassAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
9498 | ); |
9499 | |
9500 | ObjCNonLazyClassAttr *clone(ASTContext &C) const; |
9501 | void printPretty(raw_ostream &OS, |
9502 | const PrintingPolicy &Policy) const; |
9503 | const char *getSpelling() const; |
9504 | |
9505 | |
9506 | static bool classof(const Attr *A) { return A->getKind() == attr::ObjCNonLazyClass; } |
9507 | }; |
9508 | |
9509 | class ObjCNonRuntimeProtocolAttr : public Attr { |
9510 | public: |
9511 | enum Spelling { |
9512 | GNU_objc_non_runtime_protocol = 0, |
9513 | CXX11_clang_objc_non_runtime_protocol = 1, |
9514 | C23_clang_objc_non_runtime_protocol = 2, |
9515 | SpellingNotCalculated = 15 |
9516 | |
9517 | }; |
9518 | |
9519 | // Factory methods |
9520 | static ObjCNonRuntimeProtocolAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9521 | static ObjCNonRuntimeProtocolAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9522 | static ObjCNonRuntimeProtocolAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_objc_non_runtime_protocol); |
9523 | static ObjCNonRuntimeProtocolAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_objc_non_runtime_protocol); |
9524 | |
9525 | // Constructors |
9526 | ObjCNonRuntimeProtocolAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
9527 | ); |
9528 | |
9529 | ObjCNonRuntimeProtocolAttr *clone(ASTContext &C) const; |
9530 | void printPretty(raw_ostream &OS, |
9531 | const PrintingPolicy &Policy) const; |
9532 | const char *getSpelling() const; |
9533 | |
9534 | |
9535 | static bool classof(const Attr *A) { return A->getKind() == attr::ObjCNonRuntimeProtocol; } |
9536 | }; |
9537 | |
9538 | class ObjCOwnershipAttr : public InheritableAttr { |
9539 | IdentifierInfo * kind; |
9540 | |
9541 | public: |
9542 | enum Spelling { |
9543 | GNU_objc_ownership = 0, |
9544 | CXX11_clang_objc_ownership = 1, |
9545 | C23_clang_objc_ownership = 2, |
9546 | SpellingNotCalculated = 15 |
9547 | |
9548 | }; |
9549 | |
9550 | // Factory methods |
9551 | static ObjCOwnershipAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * Kind, const AttributeCommonInfo &CommonInfo); |
9552 | static ObjCOwnershipAttr *Create(ASTContext &Ctx, IdentifierInfo * Kind, const AttributeCommonInfo &CommonInfo); |
9553 | static ObjCOwnershipAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * Kind, SourceRange Range = {}, Spelling S = GNU_objc_ownership); |
9554 | static ObjCOwnershipAttr *Create(ASTContext &Ctx, IdentifierInfo * Kind, SourceRange Range = {}, Spelling S = GNU_objc_ownership); |
9555 | |
9556 | // Constructors |
9557 | ObjCOwnershipAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
9558 | , IdentifierInfo * Kind |
9559 | ); |
9560 | |
9561 | ObjCOwnershipAttr *clone(ASTContext &C) const; |
9562 | void printPretty(raw_ostream &OS, |
9563 | const PrintingPolicy &Policy) const; |
9564 | const char *getSpelling() const; |
9565 | IdentifierInfo * getKind() const { |
9566 | return kind; |
9567 | } |
9568 | |
9569 | |
9570 | |
9571 | static bool classof(const Attr *A) { return A->getKind() == attr::ObjCOwnership; } |
9572 | }; |
9573 | |
9574 | class ObjCPreciseLifetimeAttr : public InheritableAttr { |
9575 | public: |
9576 | enum Spelling { |
9577 | GNU_objc_precise_lifetime = 0, |
9578 | CXX11_clang_objc_precise_lifetime = 1, |
9579 | C23_clang_objc_precise_lifetime = 2, |
9580 | SpellingNotCalculated = 15 |
9581 | |
9582 | }; |
9583 | |
9584 | // Factory methods |
9585 | static ObjCPreciseLifetimeAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9586 | static ObjCPreciseLifetimeAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9587 | static ObjCPreciseLifetimeAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_objc_precise_lifetime); |
9588 | static ObjCPreciseLifetimeAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_objc_precise_lifetime); |
9589 | |
9590 | // Constructors |
9591 | ObjCPreciseLifetimeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
9592 | ); |
9593 | |
9594 | ObjCPreciseLifetimeAttr *clone(ASTContext &C) const; |
9595 | void printPretty(raw_ostream &OS, |
9596 | const PrintingPolicy &Policy) const; |
9597 | const char *getSpelling() const; |
9598 | |
9599 | |
9600 | static bool classof(const Attr *A) { return A->getKind() == attr::ObjCPreciseLifetime; } |
9601 | }; |
9602 | |
9603 | class ObjCRequiresPropertyDefsAttr : public InheritableAttr { |
9604 | public: |
9605 | enum Spelling { |
9606 | GNU_objc_requires_property_definitions = 0, |
9607 | CXX11_clang_objc_requires_property_definitions = 1, |
9608 | C23_clang_objc_requires_property_definitions = 2, |
9609 | SpellingNotCalculated = 15 |
9610 | |
9611 | }; |
9612 | |
9613 | // Factory methods |
9614 | static ObjCRequiresPropertyDefsAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9615 | static ObjCRequiresPropertyDefsAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9616 | static ObjCRequiresPropertyDefsAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_objc_requires_property_definitions); |
9617 | static ObjCRequiresPropertyDefsAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_objc_requires_property_definitions); |
9618 | |
9619 | // Constructors |
9620 | ObjCRequiresPropertyDefsAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
9621 | ); |
9622 | |
9623 | ObjCRequiresPropertyDefsAttr *clone(ASTContext &C) const; |
9624 | void printPretty(raw_ostream &OS, |
9625 | const PrintingPolicy &Policy) const; |
9626 | const char *getSpelling() const; |
9627 | |
9628 | |
9629 | static bool classof(const Attr *A) { return A->getKind() == attr::ObjCRequiresPropertyDefs; } |
9630 | }; |
9631 | |
9632 | class ObjCRequiresSuperAttr : public InheritableAttr { |
9633 | public: |
9634 | enum Spelling { |
9635 | GNU_objc_requires_super = 0, |
9636 | CXX11_clang_objc_requires_super = 1, |
9637 | C23_clang_objc_requires_super = 2, |
9638 | SpellingNotCalculated = 15 |
9639 | |
9640 | }; |
9641 | |
9642 | // Factory methods |
9643 | static ObjCRequiresSuperAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9644 | static ObjCRequiresSuperAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9645 | static ObjCRequiresSuperAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_objc_requires_super); |
9646 | static ObjCRequiresSuperAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_objc_requires_super); |
9647 | |
9648 | // Constructors |
9649 | ObjCRequiresSuperAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
9650 | ); |
9651 | |
9652 | ObjCRequiresSuperAttr *clone(ASTContext &C) const; |
9653 | void printPretty(raw_ostream &OS, |
9654 | const PrintingPolicy &Policy) const; |
9655 | const char *getSpelling() const; |
9656 | |
9657 | |
9658 | static bool classof(const Attr *A) { return A->getKind() == attr::ObjCRequiresSuper; } |
9659 | }; |
9660 | |
9661 | class ObjCReturnsInnerPointerAttr : public InheritableAttr { |
9662 | public: |
9663 | enum Spelling { |
9664 | GNU_objc_returns_inner_pointer = 0, |
9665 | CXX11_clang_objc_returns_inner_pointer = 1, |
9666 | C23_clang_objc_returns_inner_pointer = 2, |
9667 | SpellingNotCalculated = 15 |
9668 | |
9669 | }; |
9670 | |
9671 | // Factory methods |
9672 | static ObjCReturnsInnerPointerAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9673 | static ObjCReturnsInnerPointerAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9674 | static ObjCReturnsInnerPointerAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_objc_returns_inner_pointer); |
9675 | static ObjCReturnsInnerPointerAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_objc_returns_inner_pointer); |
9676 | |
9677 | // Constructors |
9678 | ObjCReturnsInnerPointerAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
9679 | ); |
9680 | |
9681 | ObjCReturnsInnerPointerAttr *clone(ASTContext &C) const; |
9682 | void printPretty(raw_ostream &OS, |
9683 | const PrintingPolicy &Policy) const; |
9684 | const char *getSpelling() const; |
9685 | |
9686 | |
9687 | static bool classof(const Attr *A) { return A->getKind() == attr::ObjCReturnsInnerPointer; } |
9688 | }; |
9689 | |
9690 | class ObjCRootClassAttr : public InheritableAttr { |
9691 | public: |
9692 | enum Spelling { |
9693 | GNU_objc_root_class = 0, |
9694 | CXX11_clang_objc_root_class = 1, |
9695 | C23_clang_objc_root_class = 2, |
9696 | SpellingNotCalculated = 15 |
9697 | |
9698 | }; |
9699 | |
9700 | // Factory methods |
9701 | static ObjCRootClassAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9702 | static ObjCRootClassAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9703 | static ObjCRootClassAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_objc_root_class); |
9704 | static ObjCRootClassAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_objc_root_class); |
9705 | |
9706 | // Constructors |
9707 | ObjCRootClassAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
9708 | ); |
9709 | |
9710 | ObjCRootClassAttr *clone(ASTContext &C) const; |
9711 | void printPretty(raw_ostream &OS, |
9712 | const PrintingPolicy &Policy) const; |
9713 | const char *getSpelling() const; |
9714 | |
9715 | |
9716 | static bool classof(const Attr *A) { return A->getKind() == attr::ObjCRootClass; } |
9717 | }; |
9718 | |
9719 | class ObjCRuntimeNameAttr : public Attr { |
9720 | unsigned metadataNameLength; |
9721 | char *metadataName; |
9722 | |
9723 | public: |
9724 | enum Spelling { |
9725 | GNU_objc_runtime_name = 0, |
9726 | CXX11_clang_objc_runtime_name = 1, |
9727 | C23_clang_objc_runtime_name = 2, |
9728 | SpellingNotCalculated = 15 |
9729 | |
9730 | }; |
9731 | |
9732 | // Factory methods |
9733 | static ObjCRuntimeNameAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef MetadataName, const AttributeCommonInfo &CommonInfo); |
9734 | static ObjCRuntimeNameAttr *Create(ASTContext &Ctx, llvm::StringRef MetadataName, const AttributeCommonInfo &CommonInfo); |
9735 | static ObjCRuntimeNameAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef MetadataName, SourceRange Range = {}, Spelling S = GNU_objc_runtime_name); |
9736 | static ObjCRuntimeNameAttr *Create(ASTContext &Ctx, llvm::StringRef MetadataName, SourceRange Range = {}, Spelling S = GNU_objc_runtime_name); |
9737 | |
9738 | // Constructors |
9739 | ObjCRuntimeNameAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
9740 | , llvm::StringRef MetadataName |
9741 | ); |
9742 | |
9743 | ObjCRuntimeNameAttr *clone(ASTContext &C) const; |
9744 | void printPretty(raw_ostream &OS, |
9745 | const PrintingPolicy &Policy) const; |
9746 | const char *getSpelling() const; |
9747 | llvm::StringRef getMetadataName() const { |
9748 | return llvm::StringRef(metadataName, metadataNameLength); |
9749 | } |
9750 | unsigned getMetadataNameLength() const { |
9751 | return metadataNameLength; |
9752 | } |
9753 | void setMetadataName(ASTContext &C, llvm::StringRef S) { |
9754 | metadataNameLength = S.size(); |
9755 | this->metadataName = new (C, 1) char [metadataNameLength]; |
9756 | if (!S.empty()) |
9757 | std::memcpy(dest: this->metadataName, src: S.data(), n: metadataNameLength); |
9758 | } |
9759 | |
9760 | |
9761 | |
9762 | static bool classof(const Attr *A) { return A->getKind() == attr::ObjCRuntimeName; } |
9763 | }; |
9764 | |
9765 | class ObjCRuntimeVisibleAttr : public Attr { |
9766 | public: |
9767 | enum Spelling { |
9768 | GNU_objc_runtime_visible = 0, |
9769 | CXX11_clang_objc_runtime_visible = 1, |
9770 | C23_clang_objc_runtime_visible = 2, |
9771 | SpellingNotCalculated = 15 |
9772 | |
9773 | }; |
9774 | |
9775 | // Factory methods |
9776 | static ObjCRuntimeVisibleAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9777 | static ObjCRuntimeVisibleAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9778 | static ObjCRuntimeVisibleAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_objc_runtime_visible); |
9779 | static ObjCRuntimeVisibleAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_objc_runtime_visible); |
9780 | |
9781 | // Constructors |
9782 | ObjCRuntimeVisibleAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
9783 | ); |
9784 | |
9785 | ObjCRuntimeVisibleAttr *clone(ASTContext &C) const; |
9786 | void printPretty(raw_ostream &OS, |
9787 | const PrintingPolicy &Policy) const; |
9788 | const char *getSpelling() const; |
9789 | |
9790 | |
9791 | static bool classof(const Attr *A) { return A->getKind() == attr::ObjCRuntimeVisible; } |
9792 | }; |
9793 | |
9794 | class ObjCSubclassingRestrictedAttr : public InheritableAttr { |
9795 | public: |
9796 | enum Spelling { |
9797 | GNU_objc_subclassing_restricted = 0, |
9798 | CXX11_clang_objc_subclassing_restricted = 1, |
9799 | C23_clang_objc_subclassing_restricted = 2, |
9800 | SpellingNotCalculated = 15 |
9801 | |
9802 | }; |
9803 | |
9804 | // Factory methods |
9805 | static ObjCSubclassingRestrictedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9806 | static ObjCSubclassingRestrictedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9807 | static ObjCSubclassingRestrictedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_objc_subclassing_restricted); |
9808 | static ObjCSubclassingRestrictedAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_objc_subclassing_restricted); |
9809 | |
9810 | // Constructors |
9811 | ObjCSubclassingRestrictedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
9812 | ); |
9813 | |
9814 | ObjCSubclassingRestrictedAttr *clone(ASTContext &C) const; |
9815 | void printPretty(raw_ostream &OS, |
9816 | const PrintingPolicy &Policy) const; |
9817 | const char *getSpelling() const; |
9818 | |
9819 | |
9820 | static bool classof(const Attr *A) { return A->getKind() == attr::ObjCSubclassingRestricted; } |
9821 | }; |
9822 | |
9823 | class OpenCLAccessAttr : public Attr { |
9824 | public: |
9825 | enum Spelling { |
9826 | Keyword_read_only = 0, |
9827 | Keyword_write_only = 2, |
9828 | Keyword_read_write = 4, |
9829 | SpellingNotCalculated = 15 |
9830 | |
9831 | }; |
9832 | |
9833 | // Factory methods |
9834 | static OpenCLAccessAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9835 | static OpenCLAccessAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9836 | static OpenCLAccessAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = Keyword_read_only); |
9837 | static OpenCLAccessAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = Keyword_read_only); |
9838 | |
9839 | // Constructors |
9840 | OpenCLAccessAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
9841 | ); |
9842 | |
9843 | OpenCLAccessAttr *clone(ASTContext &C) const; |
9844 | void printPretty(raw_ostream &OS, |
9845 | const PrintingPolicy &Policy) const; |
9846 | const char *getSpelling() const; |
9847 | Spelling getSemanticSpelling() const; |
9848 | bool isReadOnly() const { return getAttributeSpellingListIndex() == 0 || |
9849 | getAttributeSpellingListIndex() == 1; } |
9850 | bool isReadWrite() const { return getAttributeSpellingListIndex() == 4 || |
9851 | getAttributeSpellingListIndex() == 5; } |
9852 | bool isWriteOnly() const { return getAttributeSpellingListIndex() == 2 || |
9853 | getAttributeSpellingListIndex() == 3; } |
9854 | |
9855 | |
9856 | static bool classof(const Attr *A) { return A->getKind() == attr::OpenCLAccess; } |
9857 | }; |
9858 | |
9859 | class OpenCLConstantAddressSpaceAttr : public TypeAttr { |
9860 | public: |
9861 | enum Spelling { |
9862 | Keyword_constant = 0, |
9863 | GNU_opencl_constant = 2, |
9864 | CXX11_clang_opencl_constant = 3, |
9865 | C23_clang_opencl_constant = 4, |
9866 | SpellingNotCalculated = 15 |
9867 | |
9868 | }; |
9869 | |
9870 | // Factory methods |
9871 | static OpenCLConstantAddressSpaceAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9872 | static OpenCLConstantAddressSpaceAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9873 | static OpenCLConstantAddressSpaceAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = Keyword_constant); |
9874 | static OpenCLConstantAddressSpaceAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = Keyword_constant); |
9875 | |
9876 | // Constructors |
9877 | OpenCLConstantAddressSpaceAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
9878 | ); |
9879 | |
9880 | OpenCLConstantAddressSpaceAttr *clone(ASTContext &C) const; |
9881 | void printPretty(raw_ostream &OS, |
9882 | const PrintingPolicy &Policy) const; |
9883 | const char *getSpelling() const; |
9884 | Spelling getSemanticSpelling() const; |
9885 | |
9886 | |
9887 | static bool classof(const Attr *A) { return A->getKind() == attr::OpenCLConstantAddressSpace; } |
9888 | }; |
9889 | |
9890 | class OpenCLGenericAddressSpaceAttr : public TypeAttr { |
9891 | public: |
9892 | enum Spelling { |
9893 | Keyword_generic = 0, |
9894 | GNU_opencl_generic = 2, |
9895 | CXX11_clang_opencl_generic = 3, |
9896 | C23_clang_opencl_generic = 4, |
9897 | SpellingNotCalculated = 15 |
9898 | |
9899 | }; |
9900 | |
9901 | // Factory methods |
9902 | static OpenCLGenericAddressSpaceAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9903 | static OpenCLGenericAddressSpaceAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9904 | static OpenCLGenericAddressSpaceAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = Keyword_generic); |
9905 | static OpenCLGenericAddressSpaceAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = Keyword_generic); |
9906 | |
9907 | // Constructors |
9908 | OpenCLGenericAddressSpaceAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
9909 | ); |
9910 | |
9911 | OpenCLGenericAddressSpaceAttr *clone(ASTContext &C) const; |
9912 | void printPretty(raw_ostream &OS, |
9913 | const PrintingPolicy &Policy) const; |
9914 | const char *getSpelling() const; |
9915 | Spelling getSemanticSpelling() const; |
9916 | |
9917 | |
9918 | static bool classof(const Attr *A) { return A->getKind() == attr::OpenCLGenericAddressSpace; } |
9919 | }; |
9920 | |
9921 | class OpenCLGlobalAddressSpaceAttr : public TypeAttr { |
9922 | public: |
9923 | enum Spelling { |
9924 | Keyword_global = 0, |
9925 | GNU_opencl_global = 2, |
9926 | CXX11_clang_opencl_global = 3, |
9927 | C23_clang_opencl_global = 4, |
9928 | SpellingNotCalculated = 15 |
9929 | |
9930 | }; |
9931 | |
9932 | // Factory methods |
9933 | static OpenCLGlobalAddressSpaceAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9934 | static OpenCLGlobalAddressSpaceAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9935 | static OpenCLGlobalAddressSpaceAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = Keyword_global); |
9936 | static OpenCLGlobalAddressSpaceAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = Keyword_global); |
9937 | |
9938 | // Constructors |
9939 | OpenCLGlobalAddressSpaceAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
9940 | ); |
9941 | |
9942 | OpenCLGlobalAddressSpaceAttr *clone(ASTContext &C) const; |
9943 | void printPretty(raw_ostream &OS, |
9944 | const PrintingPolicy &Policy) const; |
9945 | const char *getSpelling() const; |
9946 | Spelling getSemanticSpelling() const; |
9947 | |
9948 | |
9949 | static bool classof(const Attr *A) { return A->getKind() == attr::OpenCLGlobalAddressSpace; } |
9950 | }; |
9951 | |
9952 | class OpenCLGlobalDeviceAddressSpaceAttr : public TypeAttr { |
9953 | public: |
9954 | enum Spelling { |
9955 | GNU_opencl_global_device = 0, |
9956 | CXX11_clang_opencl_global_device = 1, |
9957 | C23_clang_opencl_global_device = 2, |
9958 | SpellingNotCalculated = 15 |
9959 | |
9960 | }; |
9961 | |
9962 | // Factory methods |
9963 | static OpenCLGlobalDeviceAddressSpaceAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9964 | static OpenCLGlobalDeviceAddressSpaceAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9965 | static OpenCLGlobalDeviceAddressSpaceAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_opencl_global_device); |
9966 | static OpenCLGlobalDeviceAddressSpaceAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_opencl_global_device); |
9967 | |
9968 | // Constructors |
9969 | OpenCLGlobalDeviceAddressSpaceAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
9970 | ); |
9971 | |
9972 | OpenCLGlobalDeviceAddressSpaceAttr *clone(ASTContext &C) const; |
9973 | void printPretty(raw_ostream &OS, |
9974 | const PrintingPolicy &Policy) const; |
9975 | const char *getSpelling() const; |
9976 | |
9977 | |
9978 | static bool classof(const Attr *A) { return A->getKind() == attr::OpenCLGlobalDeviceAddressSpace; } |
9979 | }; |
9980 | |
9981 | class OpenCLGlobalHostAddressSpaceAttr : public TypeAttr { |
9982 | public: |
9983 | enum Spelling { |
9984 | GNU_opencl_global_host = 0, |
9985 | CXX11_clang_opencl_global_host = 1, |
9986 | C23_clang_opencl_global_host = 2, |
9987 | SpellingNotCalculated = 15 |
9988 | |
9989 | }; |
9990 | |
9991 | // Factory methods |
9992 | static OpenCLGlobalHostAddressSpaceAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9993 | static OpenCLGlobalHostAddressSpaceAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
9994 | static OpenCLGlobalHostAddressSpaceAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_opencl_global_host); |
9995 | static OpenCLGlobalHostAddressSpaceAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_opencl_global_host); |
9996 | |
9997 | // Constructors |
9998 | OpenCLGlobalHostAddressSpaceAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
9999 | ); |
10000 | |
10001 | OpenCLGlobalHostAddressSpaceAttr *clone(ASTContext &C) const; |
10002 | void printPretty(raw_ostream &OS, |
10003 | const PrintingPolicy &Policy) const; |
10004 | const char *getSpelling() const; |
10005 | |
10006 | |
10007 | static bool classof(const Attr *A) { return A->getKind() == attr::OpenCLGlobalHostAddressSpace; } |
10008 | }; |
10009 | |
10010 | class OpenCLIntelReqdSubGroupSizeAttr : public InheritableAttr { |
10011 | unsigned subGroupSize; |
10012 | |
10013 | public: |
10014 | // Factory methods |
10015 | static OpenCLIntelReqdSubGroupSizeAttr *CreateImplicit(ASTContext &Ctx, unsigned SubGroupSize, const AttributeCommonInfo &CommonInfo); |
10016 | static OpenCLIntelReqdSubGroupSizeAttr *Create(ASTContext &Ctx, unsigned SubGroupSize, const AttributeCommonInfo &CommonInfo); |
10017 | static OpenCLIntelReqdSubGroupSizeAttr *CreateImplicit(ASTContext &Ctx, unsigned SubGroupSize, SourceRange Range = {}); |
10018 | static OpenCLIntelReqdSubGroupSizeAttr *Create(ASTContext &Ctx, unsigned SubGroupSize, SourceRange Range = {}); |
10019 | |
10020 | // Constructors |
10021 | OpenCLIntelReqdSubGroupSizeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
10022 | , unsigned SubGroupSize |
10023 | ); |
10024 | |
10025 | OpenCLIntelReqdSubGroupSizeAttr *clone(ASTContext &C) const; |
10026 | void printPretty(raw_ostream &OS, |
10027 | const PrintingPolicy &Policy) const; |
10028 | const char *getSpelling() const; |
10029 | unsigned getSubGroupSize() const { |
10030 | return subGroupSize; |
10031 | } |
10032 | |
10033 | |
10034 | |
10035 | static bool classof(const Attr *A) { return A->getKind() == attr::OpenCLIntelReqdSubGroupSize; } |
10036 | }; |
10037 | |
10038 | class OpenCLKernelAttr : public InheritableAttr { |
10039 | public: |
10040 | enum Spelling { |
10041 | Keyword_kernel = 0, |
10042 | SpellingNotCalculated = 15 |
10043 | |
10044 | }; |
10045 | |
10046 | // Factory methods |
10047 | static OpenCLKernelAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
10048 | static OpenCLKernelAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
10049 | static OpenCLKernelAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = Keyword_kernel); |
10050 | static OpenCLKernelAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = Keyword_kernel); |
10051 | |
10052 | // Constructors |
10053 | OpenCLKernelAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
10054 | ); |
10055 | |
10056 | OpenCLKernelAttr *clone(ASTContext &C) const; |
10057 | void printPretty(raw_ostream &OS, |
10058 | const PrintingPolicy &Policy) const; |
10059 | const char *getSpelling() const; |
10060 | |
10061 | |
10062 | static bool classof(const Attr *A) { return A->getKind() == attr::OpenCLKernel; } |
10063 | }; |
10064 | |
10065 | class OpenCLLocalAddressSpaceAttr : public TypeAttr { |
10066 | public: |
10067 | enum Spelling { |
10068 | Keyword_local = 0, |
10069 | GNU_opencl_local = 2, |
10070 | CXX11_clang_opencl_local = 3, |
10071 | C23_clang_opencl_local = 4, |
10072 | SpellingNotCalculated = 15 |
10073 | |
10074 | }; |
10075 | |
10076 | // Factory methods |
10077 | static OpenCLLocalAddressSpaceAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
10078 | static OpenCLLocalAddressSpaceAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
10079 | static OpenCLLocalAddressSpaceAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = Keyword_local); |
10080 | static OpenCLLocalAddressSpaceAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = Keyword_local); |
10081 | |
10082 | // Constructors |
10083 | OpenCLLocalAddressSpaceAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
10084 | ); |
10085 | |
10086 | OpenCLLocalAddressSpaceAttr *clone(ASTContext &C) const; |
10087 | void printPretty(raw_ostream &OS, |
10088 | const PrintingPolicy &Policy) const; |
10089 | const char *getSpelling() const; |
10090 | Spelling getSemanticSpelling() const; |
10091 | |
10092 | |
10093 | static bool classof(const Attr *A) { return A->getKind() == attr::OpenCLLocalAddressSpace; } |
10094 | }; |
10095 | |
10096 | class OpenCLPrivateAddressSpaceAttr : public TypeAttr { |
10097 | public: |
10098 | enum Spelling { |
10099 | Keyword_private = 0, |
10100 | GNU_opencl_private = 2, |
10101 | CXX11_clang_opencl_private = 3, |
10102 | C23_clang_opencl_private = 4, |
10103 | SpellingNotCalculated = 15 |
10104 | |
10105 | }; |
10106 | |
10107 | // Factory methods |
10108 | static OpenCLPrivateAddressSpaceAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
10109 | static OpenCLPrivateAddressSpaceAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
10110 | static OpenCLPrivateAddressSpaceAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = Keyword_private); |
10111 | static OpenCLPrivateAddressSpaceAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = Keyword_private); |
10112 | |
10113 | // Constructors |
10114 | OpenCLPrivateAddressSpaceAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
10115 | ); |
10116 | |
10117 | OpenCLPrivateAddressSpaceAttr *clone(ASTContext &C) const; |
10118 | void printPretty(raw_ostream &OS, |
10119 | const PrintingPolicy &Policy) const; |
10120 | const char *getSpelling() const; |
10121 | Spelling getSemanticSpelling() const; |
10122 | |
10123 | |
10124 | static bool classof(const Attr *A) { return A->getKind() == attr::OpenCLPrivateAddressSpace; } |
10125 | }; |
10126 | |
10127 | class OpenCLUnrollHintAttr : public StmtAttr { |
10128 | unsigned unrollHint; |
10129 | |
10130 | public: |
10131 | // Factory methods |
10132 | static OpenCLUnrollHintAttr *CreateImplicit(ASTContext &Ctx, unsigned UnrollHint, const AttributeCommonInfo &CommonInfo); |
10133 | static OpenCLUnrollHintAttr *Create(ASTContext &Ctx, unsigned UnrollHint, const AttributeCommonInfo &CommonInfo); |
10134 | static OpenCLUnrollHintAttr *CreateImplicit(ASTContext &Ctx, unsigned UnrollHint, SourceRange Range = {}); |
10135 | static OpenCLUnrollHintAttr *Create(ASTContext &Ctx, unsigned UnrollHint, SourceRange Range = {}); |
10136 | |
10137 | // Constructors |
10138 | OpenCLUnrollHintAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
10139 | , unsigned UnrollHint |
10140 | ); |
10141 | OpenCLUnrollHintAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
10142 | ); |
10143 | |
10144 | OpenCLUnrollHintAttr *clone(ASTContext &C) const; |
10145 | void printPretty(raw_ostream &OS, |
10146 | const PrintingPolicy &Policy) const; |
10147 | const char *getSpelling() const; |
10148 | unsigned getUnrollHint() const { |
10149 | return unrollHint; |
10150 | } |
10151 | |
10152 | |
10153 | |
10154 | static bool classof(const Attr *A) { return A->getKind() == attr::OpenCLUnrollHint; } |
10155 | }; |
10156 | |
10157 | class OptimizeNoneAttr : public InheritableAttr { |
10158 | public: |
10159 | enum Spelling { |
10160 | GNU_optnone = 0, |
10161 | CXX11_clang_optnone = 1, |
10162 | C23_clang_optnone = 2, |
10163 | SpellingNotCalculated = 15 |
10164 | |
10165 | }; |
10166 | |
10167 | // Factory methods |
10168 | static OptimizeNoneAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
10169 | static OptimizeNoneAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
10170 | static OptimizeNoneAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_optnone); |
10171 | static OptimizeNoneAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_optnone); |
10172 | |
10173 | // Constructors |
10174 | OptimizeNoneAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
10175 | ); |
10176 | |
10177 | OptimizeNoneAttr *clone(ASTContext &C) const; |
10178 | void printPretty(raw_ostream &OS, |
10179 | const PrintingPolicy &Policy) const; |
10180 | const char *getSpelling() const; |
10181 | |
10182 | |
10183 | static bool classof(const Attr *A) { return A->getKind() == attr::OptimizeNone; } |
10184 | }; |
10185 | |
10186 | class OverloadableAttr : public Attr { |
10187 | public: |
10188 | enum Spelling { |
10189 | GNU_overloadable = 0, |
10190 | CXX11_clang_overloadable = 1, |
10191 | C23_clang_overloadable = 2, |
10192 | SpellingNotCalculated = 15 |
10193 | |
10194 | }; |
10195 | |
10196 | // Factory methods |
10197 | static OverloadableAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
10198 | static OverloadableAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
10199 | static OverloadableAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_overloadable); |
10200 | static OverloadableAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_overloadable); |
10201 | |
10202 | // Constructors |
10203 | OverloadableAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
10204 | ); |
10205 | |
10206 | OverloadableAttr *clone(ASTContext &C) const; |
10207 | void printPretty(raw_ostream &OS, |
10208 | const PrintingPolicy &Policy) const; |
10209 | const char *getSpelling() const; |
10210 | |
10211 | |
10212 | static bool classof(const Attr *A) { return A->getKind() == attr::Overloadable; } |
10213 | }; |
10214 | |
10215 | class OverrideAttr : public InheritableAttr { |
10216 | public: |
10217 | // Factory methods |
10218 | static OverrideAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
10219 | static OverrideAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
10220 | static OverrideAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
10221 | static OverrideAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
10222 | |
10223 | // Constructors |
10224 | OverrideAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
10225 | ); |
10226 | |
10227 | OverrideAttr *clone(ASTContext &C) const; |
10228 | void printPretty(raw_ostream &OS, |
10229 | const PrintingPolicy &Policy) const; |
10230 | const char *getSpelling() const; |
10231 | |
10232 | |
10233 | static bool classof(const Attr *A) { return A->getKind() == attr::Override; } |
10234 | }; |
10235 | |
10236 | class OwnerAttr : public InheritableAttr { |
10237 | TypeSourceInfo * derefType; |
10238 | |
10239 | public: |
10240 | // Factory methods |
10241 | static OwnerAttr *CreateImplicit(ASTContext &Ctx, TypeSourceInfo * DerefType, const AttributeCommonInfo &CommonInfo); |
10242 | static OwnerAttr *Create(ASTContext &Ctx, TypeSourceInfo * DerefType, const AttributeCommonInfo &CommonInfo); |
10243 | static OwnerAttr *CreateImplicit(ASTContext &Ctx, TypeSourceInfo * DerefType, SourceRange Range = {}); |
10244 | static OwnerAttr *Create(ASTContext &Ctx, TypeSourceInfo * DerefType, SourceRange Range = {}); |
10245 | |
10246 | // Constructors |
10247 | OwnerAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
10248 | , TypeSourceInfo * DerefType |
10249 | ); |
10250 | OwnerAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
10251 | ); |
10252 | |
10253 | OwnerAttr *clone(ASTContext &C) const; |
10254 | void printPretty(raw_ostream &OS, |
10255 | const PrintingPolicy &Policy) const; |
10256 | const char *getSpelling() const; |
10257 | QualType getDerefType() const { |
10258 | return derefType->getType(); |
10259 | } TypeSourceInfo * getDerefTypeLoc() const { |
10260 | return derefType; |
10261 | } |
10262 | |
10263 | |
10264 | |
10265 | static bool classof(const Attr *A) { return A->getKind() == attr::Owner; } |
10266 | }; |
10267 | |
10268 | class OwnershipAttr : public InheritableAttr { |
10269 | IdentifierInfo * module; |
10270 | |
10271 | unsigned args_Size; |
10272 | ParamIdx *args_; |
10273 | |
10274 | public: |
10275 | enum Spelling { |
10276 | GNU_ownership_holds = 0, |
10277 | CXX11_clang_ownership_holds = 1, |
10278 | C23_clang_ownership_holds = 2, |
10279 | GNU_ownership_returns = 3, |
10280 | CXX11_clang_ownership_returns = 4, |
10281 | C23_clang_ownership_returns = 5, |
10282 | GNU_ownership_takes = 6, |
10283 | CXX11_clang_ownership_takes = 7, |
10284 | C23_clang_ownership_takes = 8, |
10285 | SpellingNotCalculated = 15 |
10286 | |
10287 | }; |
10288 | |
10289 | // Factory methods |
10290 | static OwnershipAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * Module, ParamIdx *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo); |
10291 | static OwnershipAttr *Create(ASTContext &Ctx, IdentifierInfo * Module, ParamIdx *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo); |
10292 | static OwnershipAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * Module, ParamIdx *Args, unsigned ArgsSize, SourceRange Range = {}, Spelling S = GNU_ownership_holds); |
10293 | static OwnershipAttr *Create(ASTContext &Ctx, IdentifierInfo * Module, ParamIdx *Args, unsigned ArgsSize, SourceRange Range = {}, Spelling S = GNU_ownership_holds); |
10294 | |
10295 | // Constructors |
10296 | OwnershipAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
10297 | , IdentifierInfo * Module |
10298 | , ParamIdx *Args, unsigned ArgsSize |
10299 | ); |
10300 | OwnershipAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
10301 | , IdentifierInfo * Module |
10302 | ); |
10303 | |
10304 | OwnershipAttr *clone(ASTContext &C) const; |
10305 | void printPretty(raw_ostream &OS, |
10306 | const PrintingPolicy &Policy) const; |
10307 | const char *getSpelling() const; |
10308 | Spelling getSemanticSpelling() const; |
10309 | bool isHolds() const { return getAttributeSpellingListIndex() == 0 || |
10310 | getAttributeSpellingListIndex() == 1 || |
10311 | getAttributeSpellingListIndex() == 2; } |
10312 | bool isReturns() const { return getAttributeSpellingListIndex() == 3 || |
10313 | getAttributeSpellingListIndex() == 4 || |
10314 | getAttributeSpellingListIndex() == 5; } |
10315 | bool isTakes() const { return getAttributeSpellingListIndex() == 6 || |
10316 | getAttributeSpellingListIndex() == 7 || |
10317 | getAttributeSpellingListIndex() == 8; } |
10318 | IdentifierInfo * getModule() const { |
10319 | return module; |
10320 | } |
10321 | |
10322 | typedef ParamIdx* args_iterator; |
10323 | args_iterator args_begin() const { return args_; } |
10324 | args_iterator args_end() const { return args_ + args_Size; } |
10325 | unsigned args_size() const { return args_Size; } |
10326 | llvm::iterator_range<args_iterator> args() const { return llvm::make_range(x: args_begin(), y: args_end()); } |
10327 | |
10328 | |
10329 | |
10330 | enum OwnershipKind { Holds, Returns, Takes }; |
10331 | OwnershipKind getOwnKind() const { |
10332 | return isHolds() ? Holds : |
10333 | isTakes() ? Takes : |
10334 | Returns; |
10335 | } |
10336 | |
10337 | |
10338 | static bool classof(const Attr *A) { return A->getKind() == attr::Ownership; } |
10339 | }; |
10340 | |
10341 | class PackedAttr : public InheritableAttr { |
10342 | public: |
10343 | enum Spelling { |
10344 | GNU_packed = 0, |
10345 | CXX11_gnu_packed = 1, |
10346 | C23_gnu_packed = 2, |
10347 | SpellingNotCalculated = 15 |
10348 | |
10349 | }; |
10350 | |
10351 | // Factory methods |
10352 | static PackedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
10353 | static PackedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
10354 | static PackedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_packed); |
10355 | static PackedAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_packed); |
10356 | |
10357 | // Constructors |
10358 | PackedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
10359 | ); |
10360 | |
10361 | PackedAttr *clone(ASTContext &C) const; |
10362 | void printPretty(raw_ostream &OS, |
10363 | const PrintingPolicy &Policy) const; |
10364 | const char *getSpelling() const; |
10365 | |
10366 | |
10367 | static bool classof(const Attr *A) { return A->getKind() == attr::Packed; } |
10368 | }; |
10369 | |
10370 | class ParamTypestateAttr : public InheritableAttr { |
10371 | public: |
10372 | enum ConsumedState { |
10373 | Unknown, |
10374 | Consumed, |
10375 | Unconsumed |
10376 | }; |
10377 | private: |
10378 | ParamTypestateAttr::ConsumedState paramState; |
10379 | |
10380 | public: |
10381 | enum Spelling { |
10382 | GNU_param_typestate = 0, |
10383 | CXX11_clang_param_typestate = 1, |
10384 | SpellingNotCalculated = 15 |
10385 | |
10386 | }; |
10387 | |
10388 | // Factory methods |
10389 | static ParamTypestateAttr *CreateImplicit(ASTContext &Ctx, ParamTypestateAttr::ConsumedState ParamState, const AttributeCommonInfo &CommonInfo); |
10390 | static ParamTypestateAttr *Create(ASTContext &Ctx, ParamTypestateAttr::ConsumedState ParamState, const AttributeCommonInfo &CommonInfo); |
10391 | static ParamTypestateAttr *CreateImplicit(ASTContext &Ctx, ParamTypestateAttr::ConsumedState ParamState, SourceRange Range = {}, Spelling S = GNU_param_typestate); |
10392 | static ParamTypestateAttr *Create(ASTContext &Ctx, ParamTypestateAttr::ConsumedState ParamState, SourceRange Range = {}, Spelling S = GNU_param_typestate); |
10393 | |
10394 | // Constructors |
10395 | ParamTypestateAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
10396 | , ParamTypestateAttr::ConsumedState ParamState |
10397 | ); |
10398 | |
10399 | ParamTypestateAttr *clone(ASTContext &C) const; |
10400 | void printPretty(raw_ostream &OS, |
10401 | const PrintingPolicy &Policy) const; |
10402 | const char *getSpelling() const; |
10403 | ParamTypestateAttr::ConsumedState getParamState() const { |
10404 | return paramState; |
10405 | } |
10406 | |
10407 | static bool ConvertStrToConsumedState(StringRef Val, ParamTypestateAttr::ConsumedState &Out); |
10408 | static const char *ConvertConsumedStateToStr(ParamTypestateAttr::ConsumedState Val); |
10409 | |
10410 | |
10411 | static bool classof(const Attr *A) { return A->getKind() == attr::ParamTypestate; } |
10412 | }; |
10413 | |
10414 | class PascalAttr : public InheritableAttr { |
10415 | public: |
10416 | enum Spelling { |
10417 | GNU_pascal = 0, |
10418 | CXX11_clang_pascal = 1, |
10419 | C23_clang_pascal = 2, |
10420 | Keyword_pascal = 3, |
10421 | SpellingNotCalculated = 15 |
10422 | |
10423 | }; |
10424 | |
10425 | // Factory methods |
10426 | static PascalAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
10427 | static PascalAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
10428 | static PascalAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_pascal); |
10429 | static PascalAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_pascal); |
10430 | |
10431 | // Constructors |
10432 | PascalAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
10433 | ); |
10434 | |
10435 | PascalAttr *clone(ASTContext &C) const; |
10436 | void printPretty(raw_ostream &OS, |
10437 | const PrintingPolicy &Policy) const; |
10438 | const char *getSpelling() const; |
10439 | |
10440 | |
10441 | static bool classof(const Attr *A) { return A->getKind() == attr::Pascal; } |
10442 | }; |
10443 | |
10444 | class PassObjectSizeAttr : public InheritableParamAttr { |
10445 | int type; |
10446 | |
10447 | public: |
10448 | enum Spelling { |
10449 | GNU_pass_object_size = 0, |
10450 | CXX11_clang_pass_object_size = 1, |
10451 | C23_clang_pass_object_size = 2, |
10452 | GNU_pass_dynamic_object_size = 3, |
10453 | CXX11_clang_pass_dynamic_object_size = 4, |
10454 | C23_clang_pass_dynamic_object_size = 5, |
10455 | SpellingNotCalculated = 15 |
10456 | |
10457 | }; |
10458 | |
10459 | // Factory methods |
10460 | static PassObjectSizeAttr *CreateImplicit(ASTContext &Ctx, int Type, const AttributeCommonInfo &CommonInfo); |
10461 | static PassObjectSizeAttr *Create(ASTContext &Ctx, int Type, const AttributeCommonInfo &CommonInfo); |
10462 | static PassObjectSizeAttr *CreateImplicit(ASTContext &Ctx, int Type, SourceRange Range = {}, Spelling S = GNU_pass_object_size); |
10463 | static PassObjectSizeAttr *Create(ASTContext &Ctx, int Type, SourceRange Range = {}, Spelling S = GNU_pass_object_size); |
10464 | |
10465 | // Constructors |
10466 | PassObjectSizeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
10467 | , int Type |
10468 | ); |
10469 | |
10470 | PassObjectSizeAttr *clone(ASTContext &C) const; |
10471 | void printPretty(raw_ostream &OS, |
10472 | const PrintingPolicy &Policy) const; |
10473 | const char *getSpelling() const; |
10474 | Spelling getSemanticSpelling() const; |
10475 | bool isDynamic() const { return getAttributeSpellingListIndex() == 3 || |
10476 | getAttributeSpellingListIndex() == 4 || |
10477 | getAttributeSpellingListIndex() == 5; } |
10478 | int getType() const { |
10479 | return type; |
10480 | } |
10481 | |
10482 | |
10483 | |
10484 | static bool classof(const Attr *A) { return A->getKind() == attr::PassObjectSize; } |
10485 | }; |
10486 | |
10487 | class PatchableFunctionEntryAttr : public InheritableAttr { |
10488 | unsigned count; |
10489 | |
10490 | int offset; |
10491 | |
10492 | public: |
10493 | enum Spelling { |
10494 | GNU_patchable_function_entry = 0, |
10495 | CXX11_gnu_patchable_function_entry = 1, |
10496 | C23_gnu_patchable_function_entry = 2, |
10497 | SpellingNotCalculated = 15 |
10498 | |
10499 | }; |
10500 | |
10501 | // Factory methods |
10502 | static PatchableFunctionEntryAttr *CreateImplicit(ASTContext &Ctx, unsigned Count, int Offset, const AttributeCommonInfo &CommonInfo); |
10503 | static PatchableFunctionEntryAttr *Create(ASTContext &Ctx, unsigned Count, int Offset, const AttributeCommonInfo &CommonInfo); |
10504 | static PatchableFunctionEntryAttr *CreateImplicit(ASTContext &Ctx, unsigned Count, int Offset, SourceRange Range = {}, Spelling S = GNU_patchable_function_entry); |
10505 | static PatchableFunctionEntryAttr *Create(ASTContext &Ctx, unsigned Count, int Offset, SourceRange Range = {}, Spelling S = GNU_patchable_function_entry); |
10506 | |
10507 | // Constructors |
10508 | PatchableFunctionEntryAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
10509 | , unsigned Count |
10510 | , int Offset |
10511 | ); |
10512 | PatchableFunctionEntryAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
10513 | , unsigned Count |
10514 | ); |
10515 | |
10516 | PatchableFunctionEntryAttr *clone(ASTContext &C) const; |
10517 | void printPretty(raw_ostream &OS, |
10518 | const PrintingPolicy &Policy) const; |
10519 | const char *getSpelling() const; |
10520 | unsigned getCount() const { |
10521 | return count; |
10522 | } |
10523 | |
10524 | int getOffset() const { |
10525 | return offset; |
10526 | } |
10527 | |
10528 | static const int DefaultOffset = 0; |
10529 | |
10530 | |
10531 | |
10532 | static bool classof(const Attr *A) { return A->getKind() == attr::PatchableFunctionEntry; } |
10533 | }; |
10534 | |
10535 | class PcsAttr : public InheritableAttr { |
10536 | public: |
10537 | enum PCSType { |
10538 | AAPCS, |
10539 | AAPCS_VFP |
10540 | }; |
10541 | private: |
10542 | PcsAttr::PCSType pCS; |
10543 | |
10544 | public: |
10545 | enum Spelling { |
10546 | GNU_pcs = 0, |
10547 | CXX11_gnu_pcs = 1, |
10548 | C23_gnu_pcs = 2, |
10549 | SpellingNotCalculated = 15 |
10550 | |
10551 | }; |
10552 | |
10553 | // Factory methods |
10554 | static PcsAttr *CreateImplicit(ASTContext &Ctx, PcsAttr::PCSType PCS, const AttributeCommonInfo &CommonInfo); |
10555 | static PcsAttr *Create(ASTContext &Ctx, PcsAttr::PCSType PCS, const AttributeCommonInfo &CommonInfo); |
10556 | static PcsAttr *CreateImplicit(ASTContext &Ctx, PcsAttr::PCSType PCS, SourceRange Range = {}, Spelling S = GNU_pcs); |
10557 | static PcsAttr *Create(ASTContext &Ctx, PcsAttr::PCSType PCS, SourceRange Range = {}, Spelling S = GNU_pcs); |
10558 | |
10559 | // Constructors |
10560 | PcsAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
10561 | , PcsAttr::PCSType PCS |
10562 | ); |
10563 | |
10564 | PcsAttr *clone(ASTContext &C) const; |
10565 | void printPretty(raw_ostream &OS, |
10566 | const PrintingPolicy &Policy) const; |
10567 | const char *getSpelling() const; |
10568 | PcsAttr::PCSType getPCS() const { |
10569 | return pCS; |
10570 | } |
10571 | |
10572 | static bool ConvertStrToPCSType(StringRef Val, PcsAttr::PCSType &Out); |
10573 | static const char *ConvertPCSTypeToStr(PcsAttr::PCSType Val); |
10574 | |
10575 | |
10576 | static bool classof(const Attr *A) { return A->getKind() == attr::Pcs; } |
10577 | }; |
10578 | |
10579 | class PointerAttr : public InheritableAttr { |
10580 | TypeSourceInfo * derefType; |
10581 | |
10582 | public: |
10583 | // Factory methods |
10584 | static PointerAttr *CreateImplicit(ASTContext &Ctx, TypeSourceInfo * DerefType, const AttributeCommonInfo &CommonInfo); |
10585 | static PointerAttr *Create(ASTContext &Ctx, TypeSourceInfo * DerefType, const AttributeCommonInfo &CommonInfo); |
10586 | static PointerAttr *CreateImplicit(ASTContext &Ctx, TypeSourceInfo * DerefType, SourceRange Range = {}); |
10587 | static PointerAttr *Create(ASTContext &Ctx, TypeSourceInfo * DerefType, SourceRange Range = {}); |
10588 | |
10589 | // Constructors |
10590 | PointerAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
10591 | , TypeSourceInfo * DerefType |
10592 | ); |
10593 | PointerAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
10594 | ); |
10595 | |
10596 | PointerAttr *clone(ASTContext &C) const; |
10597 | void printPretty(raw_ostream &OS, |
10598 | const PrintingPolicy &Policy) const; |
10599 | const char *getSpelling() const; |
10600 | QualType getDerefType() const { |
10601 | return derefType->getType(); |
10602 | } TypeSourceInfo * getDerefTypeLoc() const { |
10603 | return derefType; |
10604 | } |
10605 | |
10606 | |
10607 | |
10608 | static bool classof(const Attr *A) { return A->getKind() == attr::Pointer; } |
10609 | }; |
10610 | |
10611 | class PragmaClangBSSSectionAttr : public InheritableAttr { |
10612 | unsigned nameLength; |
10613 | char *name; |
10614 | |
10615 | public: |
10616 | // Factory methods |
10617 | static PragmaClangBSSSectionAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Name, const AttributeCommonInfo &CommonInfo); |
10618 | static PragmaClangBSSSectionAttr *Create(ASTContext &Ctx, llvm::StringRef Name, const AttributeCommonInfo &CommonInfo); |
10619 | static PragmaClangBSSSectionAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Name, SourceRange Range = {}); |
10620 | static PragmaClangBSSSectionAttr *Create(ASTContext &Ctx, llvm::StringRef Name, SourceRange Range = {}); |
10621 | |
10622 | // Constructors |
10623 | PragmaClangBSSSectionAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
10624 | , llvm::StringRef Name |
10625 | ); |
10626 | |
10627 | PragmaClangBSSSectionAttr *clone(ASTContext &C) const; |
10628 | void printPretty(raw_ostream &OS, |
10629 | const PrintingPolicy &Policy) const; |
10630 | const char *getSpelling() const; |
10631 | llvm::StringRef getName() const { |
10632 | return llvm::StringRef(name, nameLength); |
10633 | } |
10634 | unsigned getNameLength() const { |
10635 | return nameLength; |
10636 | } |
10637 | void setName(ASTContext &C, llvm::StringRef S) { |
10638 | nameLength = S.size(); |
10639 | this->name = new (C, 1) char [nameLength]; |
10640 | if (!S.empty()) |
10641 | std::memcpy(dest: this->name, src: S.data(), n: nameLength); |
10642 | } |
10643 | |
10644 | |
10645 | |
10646 | static bool classof(const Attr *A) { return A->getKind() == attr::PragmaClangBSSSection; } |
10647 | }; |
10648 | |
10649 | class PragmaClangDataSectionAttr : public InheritableAttr { |
10650 | unsigned nameLength; |
10651 | char *name; |
10652 | |
10653 | public: |
10654 | // Factory methods |
10655 | static PragmaClangDataSectionAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Name, const AttributeCommonInfo &CommonInfo); |
10656 | static PragmaClangDataSectionAttr *Create(ASTContext &Ctx, llvm::StringRef Name, const AttributeCommonInfo &CommonInfo); |
10657 | static PragmaClangDataSectionAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Name, SourceRange Range = {}); |
10658 | static PragmaClangDataSectionAttr *Create(ASTContext &Ctx, llvm::StringRef Name, SourceRange Range = {}); |
10659 | |
10660 | // Constructors |
10661 | PragmaClangDataSectionAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
10662 | , llvm::StringRef Name |
10663 | ); |
10664 | |
10665 | PragmaClangDataSectionAttr *clone(ASTContext &C) const; |
10666 | void printPretty(raw_ostream &OS, |
10667 | const PrintingPolicy &Policy) const; |
10668 | const char *getSpelling() const; |
10669 | llvm::StringRef getName() const { |
10670 | return llvm::StringRef(name, nameLength); |
10671 | } |
10672 | unsigned getNameLength() const { |
10673 | return nameLength; |
10674 | } |
10675 | void setName(ASTContext &C, llvm::StringRef S) { |
10676 | nameLength = S.size(); |
10677 | this->name = new (C, 1) char [nameLength]; |
10678 | if (!S.empty()) |
10679 | std::memcpy(dest: this->name, src: S.data(), n: nameLength); |
10680 | } |
10681 | |
10682 | |
10683 | |
10684 | static bool classof(const Attr *A) { return A->getKind() == attr::PragmaClangDataSection; } |
10685 | }; |
10686 | |
10687 | class PragmaClangRelroSectionAttr : public InheritableAttr { |
10688 | unsigned nameLength; |
10689 | char *name; |
10690 | |
10691 | public: |
10692 | // Factory methods |
10693 | static PragmaClangRelroSectionAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Name, const AttributeCommonInfo &CommonInfo); |
10694 | static PragmaClangRelroSectionAttr *Create(ASTContext &Ctx, llvm::StringRef Name, const AttributeCommonInfo &CommonInfo); |
10695 | static PragmaClangRelroSectionAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Name, SourceRange Range = {}); |
10696 | static PragmaClangRelroSectionAttr *Create(ASTContext &Ctx, llvm::StringRef Name, SourceRange Range = {}); |
10697 | |
10698 | // Constructors |
10699 | PragmaClangRelroSectionAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
10700 | , llvm::StringRef Name |
10701 | ); |
10702 | |
10703 | PragmaClangRelroSectionAttr *clone(ASTContext &C) const; |
10704 | void printPretty(raw_ostream &OS, |
10705 | const PrintingPolicy &Policy) const; |
10706 | const char *getSpelling() const; |
10707 | llvm::StringRef getName() const { |
10708 | return llvm::StringRef(name, nameLength); |
10709 | } |
10710 | unsigned getNameLength() const { |
10711 | return nameLength; |
10712 | } |
10713 | void setName(ASTContext &C, llvm::StringRef S) { |
10714 | nameLength = S.size(); |
10715 | this->name = new (C, 1) char [nameLength]; |
10716 | if (!S.empty()) |
10717 | std::memcpy(dest: this->name, src: S.data(), n: nameLength); |
10718 | } |
10719 | |
10720 | |
10721 | |
10722 | static bool classof(const Attr *A) { return A->getKind() == attr::PragmaClangRelroSection; } |
10723 | }; |
10724 | |
10725 | class PragmaClangRodataSectionAttr : public InheritableAttr { |
10726 | unsigned nameLength; |
10727 | char *name; |
10728 | |
10729 | public: |
10730 | // Factory methods |
10731 | static PragmaClangRodataSectionAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Name, const AttributeCommonInfo &CommonInfo); |
10732 | static PragmaClangRodataSectionAttr *Create(ASTContext &Ctx, llvm::StringRef Name, const AttributeCommonInfo &CommonInfo); |
10733 | static PragmaClangRodataSectionAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Name, SourceRange Range = {}); |
10734 | static PragmaClangRodataSectionAttr *Create(ASTContext &Ctx, llvm::StringRef Name, SourceRange Range = {}); |
10735 | |
10736 | // Constructors |
10737 | PragmaClangRodataSectionAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
10738 | , llvm::StringRef Name |
10739 | ); |
10740 | |
10741 | PragmaClangRodataSectionAttr *clone(ASTContext &C) const; |
10742 | void printPretty(raw_ostream &OS, |
10743 | const PrintingPolicy &Policy) const; |
10744 | const char *getSpelling() const; |
10745 | llvm::StringRef getName() const { |
10746 | return llvm::StringRef(name, nameLength); |
10747 | } |
10748 | unsigned getNameLength() const { |
10749 | return nameLength; |
10750 | } |
10751 | void setName(ASTContext &C, llvm::StringRef S) { |
10752 | nameLength = S.size(); |
10753 | this->name = new (C, 1) char [nameLength]; |
10754 | if (!S.empty()) |
10755 | std::memcpy(dest: this->name, src: S.data(), n: nameLength); |
10756 | } |
10757 | |
10758 | |
10759 | |
10760 | static bool classof(const Attr *A) { return A->getKind() == attr::PragmaClangRodataSection; } |
10761 | }; |
10762 | |
10763 | class PragmaClangTextSectionAttr : public InheritableAttr { |
10764 | unsigned nameLength; |
10765 | char *name; |
10766 | |
10767 | public: |
10768 | // Factory methods |
10769 | static PragmaClangTextSectionAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Name, const AttributeCommonInfo &CommonInfo); |
10770 | static PragmaClangTextSectionAttr *Create(ASTContext &Ctx, llvm::StringRef Name, const AttributeCommonInfo &CommonInfo); |
10771 | static PragmaClangTextSectionAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Name, SourceRange Range = {}); |
10772 | static PragmaClangTextSectionAttr *Create(ASTContext &Ctx, llvm::StringRef Name, SourceRange Range = {}); |
10773 | |
10774 | // Constructors |
10775 | PragmaClangTextSectionAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
10776 | , llvm::StringRef Name |
10777 | ); |
10778 | |
10779 | PragmaClangTextSectionAttr *clone(ASTContext &C) const; |
10780 | void printPretty(raw_ostream &OS, |
10781 | const PrintingPolicy &Policy) const; |
10782 | const char *getSpelling() const; |
10783 | llvm::StringRef getName() const { |
10784 | return llvm::StringRef(name, nameLength); |
10785 | } |
10786 | unsigned getNameLength() const { |
10787 | return nameLength; |
10788 | } |
10789 | void setName(ASTContext &C, llvm::StringRef S) { |
10790 | nameLength = S.size(); |
10791 | this->name = new (C, 1) char [nameLength]; |
10792 | if (!S.empty()) |
10793 | std::memcpy(dest: this->name, src: S.data(), n: nameLength); |
10794 | } |
10795 | |
10796 | |
10797 | |
10798 | static bool classof(const Attr *A) { return A->getKind() == attr::PragmaClangTextSection; } |
10799 | }; |
10800 | |
10801 | class PreferredNameAttr : public InheritableAttr { |
10802 | TypeSourceInfo * typedefType; |
10803 | |
10804 | public: |
10805 | enum Spelling { |
10806 | GNU_preferred_name = 0, |
10807 | CXX11_clang_preferred_name = 1, |
10808 | SpellingNotCalculated = 15 |
10809 | |
10810 | }; |
10811 | |
10812 | // Factory methods |
10813 | static PreferredNameAttr *CreateImplicit(ASTContext &Ctx, TypeSourceInfo * TypedefType, const AttributeCommonInfo &CommonInfo); |
10814 | static PreferredNameAttr *Create(ASTContext &Ctx, TypeSourceInfo * TypedefType, const AttributeCommonInfo &CommonInfo); |
10815 | static PreferredNameAttr *CreateImplicit(ASTContext &Ctx, TypeSourceInfo * TypedefType, SourceRange Range = {}, Spelling S = GNU_preferred_name); |
10816 | static PreferredNameAttr *Create(ASTContext &Ctx, TypeSourceInfo * TypedefType, SourceRange Range = {}, Spelling S = GNU_preferred_name); |
10817 | |
10818 | // Constructors |
10819 | PreferredNameAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
10820 | , TypeSourceInfo * TypedefType |
10821 | ); |
10822 | |
10823 | PreferredNameAttr *clone(ASTContext &C) const; |
10824 | void printPretty(raw_ostream &OS, |
10825 | const PrintingPolicy &Policy) const; |
10826 | const char *getSpelling() const; |
10827 | QualType getTypedefType() const { |
10828 | return typedefType->getType(); |
10829 | } TypeSourceInfo * getTypedefTypeLoc() const { |
10830 | return typedefType; |
10831 | } |
10832 | |
10833 | |
10834 | |
10835 | static bool classof(const Attr *A) { return A->getKind() == attr::PreferredName; } |
10836 | }; |
10837 | |
10838 | class PreferredTypeAttr : public InheritableAttr { |
10839 | TypeSourceInfo * type; |
10840 | |
10841 | public: |
10842 | enum Spelling { |
10843 | GNU_preferred_type = 0, |
10844 | CXX11_clang_preferred_type = 1, |
10845 | C23_clang_preferred_type = 2, |
10846 | SpellingNotCalculated = 15 |
10847 | |
10848 | }; |
10849 | |
10850 | // Factory methods |
10851 | static PreferredTypeAttr *CreateImplicit(ASTContext &Ctx, TypeSourceInfo * Type, const AttributeCommonInfo &CommonInfo); |
10852 | static PreferredTypeAttr *Create(ASTContext &Ctx, TypeSourceInfo * Type, const AttributeCommonInfo &CommonInfo); |
10853 | static PreferredTypeAttr *CreateImplicit(ASTContext &Ctx, TypeSourceInfo * Type, SourceRange Range = {}, Spelling S = GNU_preferred_type); |
10854 | static PreferredTypeAttr *Create(ASTContext &Ctx, TypeSourceInfo * Type, SourceRange Range = {}, Spelling S = GNU_preferred_type); |
10855 | |
10856 | // Constructors |
10857 | PreferredTypeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
10858 | , TypeSourceInfo * Type |
10859 | ); |
10860 | PreferredTypeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
10861 | ); |
10862 | |
10863 | PreferredTypeAttr *clone(ASTContext &C) const; |
10864 | void printPretty(raw_ostream &OS, |
10865 | const PrintingPolicy &Policy) const; |
10866 | const char *getSpelling() const; |
10867 | QualType getType() const { |
10868 | return type->getType(); |
10869 | } TypeSourceInfo * getTypeLoc() const { |
10870 | return type; |
10871 | } |
10872 | |
10873 | |
10874 | |
10875 | static bool classof(const Attr *A) { return A->getKind() == attr::PreferredType; } |
10876 | }; |
10877 | |
10878 | class PreserveAllAttr : public InheritableAttr { |
10879 | public: |
10880 | enum Spelling { |
10881 | GNU_preserve_all = 0, |
10882 | CXX11_clang_preserve_all = 1, |
10883 | C23_clang_preserve_all = 2, |
10884 | SpellingNotCalculated = 15 |
10885 | |
10886 | }; |
10887 | |
10888 | // Factory methods |
10889 | static PreserveAllAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
10890 | static PreserveAllAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
10891 | static PreserveAllAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_preserve_all); |
10892 | static PreserveAllAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_preserve_all); |
10893 | |
10894 | // Constructors |
10895 | PreserveAllAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
10896 | ); |
10897 | |
10898 | PreserveAllAttr *clone(ASTContext &C) const; |
10899 | void printPretty(raw_ostream &OS, |
10900 | const PrintingPolicy &Policy) const; |
10901 | const char *getSpelling() const; |
10902 | |
10903 | |
10904 | static bool classof(const Attr *A) { return A->getKind() == attr::PreserveAll; } |
10905 | }; |
10906 | |
10907 | class PreserveMostAttr : public InheritableAttr { |
10908 | public: |
10909 | enum Spelling { |
10910 | GNU_preserve_most = 0, |
10911 | CXX11_clang_preserve_most = 1, |
10912 | C23_clang_preserve_most = 2, |
10913 | SpellingNotCalculated = 15 |
10914 | |
10915 | }; |
10916 | |
10917 | // Factory methods |
10918 | static PreserveMostAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
10919 | static PreserveMostAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
10920 | static PreserveMostAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_preserve_most); |
10921 | static PreserveMostAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_preserve_most); |
10922 | |
10923 | // Constructors |
10924 | PreserveMostAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
10925 | ); |
10926 | |
10927 | PreserveMostAttr *clone(ASTContext &C) const; |
10928 | void printPretty(raw_ostream &OS, |
10929 | const PrintingPolicy &Policy) const; |
10930 | const char *getSpelling() const; |
10931 | |
10932 | |
10933 | static bool classof(const Attr *A) { return A->getKind() == attr::PreserveMost; } |
10934 | }; |
10935 | |
10936 | class PreserveNoneAttr : public InheritableAttr { |
10937 | public: |
10938 | enum Spelling { |
10939 | GNU_preserve_none = 0, |
10940 | CXX11_clang_preserve_none = 1, |
10941 | C23_clang_preserve_none = 2, |
10942 | SpellingNotCalculated = 15 |
10943 | |
10944 | }; |
10945 | |
10946 | // Factory methods |
10947 | static PreserveNoneAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
10948 | static PreserveNoneAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
10949 | static PreserveNoneAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_preserve_none); |
10950 | static PreserveNoneAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_preserve_none); |
10951 | |
10952 | // Constructors |
10953 | PreserveNoneAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
10954 | ); |
10955 | |
10956 | PreserveNoneAttr *clone(ASTContext &C) const; |
10957 | void printPretty(raw_ostream &OS, |
10958 | const PrintingPolicy &Policy) const; |
10959 | const char *getSpelling() const; |
10960 | |
10961 | |
10962 | static bool classof(const Attr *A) { return A->getKind() == attr::PreserveNone; } |
10963 | }; |
10964 | |
10965 | class PtGuardedByAttr : public InheritableAttr { |
10966 | Expr * arg; |
10967 | |
10968 | public: |
10969 | // Factory methods |
10970 | static PtGuardedByAttr *CreateImplicit(ASTContext &Ctx, Expr * Arg, const AttributeCommonInfo &CommonInfo); |
10971 | static PtGuardedByAttr *Create(ASTContext &Ctx, Expr * Arg, const AttributeCommonInfo &CommonInfo); |
10972 | static PtGuardedByAttr *CreateImplicit(ASTContext &Ctx, Expr * Arg, SourceRange Range = {}); |
10973 | static PtGuardedByAttr *Create(ASTContext &Ctx, Expr * Arg, SourceRange Range = {}); |
10974 | |
10975 | // Constructors |
10976 | PtGuardedByAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
10977 | , Expr * Arg |
10978 | ); |
10979 | |
10980 | PtGuardedByAttr *clone(ASTContext &C) const; |
10981 | void printPretty(raw_ostream &OS, |
10982 | const PrintingPolicy &Policy) const; |
10983 | const char *getSpelling() const; |
10984 | Expr * getArg() const { |
10985 | return arg; |
10986 | } |
10987 | |
10988 | |
10989 | |
10990 | static bool classof(const Attr *A) { return A->getKind() == attr::PtGuardedBy; } |
10991 | }; |
10992 | |
10993 | class PtGuardedVarAttr : public InheritableAttr { |
10994 | public: |
10995 | enum Spelling { |
10996 | GNU_pt_guarded_var = 0, |
10997 | CXX11_clang_pt_guarded_var = 1, |
10998 | SpellingNotCalculated = 15 |
10999 | |
11000 | }; |
11001 | |
11002 | // Factory methods |
11003 | static PtGuardedVarAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
11004 | static PtGuardedVarAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
11005 | static PtGuardedVarAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_pt_guarded_var); |
11006 | static PtGuardedVarAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_pt_guarded_var); |
11007 | |
11008 | // Constructors |
11009 | PtGuardedVarAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
11010 | ); |
11011 | |
11012 | PtGuardedVarAttr *clone(ASTContext &C) const; |
11013 | void printPretty(raw_ostream &OS, |
11014 | const PrintingPolicy &Policy) const; |
11015 | const char *getSpelling() const; |
11016 | |
11017 | |
11018 | static bool classof(const Attr *A) { return A->getKind() == attr::PtGuardedVar; } |
11019 | }; |
11020 | |
11021 | class Ptr32Attr : public TypeAttr { |
11022 | public: |
11023 | // Factory methods |
11024 | static Ptr32Attr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
11025 | static Ptr32Attr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
11026 | static Ptr32Attr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
11027 | static Ptr32Attr *Create(ASTContext &Ctx, SourceRange Range = {}); |
11028 | |
11029 | // Constructors |
11030 | Ptr32Attr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
11031 | ); |
11032 | |
11033 | Ptr32Attr *clone(ASTContext &C) const; |
11034 | void printPretty(raw_ostream &OS, |
11035 | const PrintingPolicy &Policy) const; |
11036 | const char *getSpelling() const; |
11037 | |
11038 | |
11039 | static bool classof(const Attr *A) { return A->getKind() == attr::Ptr32; } |
11040 | }; |
11041 | |
11042 | class Ptr64Attr : public TypeAttr { |
11043 | public: |
11044 | // Factory methods |
11045 | static Ptr64Attr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
11046 | static Ptr64Attr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
11047 | static Ptr64Attr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
11048 | static Ptr64Attr *Create(ASTContext &Ctx, SourceRange Range = {}); |
11049 | |
11050 | // Constructors |
11051 | Ptr64Attr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
11052 | ); |
11053 | |
11054 | Ptr64Attr *clone(ASTContext &C) const; |
11055 | void printPretty(raw_ostream &OS, |
11056 | const PrintingPolicy &Policy) const; |
11057 | const char *getSpelling() const; |
11058 | |
11059 | |
11060 | static bool classof(const Attr *A) { return A->getKind() == attr::Ptr64; } |
11061 | }; |
11062 | |
11063 | class PureAttr : public InheritableAttr { |
11064 | public: |
11065 | enum Spelling { |
11066 | GNU_pure = 0, |
11067 | CXX11_gnu_pure = 1, |
11068 | C23_gnu_pure = 2, |
11069 | SpellingNotCalculated = 15 |
11070 | |
11071 | }; |
11072 | |
11073 | // Factory methods |
11074 | static PureAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
11075 | static PureAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
11076 | static PureAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_pure); |
11077 | static PureAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_pure); |
11078 | |
11079 | // Constructors |
11080 | PureAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
11081 | ); |
11082 | |
11083 | PureAttr *clone(ASTContext &C) const; |
11084 | void printPretty(raw_ostream &OS, |
11085 | const PrintingPolicy &Policy) const; |
11086 | const char *getSpelling() const; |
11087 | |
11088 | |
11089 | static bool classof(const Attr *A) { return A->getKind() == attr::Pure; } |
11090 | }; |
11091 | |
11092 | class RISCVInterruptAttr : public InheritableAttr { |
11093 | public: |
11094 | enum InterruptType { |
11095 | supervisor, |
11096 | machine |
11097 | }; |
11098 | private: |
11099 | RISCVInterruptAttr::InterruptType interrupt; |
11100 | |
11101 | public: |
11102 | enum Spelling { |
11103 | GNU_interrupt = 0, |
11104 | CXX11_gnu_interrupt = 1, |
11105 | C23_gnu_interrupt = 2, |
11106 | SpellingNotCalculated = 15 |
11107 | |
11108 | }; |
11109 | |
11110 | // Factory methods |
11111 | static RISCVInterruptAttr *CreateImplicit(ASTContext &Ctx, RISCVInterruptAttr::InterruptType Interrupt, const AttributeCommonInfo &CommonInfo); |
11112 | static RISCVInterruptAttr *Create(ASTContext &Ctx, RISCVInterruptAttr::InterruptType Interrupt, const AttributeCommonInfo &CommonInfo); |
11113 | static RISCVInterruptAttr *CreateImplicit(ASTContext &Ctx, RISCVInterruptAttr::InterruptType Interrupt, SourceRange Range = {}, Spelling S = GNU_interrupt); |
11114 | static RISCVInterruptAttr *Create(ASTContext &Ctx, RISCVInterruptAttr::InterruptType Interrupt, SourceRange Range = {}, Spelling S = GNU_interrupt); |
11115 | |
11116 | // Constructors |
11117 | RISCVInterruptAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
11118 | , RISCVInterruptAttr::InterruptType Interrupt |
11119 | ); |
11120 | RISCVInterruptAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
11121 | ); |
11122 | |
11123 | RISCVInterruptAttr *clone(ASTContext &C) const; |
11124 | void printPretty(raw_ostream &OS, |
11125 | const PrintingPolicy &Policy) const; |
11126 | const char *getSpelling() const; |
11127 | RISCVInterruptAttr::InterruptType getInterrupt() const { |
11128 | return interrupt; |
11129 | } |
11130 | |
11131 | static bool ConvertStrToInterruptType(StringRef Val, RISCVInterruptAttr::InterruptType &Out); |
11132 | static const char *ConvertInterruptTypeToStr(RISCVInterruptAttr::InterruptType Val); |
11133 | |
11134 | |
11135 | static bool classof(const Attr *A) { return A->getKind() == attr::RISCVInterrupt; } |
11136 | }; |
11137 | |
11138 | class RISCVVectorCCAttr : public InheritableAttr { |
11139 | public: |
11140 | enum Spelling { |
11141 | CXX11_riscv_vector_cc = 0, |
11142 | C23_riscv_vector_cc = 1, |
11143 | GNU_riscv_vector_cc = 2, |
11144 | CXX11_clang_riscv_vector_cc = 3, |
11145 | C23_clang_riscv_vector_cc = 4, |
11146 | SpellingNotCalculated = 15 |
11147 | |
11148 | }; |
11149 | |
11150 | // Factory methods |
11151 | static RISCVVectorCCAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
11152 | static RISCVVectorCCAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
11153 | static RISCVVectorCCAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = CXX11_riscv_vector_cc); |
11154 | static RISCVVectorCCAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = CXX11_riscv_vector_cc); |
11155 | |
11156 | // Constructors |
11157 | RISCVVectorCCAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
11158 | ); |
11159 | |
11160 | RISCVVectorCCAttr *clone(ASTContext &C) const; |
11161 | void printPretty(raw_ostream &OS, |
11162 | const PrintingPolicy &Policy) const; |
11163 | const char *getSpelling() const; |
11164 | Spelling getSemanticSpelling() const; |
11165 | |
11166 | |
11167 | static bool classof(const Attr *A) { return A->getKind() == attr::RISCVVectorCC; } |
11168 | }; |
11169 | |
11170 | class RandomizeLayoutAttr : public InheritableAttr { |
11171 | public: |
11172 | enum Spelling { |
11173 | GNU_randomize_layout = 0, |
11174 | CXX11_gnu_randomize_layout = 1, |
11175 | C23_gnu_randomize_layout = 2, |
11176 | SpellingNotCalculated = 15 |
11177 | |
11178 | }; |
11179 | |
11180 | // Factory methods |
11181 | static RandomizeLayoutAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
11182 | static RandomizeLayoutAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
11183 | static RandomizeLayoutAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_randomize_layout); |
11184 | static RandomizeLayoutAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_randomize_layout); |
11185 | |
11186 | // Constructors |
11187 | RandomizeLayoutAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
11188 | ); |
11189 | |
11190 | RandomizeLayoutAttr *clone(ASTContext &C) const; |
11191 | void printPretty(raw_ostream &OS, |
11192 | const PrintingPolicy &Policy) const; |
11193 | const char *getSpelling() const; |
11194 | |
11195 | |
11196 | static bool classof(const Attr *A) { return A->getKind() == attr::RandomizeLayout; } |
11197 | }; |
11198 | |
11199 | class ReadOnlyPlacementAttr : public InheritableAttr { |
11200 | public: |
11201 | enum Spelling { |
11202 | GNU_enforce_read_only_placement = 0, |
11203 | CXX11_clang_enforce_read_only_placement = 1, |
11204 | C23_clang_enforce_read_only_placement = 2, |
11205 | SpellingNotCalculated = 15 |
11206 | |
11207 | }; |
11208 | |
11209 | // Factory methods |
11210 | static ReadOnlyPlacementAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
11211 | static ReadOnlyPlacementAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
11212 | static ReadOnlyPlacementAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_enforce_read_only_placement); |
11213 | static ReadOnlyPlacementAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_enforce_read_only_placement); |
11214 | |
11215 | // Constructors |
11216 | ReadOnlyPlacementAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
11217 | ); |
11218 | |
11219 | ReadOnlyPlacementAttr *clone(ASTContext &C) const; |
11220 | void printPretty(raw_ostream &OS, |
11221 | const PrintingPolicy &Policy) const; |
11222 | const char *getSpelling() const; |
11223 | |
11224 | |
11225 | static bool classof(const Attr *A) { return A->getKind() == attr::ReadOnlyPlacement; } |
11226 | }; |
11227 | |
11228 | class RegCallAttr : public InheritableAttr { |
11229 | public: |
11230 | enum Spelling { |
11231 | GNU_regcall = 0, |
11232 | CXX11_gnu_regcall = 1, |
11233 | C23_gnu_regcall = 2, |
11234 | Keyword_regcall = 3, |
11235 | SpellingNotCalculated = 15 |
11236 | |
11237 | }; |
11238 | |
11239 | // Factory methods |
11240 | static RegCallAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
11241 | static RegCallAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
11242 | static RegCallAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_regcall); |
11243 | static RegCallAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_regcall); |
11244 | |
11245 | // Constructors |
11246 | RegCallAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
11247 | ); |
11248 | |
11249 | RegCallAttr *clone(ASTContext &C) const; |
11250 | void printPretty(raw_ostream &OS, |
11251 | const PrintingPolicy &Policy) const; |
11252 | const char *getSpelling() const; |
11253 | |
11254 | |
11255 | static bool classof(const Attr *A) { return A->getKind() == attr::RegCall; } |
11256 | }; |
11257 | |
11258 | class ReinitializesAttr : public InheritableAttr { |
11259 | public: |
11260 | enum Spelling { |
11261 | GNU_reinitializes = 0, |
11262 | CXX11_clang_reinitializes = 1, |
11263 | SpellingNotCalculated = 15 |
11264 | |
11265 | }; |
11266 | |
11267 | // Factory methods |
11268 | static ReinitializesAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
11269 | static ReinitializesAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
11270 | static ReinitializesAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_reinitializes); |
11271 | static ReinitializesAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_reinitializes); |
11272 | |
11273 | // Constructors |
11274 | ReinitializesAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
11275 | ); |
11276 | |
11277 | ReinitializesAttr *clone(ASTContext &C) const; |
11278 | void printPretty(raw_ostream &OS, |
11279 | const PrintingPolicy &Policy) const; |
11280 | const char *getSpelling() const; |
11281 | |
11282 | |
11283 | static bool classof(const Attr *A) { return A->getKind() == attr::Reinitializes; } |
11284 | }; |
11285 | |
11286 | class ReleaseCapabilityAttr : public InheritableAttr { |
11287 | unsigned args_Size; |
11288 | Expr * *args_; |
11289 | |
11290 | public: |
11291 | enum Spelling { |
11292 | GNU_release_capability = 0, |
11293 | CXX11_clang_release_capability = 1, |
11294 | GNU_release_shared_capability = 2, |
11295 | CXX11_clang_release_shared_capability = 3, |
11296 | GNU_release_generic_capability = 4, |
11297 | CXX11_clang_release_generic_capability = 5, |
11298 | GNU_unlock_function = 6, |
11299 | CXX11_clang_unlock_function = 7, |
11300 | SpellingNotCalculated = 15 |
11301 | |
11302 | }; |
11303 | |
11304 | // Factory methods |
11305 | static ReleaseCapabilityAttr *CreateImplicit(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo); |
11306 | static ReleaseCapabilityAttr *Create(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo); |
11307 | static ReleaseCapabilityAttr *CreateImplicit(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, SourceRange Range = {}, Spelling S = GNU_release_capability); |
11308 | static ReleaseCapabilityAttr *Create(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, SourceRange Range = {}, Spelling S = GNU_release_capability); |
11309 | |
11310 | // Constructors |
11311 | ReleaseCapabilityAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
11312 | , Expr * *Args, unsigned ArgsSize |
11313 | ); |
11314 | ReleaseCapabilityAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
11315 | ); |
11316 | |
11317 | ReleaseCapabilityAttr *clone(ASTContext &C) const; |
11318 | void printPretty(raw_ostream &OS, |
11319 | const PrintingPolicy &Policy) const; |
11320 | const char *getSpelling() const; |
11321 | Spelling getSemanticSpelling() const; |
11322 | bool isShared() const { return getAttributeSpellingListIndex() == 2 || |
11323 | getAttributeSpellingListIndex() == 3; } |
11324 | bool isGeneric() const { return getAttributeSpellingListIndex() == 4 || |
11325 | getAttributeSpellingListIndex() == 5 || |
11326 | getAttributeSpellingListIndex() == 6 || |
11327 | getAttributeSpellingListIndex() == 7; } |
11328 | typedef Expr ** args_iterator; |
11329 | args_iterator args_begin() const { return args_; } |
11330 | args_iterator args_end() const { return args_ + args_Size; } |
11331 | unsigned args_size() const { return args_Size; } |
11332 | llvm::iterator_range<args_iterator> args() const { return llvm::make_range(x: args_begin(), y: args_end()); } |
11333 | |
11334 | |
11335 | |
11336 | |
11337 | static bool classof(const Attr *A) { return A->getKind() == attr::ReleaseCapability; } |
11338 | }; |
11339 | |
11340 | class ReleaseHandleAttr : public InheritableParamAttr { |
11341 | unsigned handleTypeLength; |
11342 | char *handleType; |
11343 | |
11344 | public: |
11345 | enum Spelling { |
11346 | GNU_release_handle = 0, |
11347 | CXX11_clang_release_handle = 1, |
11348 | C23_clang_release_handle = 2, |
11349 | SpellingNotCalculated = 15 |
11350 | |
11351 | }; |
11352 | |
11353 | // Factory methods |
11354 | static ReleaseHandleAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef HandleType, const AttributeCommonInfo &CommonInfo); |
11355 | static ReleaseHandleAttr *Create(ASTContext &Ctx, llvm::StringRef HandleType, const AttributeCommonInfo &CommonInfo); |
11356 | static ReleaseHandleAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef HandleType, SourceRange Range = {}, Spelling S = GNU_release_handle); |
11357 | static ReleaseHandleAttr *Create(ASTContext &Ctx, llvm::StringRef HandleType, SourceRange Range = {}, Spelling S = GNU_release_handle); |
11358 | |
11359 | // Constructors |
11360 | ReleaseHandleAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
11361 | , llvm::StringRef HandleType |
11362 | ); |
11363 | |
11364 | ReleaseHandleAttr *clone(ASTContext &C) const; |
11365 | void printPretty(raw_ostream &OS, |
11366 | const PrintingPolicy &Policy) const; |
11367 | const char *getSpelling() const; |
11368 | llvm::StringRef getHandleType() const { |
11369 | return llvm::StringRef(handleType, handleTypeLength); |
11370 | } |
11371 | unsigned getHandleTypeLength() const { |
11372 | return handleTypeLength; |
11373 | } |
11374 | void setHandleType(ASTContext &C, llvm::StringRef S) { |
11375 | handleTypeLength = S.size(); |
11376 | this->handleType = new (C, 1) char [handleTypeLength]; |
11377 | if (!S.empty()) |
11378 | std::memcpy(dest: this->handleType, src: S.data(), n: handleTypeLength); |
11379 | } |
11380 | |
11381 | |
11382 | |
11383 | static bool classof(const Attr *A) { return A->getKind() == attr::ReleaseHandle; } |
11384 | }; |
11385 | |
11386 | class RenderScriptKernelAttr : public Attr { |
11387 | public: |
11388 | // Factory methods |
11389 | static RenderScriptKernelAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
11390 | static RenderScriptKernelAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
11391 | static RenderScriptKernelAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
11392 | static RenderScriptKernelAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
11393 | |
11394 | // Constructors |
11395 | RenderScriptKernelAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
11396 | ); |
11397 | |
11398 | RenderScriptKernelAttr *clone(ASTContext &C) const; |
11399 | void printPretty(raw_ostream &OS, |
11400 | const PrintingPolicy &Policy) const; |
11401 | const char *getSpelling() const; |
11402 | |
11403 | |
11404 | static bool classof(const Attr *A) { return A->getKind() == attr::RenderScriptKernel; } |
11405 | }; |
11406 | |
11407 | class ReqdWorkGroupSizeAttr : public InheritableAttr { |
11408 | unsigned xDim; |
11409 | |
11410 | unsigned yDim; |
11411 | |
11412 | unsigned zDim; |
11413 | |
11414 | public: |
11415 | // Factory methods |
11416 | static ReqdWorkGroupSizeAttr *CreateImplicit(ASTContext &Ctx, unsigned XDim, unsigned YDim, unsigned ZDim, const AttributeCommonInfo &CommonInfo); |
11417 | static ReqdWorkGroupSizeAttr *Create(ASTContext &Ctx, unsigned XDim, unsigned YDim, unsigned ZDim, const AttributeCommonInfo &CommonInfo); |
11418 | static ReqdWorkGroupSizeAttr *CreateImplicit(ASTContext &Ctx, unsigned XDim, unsigned YDim, unsigned ZDim, SourceRange Range = {}); |
11419 | static ReqdWorkGroupSizeAttr *Create(ASTContext &Ctx, unsigned XDim, unsigned YDim, unsigned ZDim, SourceRange Range = {}); |
11420 | |
11421 | // Constructors |
11422 | ReqdWorkGroupSizeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
11423 | , unsigned XDim |
11424 | , unsigned YDim |
11425 | , unsigned ZDim |
11426 | ); |
11427 | |
11428 | ReqdWorkGroupSizeAttr *clone(ASTContext &C) const; |
11429 | void printPretty(raw_ostream &OS, |
11430 | const PrintingPolicy &Policy) const; |
11431 | const char *getSpelling() const; |
11432 | unsigned getXDim() const { |
11433 | return xDim; |
11434 | } |
11435 | |
11436 | unsigned getYDim() const { |
11437 | return yDim; |
11438 | } |
11439 | |
11440 | unsigned getZDim() const { |
11441 | return zDim; |
11442 | } |
11443 | |
11444 | |
11445 | |
11446 | static bool classof(const Attr *A) { return A->getKind() == attr::ReqdWorkGroupSize; } |
11447 | }; |
11448 | |
11449 | class RequiresCapabilityAttr : public InheritableAttr { |
11450 | unsigned args_Size; |
11451 | Expr * *args_; |
11452 | |
11453 | public: |
11454 | enum Spelling { |
11455 | GNU_requires_capability = 0, |
11456 | CXX11_clang_requires_capability = 1, |
11457 | GNU_exclusive_locks_required = 2, |
11458 | CXX11_clang_exclusive_locks_required = 3, |
11459 | GNU_requires_shared_capability = 4, |
11460 | CXX11_clang_requires_shared_capability = 5, |
11461 | GNU_shared_locks_required = 6, |
11462 | CXX11_clang_shared_locks_required = 7, |
11463 | SpellingNotCalculated = 15 |
11464 | |
11465 | }; |
11466 | |
11467 | // Factory methods |
11468 | static RequiresCapabilityAttr *CreateImplicit(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo); |
11469 | static RequiresCapabilityAttr *Create(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo); |
11470 | static RequiresCapabilityAttr *CreateImplicit(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, SourceRange Range = {}, Spelling S = GNU_requires_capability); |
11471 | static RequiresCapabilityAttr *Create(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, SourceRange Range = {}, Spelling S = GNU_requires_capability); |
11472 | |
11473 | // Constructors |
11474 | RequiresCapabilityAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
11475 | , Expr * *Args, unsigned ArgsSize |
11476 | ); |
11477 | RequiresCapabilityAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
11478 | ); |
11479 | |
11480 | RequiresCapabilityAttr *clone(ASTContext &C) const; |
11481 | void printPretty(raw_ostream &OS, |
11482 | const PrintingPolicy &Policy) const; |
11483 | const char *getSpelling() const; |
11484 | Spelling getSemanticSpelling() const; |
11485 | bool isShared() const { return getAttributeSpellingListIndex() == 4 || |
11486 | getAttributeSpellingListIndex() == 5 || |
11487 | getAttributeSpellingListIndex() == 6 || |
11488 | getAttributeSpellingListIndex() == 7; } |
11489 | typedef Expr ** args_iterator; |
11490 | args_iterator args_begin() const { return args_; } |
11491 | args_iterator args_end() const { return args_ + args_Size; } |
11492 | unsigned args_size() const { return args_Size; } |
11493 | llvm::iterator_range<args_iterator> args() const { return llvm::make_range(x: args_begin(), y: args_end()); } |
11494 | |
11495 | |
11496 | |
11497 | |
11498 | static bool classof(const Attr *A) { return A->getKind() == attr::RequiresCapability; } |
11499 | }; |
11500 | |
11501 | class RestrictAttr : public InheritableAttr { |
11502 | public: |
11503 | enum Spelling { |
11504 | Declspec_restrict = 0, |
11505 | GNU_malloc = 1, |
11506 | CXX11_gnu_malloc = 2, |
11507 | C23_gnu_malloc = 3, |
11508 | SpellingNotCalculated = 15 |
11509 | |
11510 | }; |
11511 | |
11512 | // Factory methods |
11513 | static RestrictAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
11514 | static RestrictAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
11515 | static RestrictAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = Declspec_restrict); |
11516 | static RestrictAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = Declspec_restrict); |
11517 | |
11518 | // Constructors |
11519 | RestrictAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
11520 | ); |
11521 | |
11522 | RestrictAttr *clone(ASTContext &C) const; |
11523 | void printPretty(raw_ostream &OS, |
11524 | const PrintingPolicy &Policy) const; |
11525 | const char *getSpelling() const; |
11526 | Spelling getSemanticSpelling() const; |
11527 | |
11528 | |
11529 | static bool classof(const Attr *A) { return A->getKind() == attr::Restrict; } |
11530 | }; |
11531 | |
11532 | class RetainAttr : public InheritableAttr { |
11533 | public: |
11534 | enum Spelling { |
11535 | GNU_retain = 0, |
11536 | CXX11_gnu_retain = 1, |
11537 | C23_gnu_retain = 2, |
11538 | SpellingNotCalculated = 15 |
11539 | |
11540 | }; |
11541 | |
11542 | // Factory methods |
11543 | static RetainAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
11544 | static RetainAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
11545 | static RetainAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_retain); |
11546 | static RetainAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_retain); |
11547 | |
11548 | // Constructors |
11549 | RetainAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
11550 | ); |
11551 | |
11552 | RetainAttr *clone(ASTContext &C) const; |
11553 | void printPretty(raw_ostream &OS, |
11554 | const PrintingPolicy &Policy) const; |
11555 | const char *getSpelling() const; |
11556 | |
11557 | |
11558 | static bool classof(const Attr *A) { return A->getKind() == attr::Retain; } |
11559 | }; |
11560 | |
11561 | class ReturnTypestateAttr : public InheritableAttr { |
11562 | public: |
11563 | enum ConsumedState { |
11564 | Unknown, |
11565 | Consumed, |
11566 | Unconsumed |
11567 | }; |
11568 | private: |
11569 | ReturnTypestateAttr::ConsumedState state; |
11570 | |
11571 | public: |
11572 | enum Spelling { |
11573 | GNU_return_typestate = 0, |
11574 | CXX11_clang_return_typestate = 1, |
11575 | SpellingNotCalculated = 15 |
11576 | |
11577 | }; |
11578 | |
11579 | // Factory methods |
11580 | static ReturnTypestateAttr *CreateImplicit(ASTContext &Ctx, ReturnTypestateAttr::ConsumedState State, const AttributeCommonInfo &CommonInfo); |
11581 | static ReturnTypestateAttr *Create(ASTContext &Ctx, ReturnTypestateAttr::ConsumedState State, const AttributeCommonInfo &CommonInfo); |
11582 | static ReturnTypestateAttr *CreateImplicit(ASTContext &Ctx, ReturnTypestateAttr::ConsumedState State, SourceRange Range = {}, Spelling S = GNU_return_typestate); |
11583 | static ReturnTypestateAttr *Create(ASTContext &Ctx, ReturnTypestateAttr::ConsumedState State, SourceRange Range = {}, Spelling S = GNU_return_typestate); |
11584 | |
11585 | // Constructors |
11586 | ReturnTypestateAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
11587 | , ReturnTypestateAttr::ConsumedState State |
11588 | ); |
11589 | |
11590 | ReturnTypestateAttr *clone(ASTContext &C) const; |
11591 | void printPretty(raw_ostream &OS, |
11592 | const PrintingPolicy &Policy) const; |
11593 | const char *getSpelling() const; |
11594 | ReturnTypestateAttr::ConsumedState getState() const { |
11595 | return state; |
11596 | } |
11597 | |
11598 | static bool ConvertStrToConsumedState(StringRef Val, ReturnTypestateAttr::ConsumedState &Out); |
11599 | static const char *ConvertConsumedStateToStr(ReturnTypestateAttr::ConsumedState Val); |
11600 | |
11601 | |
11602 | static bool classof(const Attr *A) { return A->getKind() == attr::ReturnTypestate; } |
11603 | }; |
11604 | |
11605 | class ReturnsNonNullAttr : public InheritableAttr { |
11606 | public: |
11607 | enum Spelling { |
11608 | GNU_returns_nonnull = 0, |
11609 | CXX11_gnu_returns_nonnull = 1, |
11610 | C23_gnu_returns_nonnull = 2, |
11611 | SpellingNotCalculated = 15 |
11612 | |
11613 | }; |
11614 | |
11615 | // Factory methods |
11616 | static ReturnsNonNullAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
11617 | static ReturnsNonNullAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
11618 | static ReturnsNonNullAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_returns_nonnull); |
11619 | static ReturnsNonNullAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_returns_nonnull); |
11620 | |
11621 | // Constructors |
11622 | ReturnsNonNullAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
11623 | ); |
11624 | |
11625 | ReturnsNonNullAttr *clone(ASTContext &C) const; |
11626 | void printPretty(raw_ostream &OS, |
11627 | const PrintingPolicy &Policy) const; |
11628 | const char *getSpelling() const; |
11629 | |
11630 | |
11631 | static bool classof(const Attr *A) { return A->getKind() == attr::ReturnsNonNull; } |
11632 | }; |
11633 | |
11634 | class ReturnsTwiceAttr : public InheritableAttr { |
11635 | public: |
11636 | enum Spelling { |
11637 | GNU_returns_twice = 0, |
11638 | CXX11_gnu_returns_twice = 1, |
11639 | C23_gnu_returns_twice = 2, |
11640 | SpellingNotCalculated = 15 |
11641 | |
11642 | }; |
11643 | |
11644 | // Factory methods |
11645 | static ReturnsTwiceAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
11646 | static ReturnsTwiceAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
11647 | static ReturnsTwiceAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_returns_twice); |
11648 | static ReturnsTwiceAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_returns_twice); |
11649 | |
11650 | // Constructors |
11651 | ReturnsTwiceAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
11652 | ); |
11653 | |
11654 | ReturnsTwiceAttr *clone(ASTContext &C) const; |
11655 | void printPretty(raw_ostream &OS, |
11656 | const PrintingPolicy &Policy) const; |
11657 | const char *getSpelling() const; |
11658 | |
11659 | |
11660 | static bool classof(const Attr *A) { return A->getKind() == attr::ReturnsTwice; } |
11661 | }; |
11662 | |
11663 | class SPtrAttr : public TypeAttr { |
11664 | public: |
11665 | // Factory methods |
11666 | static SPtrAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
11667 | static SPtrAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
11668 | static SPtrAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
11669 | static SPtrAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
11670 | |
11671 | // Constructors |
11672 | SPtrAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
11673 | ); |
11674 | |
11675 | SPtrAttr *clone(ASTContext &C) const; |
11676 | void printPretty(raw_ostream &OS, |
11677 | const PrintingPolicy &Policy) const; |
11678 | const char *getSpelling() const; |
11679 | |
11680 | |
11681 | static bool classof(const Attr *A) { return A->getKind() == attr::SPtr; } |
11682 | }; |
11683 | |
11684 | class SYCLKernelAttr : public InheritableAttr { |
11685 | public: |
11686 | enum Spelling { |
11687 | GNU_sycl_kernel = 0, |
11688 | CXX11_clang_sycl_kernel = 1, |
11689 | C23_clang_sycl_kernel = 2, |
11690 | SpellingNotCalculated = 15 |
11691 | |
11692 | }; |
11693 | |
11694 | // Factory methods |
11695 | static SYCLKernelAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
11696 | static SYCLKernelAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
11697 | static SYCLKernelAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_sycl_kernel); |
11698 | static SYCLKernelAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_sycl_kernel); |
11699 | |
11700 | // Constructors |
11701 | SYCLKernelAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
11702 | ); |
11703 | |
11704 | SYCLKernelAttr *clone(ASTContext &C) const; |
11705 | void printPretty(raw_ostream &OS, |
11706 | const PrintingPolicy &Policy) const; |
11707 | const char *getSpelling() const; |
11708 | |
11709 | |
11710 | static bool classof(const Attr *A) { return A->getKind() == attr::SYCLKernel; } |
11711 | }; |
11712 | |
11713 | class SYCLSpecialClassAttr : public InheritableAttr { |
11714 | public: |
11715 | enum Spelling { |
11716 | GNU_sycl_special_class = 0, |
11717 | CXX11_clang_sycl_special_class = 1, |
11718 | C23_clang_sycl_special_class = 2, |
11719 | SpellingNotCalculated = 15 |
11720 | |
11721 | }; |
11722 | |
11723 | // Factory methods |
11724 | static SYCLSpecialClassAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
11725 | static SYCLSpecialClassAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
11726 | static SYCLSpecialClassAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_sycl_special_class); |
11727 | static SYCLSpecialClassAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_sycl_special_class); |
11728 | |
11729 | // Constructors |
11730 | SYCLSpecialClassAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
11731 | ); |
11732 | |
11733 | SYCLSpecialClassAttr *clone(ASTContext &C) const; |
11734 | void printPretty(raw_ostream &OS, |
11735 | const PrintingPolicy &Policy) const; |
11736 | const char *getSpelling() const; |
11737 | |
11738 | |
11739 | static bool classof(const Attr *A) { return A->getKind() == attr::SYCLSpecialClass; } |
11740 | }; |
11741 | |
11742 | class ScopedLockableAttr : public InheritableAttr { |
11743 | public: |
11744 | enum Spelling { |
11745 | GNU_scoped_lockable = 0, |
11746 | CXX11_clang_scoped_lockable = 1, |
11747 | SpellingNotCalculated = 15 |
11748 | |
11749 | }; |
11750 | |
11751 | // Factory methods |
11752 | static ScopedLockableAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
11753 | static ScopedLockableAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
11754 | static ScopedLockableAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_scoped_lockable); |
11755 | static ScopedLockableAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_scoped_lockable); |
11756 | |
11757 | // Constructors |
11758 | ScopedLockableAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
11759 | ); |
11760 | |
11761 | ScopedLockableAttr *clone(ASTContext &C) const; |
11762 | void printPretty(raw_ostream &OS, |
11763 | const PrintingPolicy &Policy) const; |
11764 | const char *getSpelling() const; |
11765 | |
11766 | |
11767 | static bool classof(const Attr *A) { return A->getKind() == attr::ScopedLockable; } |
11768 | }; |
11769 | |
11770 | class SectionAttr : public InheritableAttr { |
11771 | unsigned nameLength; |
11772 | char *name; |
11773 | |
11774 | public: |
11775 | enum Spelling { |
11776 | GNU_section = 0, |
11777 | CXX11_gnu_section = 1, |
11778 | C23_gnu_section = 2, |
11779 | Declspec_allocate = 3, |
11780 | SpellingNotCalculated = 15 |
11781 | |
11782 | }; |
11783 | |
11784 | // Factory methods |
11785 | static SectionAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Name, const AttributeCommonInfo &CommonInfo); |
11786 | static SectionAttr *Create(ASTContext &Ctx, llvm::StringRef Name, const AttributeCommonInfo &CommonInfo); |
11787 | static SectionAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Name, SourceRange Range = {}, Spelling S = GNU_section); |
11788 | static SectionAttr *Create(ASTContext &Ctx, llvm::StringRef Name, SourceRange Range = {}, Spelling S = GNU_section); |
11789 | |
11790 | // Constructors |
11791 | SectionAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
11792 | , llvm::StringRef Name |
11793 | ); |
11794 | |
11795 | SectionAttr *clone(ASTContext &C) const; |
11796 | void printPretty(raw_ostream &OS, |
11797 | const PrintingPolicy &Policy) const; |
11798 | const char *getSpelling() const; |
11799 | Spelling getSemanticSpelling() const; |
11800 | llvm::StringRef getName() const { |
11801 | return llvm::StringRef(name, nameLength); |
11802 | } |
11803 | unsigned getNameLength() const { |
11804 | return nameLength; |
11805 | } |
11806 | void setName(ASTContext &C, llvm::StringRef S) { |
11807 | nameLength = S.size(); |
11808 | this->name = new (C, 1) char [nameLength]; |
11809 | if (!S.empty()) |
11810 | std::memcpy(dest: this->name, src: S.data(), n: nameLength); |
11811 | } |
11812 | |
11813 | |
11814 | |
11815 | static bool classof(const Attr *A) { return A->getKind() == attr::Section; } |
11816 | }; |
11817 | |
11818 | class SelectAnyAttr : public InheritableAttr { |
11819 | public: |
11820 | enum Spelling { |
11821 | Declspec_selectany = 0, |
11822 | GNU_selectany = 1, |
11823 | CXX11_gnu_selectany = 2, |
11824 | C23_gnu_selectany = 3, |
11825 | SpellingNotCalculated = 15 |
11826 | |
11827 | }; |
11828 | |
11829 | // Factory methods |
11830 | static SelectAnyAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
11831 | static SelectAnyAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
11832 | static SelectAnyAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = Declspec_selectany); |
11833 | static SelectAnyAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = Declspec_selectany); |
11834 | |
11835 | // Constructors |
11836 | SelectAnyAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
11837 | ); |
11838 | |
11839 | SelectAnyAttr *clone(ASTContext &C) const; |
11840 | void printPretty(raw_ostream &OS, |
11841 | const PrintingPolicy &Policy) const; |
11842 | const char *getSpelling() const; |
11843 | |
11844 | |
11845 | static bool classof(const Attr *A) { return A->getKind() == attr::SelectAny; } |
11846 | }; |
11847 | |
11848 | class SentinelAttr : public InheritableAttr { |
11849 | int sentinel; |
11850 | |
11851 | int nullPos; |
11852 | |
11853 | public: |
11854 | enum Spelling { |
11855 | GNU_sentinel = 0, |
11856 | CXX11_gnu_sentinel = 1, |
11857 | C23_gnu_sentinel = 2, |
11858 | SpellingNotCalculated = 15 |
11859 | |
11860 | }; |
11861 | |
11862 | // Factory methods |
11863 | static SentinelAttr *CreateImplicit(ASTContext &Ctx, int Sentinel, int NullPos, const AttributeCommonInfo &CommonInfo); |
11864 | static SentinelAttr *Create(ASTContext &Ctx, int Sentinel, int NullPos, const AttributeCommonInfo &CommonInfo); |
11865 | static SentinelAttr *CreateImplicit(ASTContext &Ctx, int Sentinel, int NullPos, SourceRange Range = {}, Spelling S = GNU_sentinel); |
11866 | static SentinelAttr *Create(ASTContext &Ctx, int Sentinel, int NullPos, SourceRange Range = {}, Spelling S = GNU_sentinel); |
11867 | |
11868 | // Constructors |
11869 | SentinelAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
11870 | , int Sentinel |
11871 | , int NullPos |
11872 | ); |
11873 | SentinelAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
11874 | ); |
11875 | |
11876 | SentinelAttr *clone(ASTContext &C) const; |
11877 | void printPretty(raw_ostream &OS, |
11878 | const PrintingPolicy &Policy) const; |
11879 | const char *getSpelling() const; |
11880 | int getSentinel() const { |
11881 | return sentinel; |
11882 | } |
11883 | |
11884 | static const int DefaultSentinel = 0; |
11885 | |
11886 | int getNullPos() const { |
11887 | return nullPos; |
11888 | } |
11889 | |
11890 | static const int DefaultNullPos = 0; |
11891 | |
11892 | |
11893 | |
11894 | static bool classof(const Attr *A) { return A->getKind() == attr::Sentinel; } |
11895 | }; |
11896 | |
11897 | class SetTypestateAttr : public InheritableAttr { |
11898 | public: |
11899 | enum ConsumedState { |
11900 | Unknown, |
11901 | Consumed, |
11902 | Unconsumed |
11903 | }; |
11904 | private: |
11905 | SetTypestateAttr::ConsumedState newState; |
11906 | |
11907 | public: |
11908 | enum Spelling { |
11909 | GNU_set_typestate = 0, |
11910 | CXX11_clang_set_typestate = 1, |
11911 | SpellingNotCalculated = 15 |
11912 | |
11913 | }; |
11914 | |
11915 | // Factory methods |
11916 | static SetTypestateAttr *CreateImplicit(ASTContext &Ctx, SetTypestateAttr::ConsumedState NewState, const AttributeCommonInfo &CommonInfo); |
11917 | static SetTypestateAttr *Create(ASTContext &Ctx, SetTypestateAttr::ConsumedState NewState, const AttributeCommonInfo &CommonInfo); |
11918 | static SetTypestateAttr *CreateImplicit(ASTContext &Ctx, SetTypestateAttr::ConsumedState NewState, SourceRange Range = {}, Spelling S = GNU_set_typestate); |
11919 | static SetTypestateAttr *Create(ASTContext &Ctx, SetTypestateAttr::ConsumedState NewState, SourceRange Range = {}, Spelling S = GNU_set_typestate); |
11920 | |
11921 | // Constructors |
11922 | SetTypestateAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
11923 | , SetTypestateAttr::ConsumedState NewState |
11924 | ); |
11925 | |
11926 | SetTypestateAttr *clone(ASTContext &C) const; |
11927 | void printPretty(raw_ostream &OS, |
11928 | const PrintingPolicy &Policy) const; |
11929 | const char *getSpelling() const; |
11930 | SetTypestateAttr::ConsumedState getNewState() const { |
11931 | return newState; |
11932 | } |
11933 | |
11934 | static bool ConvertStrToConsumedState(StringRef Val, SetTypestateAttr::ConsumedState &Out); |
11935 | static const char *ConvertConsumedStateToStr(SetTypestateAttr::ConsumedState Val); |
11936 | |
11937 | |
11938 | static bool classof(const Attr *A) { return A->getKind() == attr::SetTypestate; } |
11939 | }; |
11940 | |
11941 | class SharedTrylockFunctionAttr : public InheritableAttr { |
11942 | Expr * successValue; |
11943 | |
11944 | unsigned args_Size; |
11945 | Expr * *args_; |
11946 | |
11947 | public: |
11948 | // Factory methods |
11949 | static SharedTrylockFunctionAttr *CreateImplicit(ASTContext &Ctx, Expr * SuccessValue, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo); |
11950 | static SharedTrylockFunctionAttr *Create(ASTContext &Ctx, Expr * SuccessValue, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo); |
11951 | static SharedTrylockFunctionAttr *CreateImplicit(ASTContext &Ctx, Expr * SuccessValue, Expr * *Args, unsigned ArgsSize, SourceRange Range = {}); |
11952 | static SharedTrylockFunctionAttr *Create(ASTContext &Ctx, Expr * SuccessValue, Expr * *Args, unsigned ArgsSize, SourceRange Range = {}); |
11953 | |
11954 | // Constructors |
11955 | SharedTrylockFunctionAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
11956 | , Expr * SuccessValue |
11957 | , Expr * *Args, unsigned ArgsSize |
11958 | ); |
11959 | SharedTrylockFunctionAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
11960 | , Expr * SuccessValue |
11961 | ); |
11962 | |
11963 | SharedTrylockFunctionAttr *clone(ASTContext &C) const; |
11964 | void printPretty(raw_ostream &OS, |
11965 | const PrintingPolicy &Policy) const; |
11966 | const char *getSpelling() const; |
11967 | Expr * getSuccessValue() const { |
11968 | return successValue; |
11969 | } |
11970 | |
11971 | typedef Expr ** args_iterator; |
11972 | args_iterator args_begin() const { return args_; } |
11973 | args_iterator args_end() const { return args_ + args_Size; } |
11974 | unsigned args_size() const { return args_Size; } |
11975 | llvm::iterator_range<args_iterator> args() const { return llvm::make_range(x: args_begin(), y: args_end()); } |
11976 | |
11977 | |
11978 | |
11979 | |
11980 | static bool classof(const Attr *A) { return A->getKind() == attr::SharedTrylockFunction; } |
11981 | }; |
11982 | |
11983 | class SizedByAttr : public InheritableAttr { |
11984 | Expr * size; |
11985 | |
11986 | int nestedLevel; |
11987 | |
11988 | public: |
11989 | enum Spelling { |
11990 | GNU_sized_by = 0, |
11991 | CXX11_clang_sized_by = 1, |
11992 | C23_clang_sized_by = 2, |
11993 | SpellingNotCalculated = 15 |
11994 | |
11995 | }; |
11996 | |
11997 | // Factory methods |
11998 | static SizedByAttr *CreateImplicit(ASTContext &Ctx, Expr * Size, int NestedLevel, const AttributeCommonInfo &CommonInfo); |
11999 | static SizedByAttr *Create(ASTContext &Ctx, Expr * Size, int NestedLevel, const AttributeCommonInfo &CommonInfo); |
12000 | static SizedByAttr *CreateImplicit(ASTContext &Ctx, Expr * Size, int NestedLevel, SourceRange Range = {}, Spelling S = GNU_sized_by); |
12001 | static SizedByAttr *Create(ASTContext &Ctx, Expr * Size, int NestedLevel, SourceRange Range = {}, Spelling S = GNU_sized_by); |
12002 | |
12003 | // Constructors |
12004 | SizedByAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
12005 | , Expr * Size |
12006 | , int NestedLevel |
12007 | ); |
12008 | SizedByAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
12009 | , Expr * Size |
12010 | ); |
12011 | |
12012 | SizedByAttr *clone(ASTContext &C) const; |
12013 | void printPretty(raw_ostream &OS, |
12014 | const PrintingPolicy &Policy) const; |
12015 | const char *getSpelling() const; |
12016 | Expr * getSize() const { |
12017 | return size; |
12018 | } |
12019 | |
12020 | int getNestedLevel() const { |
12021 | return nestedLevel; |
12022 | } |
12023 | |
12024 | |
12025 | |
12026 | static bool classof(const Attr *A) { return A->getKind() == attr::SizedBy; } |
12027 | }; |
12028 | |
12029 | class SizedByOrNullAttr : public InheritableAttr { |
12030 | Expr * size; |
12031 | |
12032 | int nestedLevel; |
12033 | |
12034 | public: |
12035 | enum Spelling { |
12036 | GNU_sized_by_or_null = 0, |
12037 | CXX11_clang_sized_by_or_null = 1, |
12038 | C23_clang_sized_by_or_null = 2, |
12039 | SpellingNotCalculated = 15 |
12040 | |
12041 | }; |
12042 | |
12043 | // Factory methods |
12044 | static SizedByOrNullAttr *CreateImplicit(ASTContext &Ctx, Expr * Size, int NestedLevel, const AttributeCommonInfo &CommonInfo); |
12045 | static SizedByOrNullAttr *Create(ASTContext &Ctx, Expr * Size, int NestedLevel, const AttributeCommonInfo &CommonInfo); |
12046 | static SizedByOrNullAttr *CreateImplicit(ASTContext &Ctx, Expr * Size, int NestedLevel, SourceRange Range = {}, Spelling S = GNU_sized_by_or_null); |
12047 | static SizedByOrNullAttr *Create(ASTContext &Ctx, Expr * Size, int NestedLevel, SourceRange Range = {}, Spelling S = GNU_sized_by_or_null); |
12048 | |
12049 | // Constructors |
12050 | SizedByOrNullAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
12051 | , Expr * Size |
12052 | , int NestedLevel |
12053 | ); |
12054 | SizedByOrNullAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
12055 | , Expr * Size |
12056 | ); |
12057 | |
12058 | SizedByOrNullAttr *clone(ASTContext &C) const; |
12059 | void printPretty(raw_ostream &OS, |
12060 | const PrintingPolicy &Policy) const; |
12061 | const char *getSpelling() const; |
12062 | Expr * getSize() const { |
12063 | return size; |
12064 | } |
12065 | |
12066 | int getNestedLevel() const { |
12067 | return nestedLevel; |
12068 | } |
12069 | |
12070 | |
12071 | |
12072 | static bool classof(const Attr *A) { return A->getKind() == attr::SizedByOrNull; } |
12073 | }; |
12074 | |
12075 | class SpeculativeLoadHardeningAttr : public InheritableAttr { |
12076 | public: |
12077 | enum Spelling { |
12078 | GNU_speculative_load_hardening = 0, |
12079 | CXX11_clang_speculative_load_hardening = 1, |
12080 | C23_clang_speculative_load_hardening = 2, |
12081 | SpellingNotCalculated = 15 |
12082 | |
12083 | }; |
12084 | |
12085 | // Factory methods |
12086 | static SpeculativeLoadHardeningAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
12087 | static SpeculativeLoadHardeningAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
12088 | static SpeculativeLoadHardeningAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_speculative_load_hardening); |
12089 | static SpeculativeLoadHardeningAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_speculative_load_hardening); |
12090 | |
12091 | // Constructors |
12092 | SpeculativeLoadHardeningAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
12093 | ); |
12094 | |
12095 | SpeculativeLoadHardeningAttr *clone(ASTContext &C) const; |
12096 | void printPretty(raw_ostream &OS, |
12097 | const PrintingPolicy &Policy) const; |
12098 | const char *getSpelling() const; |
12099 | |
12100 | |
12101 | static bool classof(const Attr *A) { return A->getKind() == attr::SpeculativeLoadHardening; } |
12102 | }; |
12103 | |
12104 | class StandaloneDebugAttr : public InheritableAttr { |
12105 | public: |
12106 | enum Spelling { |
12107 | GNU_standalone_debug = 0, |
12108 | CXX11_clang_standalone_debug = 1, |
12109 | SpellingNotCalculated = 15 |
12110 | |
12111 | }; |
12112 | |
12113 | // Factory methods |
12114 | static StandaloneDebugAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
12115 | static StandaloneDebugAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
12116 | static StandaloneDebugAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_standalone_debug); |
12117 | static StandaloneDebugAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_standalone_debug); |
12118 | |
12119 | // Constructors |
12120 | StandaloneDebugAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
12121 | ); |
12122 | |
12123 | StandaloneDebugAttr *clone(ASTContext &C) const; |
12124 | void printPretty(raw_ostream &OS, |
12125 | const PrintingPolicy &Policy) const; |
12126 | const char *getSpelling() const; |
12127 | |
12128 | |
12129 | static bool classof(const Attr *A) { return A->getKind() == attr::StandaloneDebug; } |
12130 | }; |
12131 | |
12132 | class StdCallAttr : public InheritableAttr { |
12133 | public: |
12134 | enum Spelling { |
12135 | GNU_stdcall = 0, |
12136 | CXX11_gnu_stdcall = 1, |
12137 | C23_gnu_stdcall = 2, |
12138 | Keyword_stdcall = 3, |
12139 | SpellingNotCalculated = 15 |
12140 | |
12141 | }; |
12142 | |
12143 | // Factory methods |
12144 | static StdCallAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
12145 | static StdCallAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
12146 | static StdCallAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_stdcall); |
12147 | static StdCallAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_stdcall); |
12148 | |
12149 | // Constructors |
12150 | StdCallAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
12151 | ); |
12152 | |
12153 | StdCallAttr *clone(ASTContext &C) const; |
12154 | void printPretty(raw_ostream &OS, |
12155 | const PrintingPolicy &Policy) const; |
12156 | const char *getSpelling() const; |
12157 | |
12158 | |
12159 | static bool classof(const Attr *A) { return A->getKind() == attr::StdCall; } |
12160 | }; |
12161 | |
12162 | class StrictFPAttr : public InheritableAttr { |
12163 | public: |
12164 | // Factory methods |
12165 | static StrictFPAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
12166 | static StrictFPAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
12167 | static StrictFPAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
12168 | static StrictFPAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
12169 | |
12170 | // Constructors |
12171 | StrictFPAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
12172 | ); |
12173 | |
12174 | StrictFPAttr *clone(ASTContext &C) const; |
12175 | void printPretty(raw_ostream &OS, |
12176 | const PrintingPolicy &Policy) const; |
12177 | const char *getSpelling() const; |
12178 | |
12179 | |
12180 | static bool classof(const Attr *A) { return A->getKind() == attr::StrictFP; } |
12181 | }; |
12182 | |
12183 | class StrictGuardStackCheckAttr : public InheritableAttr { |
12184 | public: |
12185 | // Factory methods |
12186 | static StrictGuardStackCheckAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
12187 | static StrictGuardStackCheckAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
12188 | static StrictGuardStackCheckAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
12189 | static StrictGuardStackCheckAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
12190 | |
12191 | // Constructors |
12192 | StrictGuardStackCheckAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
12193 | ); |
12194 | |
12195 | StrictGuardStackCheckAttr *clone(ASTContext &C) const; |
12196 | void printPretty(raw_ostream &OS, |
12197 | const PrintingPolicy &Policy) const; |
12198 | const char *getSpelling() const; |
12199 | |
12200 | |
12201 | static bool classof(const Attr *A) { return A->getKind() == attr::StrictGuardStackCheck; } |
12202 | }; |
12203 | |
12204 | class SuppressAttr : public DeclOrStmtAttr { |
12205 | unsigned diagnosticIdentifiers_Size; |
12206 | StringRef *diagnosticIdentifiers_; |
12207 | |
12208 | public: |
12209 | enum Spelling { |
12210 | CXX11_gsl_suppress = 0, |
12211 | GNU_suppress = 1, |
12212 | CXX11_clang_suppress = 2, |
12213 | C23_clang_suppress = 3, |
12214 | SpellingNotCalculated = 15 |
12215 | |
12216 | }; |
12217 | |
12218 | // Factory methods |
12219 | static SuppressAttr *CreateImplicit(ASTContext &Ctx, StringRef *DiagnosticIdentifiers, unsigned , const AttributeCommonInfo &CommonInfo); |
12220 | static SuppressAttr *Create(ASTContext &Ctx, StringRef *DiagnosticIdentifiers, unsigned , const AttributeCommonInfo &CommonInfo); |
12221 | static SuppressAttr *CreateImplicit(ASTContext &Ctx, StringRef *DiagnosticIdentifiers, unsigned , SourceRange Range = {}, Spelling S = CXX11_gsl_suppress); |
12222 | static SuppressAttr *Create(ASTContext &Ctx, StringRef *DiagnosticIdentifiers, unsigned , SourceRange Range = {}, Spelling S = CXX11_gsl_suppress); |
12223 | |
12224 | // Constructors |
12225 | SuppressAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
12226 | , StringRef *DiagnosticIdentifiers, unsigned |
12227 | ); |
12228 | SuppressAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
12229 | ); |
12230 | |
12231 | SuppressAttr *clone(ASTContext &C) const; |
12232 | void printPretty(raw_ostream &OS, |
12233 | const PrintingPolicy &Policy) const; |
12234 | const char *getSpelling() const; |
12235 | bool isGSL() const { return getAttributeSpellingListIndex() == 0; } |
12236 | typedef StringRef* diagnosticIdentifiers_iterator; |
12237 | diagnosticIdentifiers_iterator diagnosticIdentifiers_begin() const { return diagnosticIdentifiers_; } |
12238 | diagnosticIdentifiers_iterator diagnosticIdentifiers_end() const { return diagnosticIdentifiers_ + diagnosticIdentifiers_Size; } |
12239 | unsigned diagnosticIdentifiers_size() const { return diagnosticIdentifiers_Size; } |
12240 | llvm::iterator_range<diagnosticIdentifiers_iterator> diagnosticIdentifiers() const { return llvm::make_range(x: diagnosticIdentifiers_begin(), y: diagnosticIdentifiers_end()); } |
12241 | |
12242 | |
12243 | |
12244 | |
12245 | static bool classof(const Attr *A) { return A->getKind() == attr::Suppress; } |
12246 | }; |
12247 | |
12248 | class SwiftAsyncAttr : public InheritableAttr { |
12249 | public: |
12250 | enum Kind { |
12251 | None, |
12252 | SwiftPrivate, |
12253 | NotSwiftPrivate |
12254 | }; |
12255 | private: |
12256 | SwiftAsyncAttr::Kind kind; |
12257 | |
12258 | ParamIdx completionHandlerIndex; |
12259 | |
12260 | public: |
12261 | enum Spelling { |
12262 | GNU_swift_async = 0, |
12263 | CXX11_clang_swift_async = 1, |
12264 | C23_clang_swift_async = 2, |
12265 | SpellingNotCalculated = 15 |
12266 | |
12267 | }; |
12268 | |
12269 | // Factory methods |
12270 | static SwiftAsyncAttr *CreateImplicit(ASTContext &Ctx, SwiftAsyncAttr::Kind Kind, ParamIdx CompletionHandlerIndex, const AttributeCommonInfo &CommonInfo); |
12271 | static SwiftAsyncAttr *Create(ASTContext &Ctx, SwiftAsyncAttr::Kind Kind, ParamIdx CompletionHandlerIndex, const AttributeCommonInfo &CommonInfo); |
12272 | static SwiftAsyncAttr *CreateImplicit(ASTContext &Ctx, SwiftAsyncAttr::Kind Kind, ParamIdx CompletionHandlerIndex, SourceRange Range = {}, Spelling S = GNU_swift_async); |
12273 | static SwiftAsyncAttr *Create(ASTContext &Ctx, SwiftAsyncAttr::Kind Kind, ParamIdx CompletionHandlerIndex, SourceRange Range = {}, Spelling S = GNU_swift_async); |
12274 | |
12275 | // Constructors |
12276 | SwiftAsyncAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
12277 | , SwiftAsyncAttr::Kind Kind |
12278 | , ParamIdx CompletionHandlerIndex |
12279 | ); |
12280 | SwiftAsyncAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
12281 | , SwiftAsyncAttr::Kind Kind |
12282 | ); |
12283 | |
12284 | SwiftAsyncAttr *clone(ASTContext &C) const; |
12285 | void printPretty(raw_ostream &OS, |
12286 | const PrintingPolicy &Policy) const; |
12287 | const char *getSpelling() const; |
12288 | SwiftAsyncAttr::Kind getKind() const { |
12289 | return kind; |
12290 | } |
12291 | |
12292 | static bool ConvertStrToKind(StringRef Val, SwiftAsyncAttr::Kind &Out); |
12293 | static const char *ConvertKindToStr(SwiftAsyncAttr::Kind Val); |
12294 | ParamIdx getCompletionHandlerIndex() const { |
12295 | return completionHandlerIndex; |
12296 | } |
12297 | |
12298 | |
12299 | |
12300 | static bool classof(const Attr *A) { return A->getKind() == attr::SwiftAsync; } |
12301 | }; |
12302 | |
12303 | class SwiftAsyncCallAttr : public InheritableAttr { |
12304 | public: |
12305 | enum Spelling { |
12306 | GNU_swiftasynccall = 0, |
12307 | CXX11_clang_swiftasynccall = 1, |
12308 | C23_clang_swiftasynccall = 2, |
12309 | SpellingNotCalculated = 15 |
12310 | |
12311 | }; |
12312 | |
12313 | // Factory methods |
12314 | static SwiftAsyncCallAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
12315 | static SwiftAsyncCallAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
12316 | static SwiftAsyncCallAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_swiftasynccall); |
12317 | static SwiftAsyncCallAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_swiftasynccall); |
12318 | |
12319 | // Constructors |
12320 | SwiftAsyncCallAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
12321 | ); |
12322 | |
12323 | SwiftAsyncCallAttr *clone(ASTContext &C) const; |
12324 | void printPretty(raw_ostream &OS, |
12325 | const PrintingPolicy &Policy) const; |
12326 | const char *getSpelling() const; |
12327 | |
12328 | |
12329 | static bool classof(const Attr *A) { return A->getKind() == attr::SwiftAsyncCall; } |
12330 | }; |
12331 | |
12332 | class SwiftAsyncContextAttr : public ParameterABIAttr { |
12333 | public: |
12334 | enum Spelling { |
12335 | GNU_swift_async_context = 0, |
12336 | CXX11_clang_swift_async_context = 1, |
12337 | C23_clang_swift_async_context = 2, |
12338 | SpellingNotCalculated = 15 |
12339 | |
12340 | }; |
12341 | |
12342 | // Factory methods |
12343 | static SwiftAsyncContextAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
12344 | static SwiftAsyncContextAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
12345 | static SwiftAsyncContextAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_swift_async_context); |
12346 | static SwiftAsyncContextAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_swift_async_context); |
12347 | |
12348 | // Constructors |
12349 | SwiftAsyncContextAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
12350 | ); |
12351 | |
12352 | SwiftAsyncContextAttr *clone(ASTContext &C) const; |
12353 | void printPretty(raw_ostream &OS, |
12354 | const PrintingPolicy &Policy) const; |
12355 | const char *getSpelling() const; |
12356 | |
12357 | |
12358 | static bool classof(const Attr *A) { return A->getKind() == attr::SwiftAsyncContext; } |
12359 | }; |
12360 | |
12361 | class SwiftAsyncErrorAttr : public InheritableAttr { |
12362 | public: |
12363 | enum ConventionKind { |
12364 | None, |
12365 | NonNullError, |
12366 | ZeroArgument, |
12367 | NonZeroArgument |
12368 | }; |
12369 | private: |
12370 | SwiftAsyncErrorAttr::ConventionKind convention; |
12371 | |
12372 | unsigned handlerParamIdx; |
12373 | |
12374 | public: |
12375 | enum Spelling { |
12376 | GNU_swift_async_error = 0, |
12377 | CXX11_clang_swift_async_error = 1, |
12378 | C23_clang_swift_async_error = 2, |
12379 | SpellingNotCalculated = 15 |
12380 | |
12381 | }; |
12382 | |
12383 | // Factory methods |
12384 | static SwiftAsyncErrorAttr *CreateImplicit(ASTContext &Ctx, SwiftAsyncErrorAttr::ConventionKind Convention, unsigned HandlerParamIdx, const AttributeCommonInfo &CommonInfo); |
12385 | static SwiftAsyncErrorAttr *Create(ASTContext &Ctx, SwiftAsyncErrorAttr::ConventionKind Convention, unsigned HandlerParamIdx, const AttributeCommonInfo &CommonInfo); |
12386 | static SwiftAsyncErrorAttr *CreateImplicit(ASTContext &Ctx, SwiftAsyncErrorAttr::ConventionKind Convention, unsigned HandlerParamIdx, SourceRange Range = {}, Spelling S = GNU_swift_async_error); |
12387 | static SwiftAsyncErrorAttr *Create(ASTContext &Ctx, SwiftAsyncErrorAttr::ConventionKind Convention, unsigned HandlerParamIdx, SourceRange Range = {}, Spelling S = GNU_swift_async_error); |
12388 | |
12389 | // Constructors |
12390 | SwiftAsyncErrorAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
12391 | , SwiftAsyncErrorAttr::ConventionKind Convention |
12392 | , unsigned HandlerParamIdx |
12393 | ); |
12394 | SwiftAsyncErrorAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
12395 | , SwiftAsyncErrorAttr::ConventionKind Convention |
12396 | ); |
12397 | |
12398 | SwiftAsyncErrorAttr *clone(ASTContext &C) const; |
12399 | void printPretty(raw_ostream &OS, |
12400 | const PrintingPolicy &Policy) const; |
12401 | const char *getSpelling() const; |
12402 | SwiftAsyncErrorAttr::ConventionKind getConvention() const { |
12403 | return convention; |
12404 | } |
12405 | |
12406 | static bool ConvertStrToConventionKind(StringRef Val, SwiftAsyncErrorAttr::ConventionKind &Out); |
12407 | static const char *ConvertConventionKindToStr(SwiftAsyncErrorAttr::ConventionKind Val); |
12408 | unsigned getHandlerParamIdx() const { |
12409 | return handlerParamIdx; |
12410 | } |
12411 | |
12412 | |
12413 | |
12414 | static bool classof(const Attr *A) { return A->getKind() == attr::SwiftAsyncError; } |
12415 | }; |
12416 | |
12417 | class SwiftAsyncNameAttr : public InheritableAttr { |
12418 | unsigned nameLength; |
12419 | char *name; |
12420 | |
12421 | public: |
12422 | // Factory methods |
12423 | static SwiftAsyncNameAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Name, const AttributeCommonInfo &CommonInfo); |
12424 | static SwiftAsyncNameAttr *Create(ASTContext &Ctx, llvm::StringRef Name, const AttributeCommonInfo &CommonInfo); |
12425 | static SwiftAsyncNameAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Name, SourceRange Range = {}); |
12426 | static SwiftAsyncNameAttr *Create(ASTContext &Ctx, llvm::StringRef Name, SourceRange Range = {}); |
12427 | |
12428 | // Constructors |
12429 | SwiftAsyncNameAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
12430 | , llvm::StringRef Name |
12431 | ); |
12432 | |
12433 | SwiftAsyncNameAttr *clone(ASTContext &C) const; |
12434 | void printPretty(raw_ostream &OS, |
12435 | const PrintingPolicy &Policy) const; |
12436 | const char *getSpelling() const; |
12437 | llvm::StringRef getName() const { |
12438 | return llvm::StringRef(name, nameLength); |
12439 | } |
12440 | unsigned getNameLength() const { |
12441 | return nameLength; |
12442 | } |
12443 | void setName(ASTContext &C, llvm::StringRef S) { |
12444 | nameLength = S.size(); |
12445 | this->name = new (C, 1) char [nameLength]; |
12446 | if (!S.empty()) |
12447 | std::memcpy(dest: this->name, src: S.data(), n: nameLength); |
12448 | } |
12449 | |
12450 | |
12451 | |
12452 | static bool classof(const Attr *A) { return A->getKind() == attr::SwiftAsyncName; } |
12453 | }; |
12454 | |
12455 | class SwiftAttrAttr : public InheritableAttr { |
12456 | unsigned attributeLength; |
12457 | char *attribute; |
12458 | |
12459 | public: |
12460 | // Factory methods |
12461 | static SwiftAttrAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Attribute, const AttributeCommonInfo &CommonInfo); |
12462 | static SwiftAttrAttr *Create(ASTContext &Ctx, llvm::StringRef Attribute, const AttributeCommonInfo &CommonInfo); |
12463 | static SwiftAttrAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Attribute, SourceRange Range = {}); |
12464 | static SwiftAttrAttr *Create(ASTContext &Ctx, llvm::StringRef Attribute, SourceRange Range = {}); |
12465 | |
12466 | // Constructors |
12467 | SwiftAttrAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
12468 | , llvm::StringRef Attribute |
12469 | ); |
12470 | |
12471 | SwiftAttrAttr *clone(ASTContext &C) const; |
12472 | void printPretty(raw_ostream &OS, |
12473 | const PrintingPolicy &Policy) const; |
12474 | const char *getSpelling() const; |
12475 | llvm::StringRef getAttribute() const { |
12476 | return llvm::StringRef(attribute, attributeLength); |
12477 | } |
12478 | unsigned getAttributeLength() const { |
12479 | return attributeLength; |
12480 | } |
12481 | void setAttribute(ASTContext &C, llvm::StringRef S) { |
12482 | attributeLength = S.size(); |
12483 | this->attribute = new (C, 1) char [attributeLength]; |
12484 | if (!S.empty()) |
12485 | std::memcpy(dest: this->attribute, src: S.data(), n: attributeLength); |
12486 | } |
12487 | |
12488 | |
12489 | |
12490 | static bool classof(const Attr *A) { return A->getKind() == attr::SwiftAttr; } |
12491 | }; |
12492 | |
12493 | class SwiftBridgeAttr : public InheritableAttr { |
12494 | unsigned swiftTypeLength; |
12495 | char *swiftType; |
12496 | |
12497 | public: |
12498 | // Factory methods |
12499 | static SwiftBridgeAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef SwiftType, const AttributeCommonInfo &CommonInfo); |
12500 | static SwiftBridgeAttr *Create(ASTContext &Ctx, llvm::StringRef SwiftType, const AttributeCommonInfo &CommonInfo); |
12501 | static SwiftBridgeAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef SwiftType, SourceRange Range = {}); |
12502 | static SwiftBridgeAttr *Create(ASTContext &Ctx, llvm::StringRef SwiftType, SourceRange Range = {}); |
12503 | |
12504 | // Constructors |
12505 | SwiftBridgeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
12506 | , llvm::StringRef SwiftType |
12507 | ); |
12508 | |
12509 | SwiftBridgeAttr *clone(ASTContext &C) const; |
12510 | void printPretty(raw_ostream &OS, |
12511 | const PrintingPolicy &Policy) const; |
12512 | const char *getSpelling() const; |
12513 | llvm::StringRef getSwiftType() const { |
12514 | return llvm::StringRef(swiftType, swiftTypeLength); |
12515 | } |
12516 | unsigned getSwiftTypeLength() const { |
12517 | return swiftTypeLength; |
12518 | } |
12519 | void setSwiftType(ASTContext &C, llvm::StringRef S) { |
12520 | swiftTypeLength = S.size(); |
12521 | this->swiftType = new (C, 1) char [swiftTypeLength]; |
12522 | if (!S.empty()) |
12523 | std::memcpy(dest: this->swiftType, src: S.data(), n: swiftTypeLength); |
12524 | } |
12525 | |
12526 | |
12527 | |
12528 | static bool classof(const Attr *A) { return A->getKind() == attr::SwiftBridge; } |
12529 | }; |
12530 | |
12531 | class SwiftBridgedTypedefAttr : public InheritableAttr { |
12532 | public: |
12533 | // Factory methods |
12534 | static SwiftBridgedTypedefAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
12535 | static SwiftBridgedTypedefAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
12536 | static SwiftBridgedTypedefAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
12537 | static SwiftBridgedTypedefAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
12538 | |
12539 | // Constructors |
12540 | SwiftBridgedTypedefAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
12541 | ); |
12542 | |
12543 | SwiftBridgedTypedefAttr *clone(ASTContext &C) const; |
12544 | void printPretty(raw_ostream &OS, |
12545 | const PrintingPolicy &Policy) const; |
12546 | const char *getSpelling() const; |
12547 | |
12548 | |
12549 | static bool classof(const Attr *A) { return A->getKind() == attr::SwiftBridgedTypedef; } |
12550 | }; |
12551 | |
12552 | class SwiftCallAttr : public InheritableAttr { |
12553 | public: |
12554 | enum Spelling { |
12555 | GNU_swiftcall = 0, |
12556 | CXX11_clang_swiftcall = 1, |
12557 | C23_clang_swiftcall = 2, |
12558 | SpellingNotCalculated = 15 |
12559 | |
12560 | }; |
12561 | |
12562 | // Factory methods |
12563 | static SwiftCallAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
12564 | static SwiftCallAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
12565 | static SwiftCallAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_swiftcall); |
12566 | static SwiftCallAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_swiftcall); |
12567 | |
12568 | // Constructors |
12569 | SwiftCallAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
12570 | ); |
12571 | |
12572 | SwiftCallAttr *clone(ASTContext &C) const; |
12573 | void printPretty(raw_ostream &OS, |
12574 | const PrintingPolicy &Policy) const; |
12575 | const char *getSpelling() const; |
12576 | |
12577 | |
12578 | static bool classof(const Attr *A) { return A->getKind() == attr::SwiftCall; } |
12579 | }; |
12580 | |
12581 | class SwiftContextAttr : public ParameterABIAttr { |
12582 | public: |
12583 | enum Spelling { |
12584 | GNU_swift_context = 0, |
12585 | CXX11_clang_swift_context = 1, |
12586 | C23_clang_swift_context = 2, |
12587 | SpellingNotCalculated = 15 |
12588 | |
12589 | }; |
12590 | |
12591 | // Factory methods |
12592 | static SwiftContextAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
12593 | static SwiftContextAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
12594 | static SwiftContextAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_swift_context); |
12595 | static SwiftContextAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_swift_context); |
12596 | |
12597 | // Constructors |
12598 | SwiftContextAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
12599 | ); |
12600 | |
12601 | SwiftContextAttr *clone(ASTContext &C) const; |
12602 | void printPretty(raw_ostream &OS, |
12603 | const PrintingPolicy &Policy) const; |
12604 | const char *getSpelling() const; |
12605 | |
12606 | |
12607 | static bool classof(const Attr *A) { return A->getKind() == attr::SwiftContext; } |
12608 | }; |
12609 | |
12610 | class SwiftErrorAttr : public InheritableAttr { |
12611 | public: |
12612 | enum ConventionKind { |
12613 | None, |
12614 | NonNullError, |
12615 | NullResult, |
12616 | ZeroResult, |
12617 | NonZeroResult |
12618 | }; |
12619 | private: |
12620 | SwiftErrorAttr::ConventionKind convention; |
12621 | |
12622 | public: |
12623 | // Factory methods |
12624 | static SwiftErrorAttr *CreateImplicit(ASTContext &Ctx, SwiftErrorAttr::ConventionKind Convention, const AttributeCommonInfo &CommonInfo); |
12625 | static SwiftErrorAttr *Create(ASTContext &Ctx, SwiftErrorAttr::ConventionKind Convention, const AttributeCommonInfo &CommonInfo); |
12626 | static SwiftErrorAttr *CreateImplicit(ASTContext &Ctx, SwiftErrorAttr::ConventionKind Convention, SourceRange Range = {}); |
12627 | static SwiftErrorAttr *Create(ASTContext &Ctx, SwiftErrorAttr::ConventionKind Convention, SourceRange Range = {}); |
12628 | |
12629 | // Constructors |
12630 | SwiftErrorAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
12631 | , SwiftErrorAttr::ConventionKind Convention |
12632 | ); |
12633 | |
12634 | SwiftErrorAttr *clone(ASTContext &C) const; |
12635 | void printPretty(raw_ostream &OS, |
12636 | const PrintingPolicy &Policy) const; |
12637 | const char *getSpelling() const; |
12638 | SwiftErrorAttr::ConventionKind getConvention() const { |
12639 | return convention; |
12640 | } |
12641 | |
12642 | static bool ConvertStrToConventionKind(StringRef Val, SwiftErrorAttr::ConventionKind &Out); |
12643 | static const char *ConvertConventionKindToStr(SwiftErrorAttr::ConventionKind Val); |
12644 | |
12645 | |
12646 | static bool classof(const Attr *A) { return A->getKind() == attr::SwiftError; } |
12647 | }; |
12648 | |
12649 | class SwiftErrorResultAttr : public ParameterABIAttr { |
12650 | public: |
12651 | enum Spelling { |
12652 | GNU_swift_error_result = 0, |
12653 | CXX11_clang_swift_error_result = 1, |
12654 | C23_clang_swift_error_result = 2, |
12655 | SpellingNotCalculated = 15 |
12656 | |
12657 | }; |
12658 | |
12659 | // Factory methods |
12660 | static SwiftErrorResultAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
12661 | static SwiftErrorResultAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
12662 | static SwiftErrorResultAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_swift_error_result); |
12663 | static SwiftErrorResultAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_swift_error_result); |
12664 | |
12665 | // Constructors |
12666 | SwiftErrorResultAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
12667 | ); |
12668 | |
12669 | SwiftErrorResultAttr *clone(ASTContext &C) const; |
12670 | void printPretty(raw_ostream &OS, |
12671 | const PrintingPolicy &Policy) const; |
12672 | const char *getSpelling() const; |
12673 | |
12674 | |
12675 | static bool classof(const Attr *A) { return A->getKind() == attr::SwiftErrorResult; } |
12676 | }; |
12677 | |
12678 | class SwiftImportAsNonGenericAttr : public InheritableAttr { |
12679 | public: |
12680 | // Factory methods |
12681 | static SwiftImportAsNonGenericAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
12682 | static SwiftImportAsNonGenericAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
12683 | static SwiftImportAsNonGenericAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
12684 | static SwiftImportAsNonGenericAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
12685 | |
12686 | // Constructors |
12687 | SwiftImportAsNonGenericAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
12688 | ); |
12689 | |
12690 | SwiftImportAsNonGenericAttr *clone(ASTContext &C) const; |
12691 | void printPretty(raw_ostream &OS, |
12692 | const PrintingPolicy &Policy) const; |
12693 | const char *getSpelling() const; |
12694 | |
12695 | |
12696 | static bool classof(const Attr *A) { return A->getKind() == attr::SwiftImportAsNonGeneric; } |
12697 | }; |
12698 | |
12699 | class SwiftImportPropertyAsAccessorsAttr : public InheritableAttr { |
12700 | public: |
12701 | // Factory methods |
12702 | static SwiftImportPropertyAsAccessorsAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
12703 | static SwiftImportPropertyAsAccessorsAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
12704 | static SwiftImportPropertyAsAccessorsAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
12705 | static SwiftImportPropertyAsAccessorsAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
12706 | |
12707 | // Constructors |
12708 | SwiftImportPropertyAsAccessorsAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
12709 | ); |
12710 | |
12711 | SwiftImportPropertyAsAccessorsAttr *clone(ASTContext &C) const; |
12712 | void printPretty(raw_ostream &OS, |
12713 | const PrintingPolicy &Policy) const; |
12714 | const char *getSpelling() const; |
12715 | |
12716 | |
12717 | static bool classof(const Attr *A) { return A->getKind() == attr::SwiftImportPropertyAsAccessors; } |
12718 | }; |
12719 | |
12720 | class SwiftIndirectResultAttr : public ParameterABIAttr { |
12721 | public: |
12722 | enum Spelling { |
12723 | GNU_swift_indirect_result = 0, |
12724 | CXX11_clang_swift_indirect_result = 1, |
12725 | C23_clang_swift_indirect_result = 2, |
12726 | SpellingNotCalculated = 15 |
12727 | |
12728 | }; |
12729 | |
12730 | // Factory methods |
12731 | static SwiftIndirectResultAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
12732 | static SwiftIndirectResultAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
12733 | static SwiftIndirectResultAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_swift_indirect_result); |
12734 | static SwiftIndirectResultAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_swift_indirect_result); |
12735 | |
12736 | // Constructors |
12737 | SwiftIndirectResultAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
12738 | ); |
12739 | |
12740 | SwiftIndirectResultAttr *clone(ASTContext &C) const; |
12741 | void printPretty(raw_ostream &OS, |
12742 | const PrintingPolicy &Policy) const; |
12743 | const char *getSpelling() const; |
12744 | |
12745 | |
12746 | static bool classof(const Attr *A) { return A->getKind() == attr::SwiftIndirectResult; } |
12747 | }; |
12748 | |
12749 | class SwiftNameAttr : public InheritableAttr { |
12750 | unsigned nameLength; |
12751 | char *name; |
12752 | |
12753 | public: |
12754 | // Factory methods |
12755 | static SwiftNameAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Name, const AttributeCommonInfo &CommonInfo); |
12756 | static SwiftNameAttr *Create(ASTContext &Ctx, llvm::StringRef Name, const AttributeCommonInfo &CommonInfo); |
12757 | static SwiftNameAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Name, SourceRange Range = {}); |
12758 | static SwiftNameAttr *Create(ASTContext &Ctx, llvm::StringRef Name, SourceRange Range = {}); |
12759 | |
12760 | // Constructors |
12761 | SwiftNameAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
12762 | , llvm::StringRef Name |
12763 | ); |
12764 | |
12765 | SwiftNameAttr *clone(ASTContext &C) const; |
12766 | void printPretty(raw_ostream &OS, |
12767 | const PrintingPolicy &Policy) const; |
12768 | const char *getSpelling() const; |
12769 | llvm::StringRef getName() const { |
12770 | return llvm::StringRef(name, nameLength); |
12771 | } |
12772 | unsigned getNameLength() const { |
12773 | return nameLength; |
12774 | } |
12775 | void setName(ASTContext &C, llvm::StringRef S) { |
12776 | nameLength = S.size(); |
12777 | this->name = new (C, 1) char [nameLength]; |
12778 | if (!S.empty()) |
12779 | std::memcpy(dest: this->name, src: S.data(), n: nameLength); |
12780 | } |
12781 | |
12782 | |
12783 | |
12784 | static bool classof(const Attr *A) { return A->getKind() == attr::SwiftName; } |
12785 | }; |
12786 | |
12787 | class SwiftNewTypeAttr : public InheritableAttr { |
12788 | public: |
12789 | enum NewtypeKind { |
12790 | NK_Struct, |
12791 | NK_Enum |
12792 | }; |
12793 | private: |
12794 | SwiftNewTypeAttr::NewtypeKind newtypeKind; |
12795 | |
12796 | public: |
12797 | enum Spelling { |
12798 | GNU_swift_newtype = 0, |
12799 | GNU_swift_wrapper = 1, |
12800 | SpellingNotCalculated = 15 |
12801 | |
12802 | }; |
12803 | |
12804 | // Factory methods |
12805 | static SwiftNewTypeAttr *CreateImplicit(ASTContext &Ctx, SwiftNewTypeAttr::NewtypeKind NewtypeKind, const AttributeCommonInfo &CommonInfo); |
12806 | static SwiftNewTypeAttr *Create(ASTContext &Ctx, SwiftNewTypeAttr::NewtypeKind NewtypeKind, const AttributeCommonInfo &CommonInfo); |
12807 | static SwiftNewTypeAttr *CreateImplicit(ASTContext &Ctx, SwiftNewTypeAttr::NewtypeKind NewtypeKind, SourceRange Range = {}, Spelling S = GNU_swift_newtype); |
12808 | static SwiftNewTypeAttr *Create(ASTContext &Ctx, SwiftNewTypeAttr::NewtypeKind NewtypeKind, SourceRange Range = {}, Spelling S = GNU_swift_newtype); |
12809 | |
12810 | // Constructors |
12811 | SwiftNewTypeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
12812 | , SwiftNewTypeAttr::NewtypeKind NewtypeKind |
12813 | ); |
12814 | |
12815 | SwiftNewTypeAttr *clone(ASTContext &C) const; |
12816 | void printPretty(raw_ostream &OS, |
12817 | const PrintingPolicy &Policy) const; |
12818 | const char *getSpelling() const; |
12819 | Spelling getSemanticSpelling() const; |
12820 | SwiftNewTypeAttr::NewtypeKind getNewtypeKind() const { |
12821 | return newtypeKind; |
12822 | } |
12823 | |
12824 | static bool ConvertStrToNewtypeKind(StringRef Val, SwiftNewTypeAttr::NewtypeKind &Out); |
12825 | static const char *ConvertNewtypeKindToStr(SwiftNewTypeAttr::NewtypeKind Val); |
12826 | |
12827 | |
12828 | static bool classof(const Attr *A) { return A->getKind() == attr::SwiftNewType; } |
12829 | }; |
12830 | |
12831 | class SwiftObjCMembersAttr : public Attr { |
12832 | public: |
12833 | // Factory methods |
12834 | static SwiftObjCMembersAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
12835 | static SwiftObjCMembersAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
12836 | static SwiftObjCMembersAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
12837 | static SwiftObjCMembersAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
12838 | |
12839 | // Constructors |
12840 | SwiftObjCMembersAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
12841 | ); |
12842 | |
12843 | SwiftObjCMembersAttr *clone(ASTContext &C) const; |
12844 | void printPretty(raw_ostream &OS, |
12845 | const PrintingPolicy &Policy) const; |
12846 | const char *getSpelling() const; |
12847 | |
12848 | |
12849 | static bool classof(const Attr *A) { return A->getKind() == attr::SwiftObjCMembers; } |
12850 | }; |
12851 | |
12852 | class SwiftPrivateAttr : public InheritableAttr { |
12853 | public: |
12854 | // Factory methods |
12855 | static SwiftPrivateAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
12856 | static SwiftPrivateAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
12857 | static SwiftPrivateAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
12858 | static SwiftPrivateAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
12859 | |
12860 | // Constructors |
12861 | SwiftPrivateAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
12862 | ); |
12863 | |
12864 | SwiftPrivateAttr *clone(ASTContext &C) const; |
12865 | void printPretty(raw_ostream &OS, |
12866 | const PrintingPolicy &Policy) const; |
12867 | const char *getSpelling() const; |
12868 | |
12869 | |
12870 | static bool classof(const Attr *A) { return A->getKind() == attr::SwiftPrivate; } |
12871 | }; |
12872 | |
12873 | class SwiftVersionedAdditionAttr : public Attr { |
12874 | VersionTuple version; |
12875 | |
12876 | |
12877 | Attr * additionalAttr; |
12878 | |
12879 | bool isReplacedByActive; |
12880 | |
12881 | public: |
12882 | // Factory methods |
12883 | static SwiftVersionedAdditionAttr *CreateImplicit(ASTContext &Ctx, VersionTuple Version, Attr * AdditionalAttr, bool IsReplacedByActive, const AttributeCommonInfo &CommonInfo); |
12884 | static SwiftVersionedAdditionAttr *Create(ASTContext &Ctx, VersionTuple Version, Attr * AdditionalAttr, bool IsReplacedByActive, const AttributeCommonInfo &CommonInfo); |
12885 | static SwiftVersionedAdditionAttr *CreateImplicit(ASTContext &Ctx, VersionTuple Version, Attr * AdditionalAttr, bool IsReplacedByActive, SourceRange Range = {}); |
12886 | static SwiftVersionedAdditionAttr *Create(ASTContext &Ctx, VersionTuple Version, Attr * AdditionalAttr, bool IsReplacedByActive, SourceRange Range = {}); |
12887 | |
12888 | // Constructors |
12889 | SwiftVersionedAdditionAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
12890 | , VersionTuple Version |
12891 | , Attr * AdditionalAttr |
12892 | , bool IsReplacedByActive |
12893 | ); |
12894 | |
12895 | SwiftVersionedAdditionAttr *clone(ASTContext &C) const; |
12896 | void printPretty(raw_ostream &OS, |
12897 | const PrintingPolicy &Policy) const; |
12898 | const char *getSpelling() const; |
12899 | VersionTuple getVersion() const { |
12900 | return version; |
12901 | } |
12902 | void setVersion(ASTContext &C, VersionTuple V) { |
12903 | version = V; |
12904 | } |
12905 | |
12906 | Attr * getAdditionalAttr() const { |
12907 | return additionalAttr; |
12908 | } |
12909 | |
12910 | bool getIsReplacedByActive() const { |
12911 | return isReplacedByActive; |
12912 | } |
12913 | |
12914 | |
12915 | |
12916 | static bool classof(const Attr *A) { return A->getKind() == attr::SwiftVersionedAddition; } |
12917 | }; |
12918 | |
12919 | class SwiftVersionedRemovalAttr : public Attr { |
12920 | VersionTuple version; |
12921 | |
12922 | |
12923 | unsigned rawKind; |
12924 | |
12925 | bool isReplacedByActive; |
12926 | |
12927 | public: |
12928 | // Factory methods |
12929 | static SwiftVersionedRemovalAttr *CreateImplicit(ASTContext &Ctx, VersionTuple Version, unsigned RawKind, bool IsReplacedByActive, const AttributeCommonInfo &CommonInfo); |
12930 | static SwiftVersionedRemovalAttr *Create(ASTContext &Ctx, VersionTuple Version, unsigned RawKind, bool IsReplacedByActive, const AttributeCommonInfo &CommonInfo); |
12931 | static SwiftVersionedRemovalAttr *CreateImplicit(ASTContext &Ctx, VersionTuple Version, unsigned RawKind, bool IsReplacedByActive, SourceRange Range = {}); |
12932 | static SwiftVersionedRemovalAttr *Create(ASTContext &Ctx, VersionTuple Version, unsigned RawKind, bool IsReplacedByActive, SourceRange Range = {}); |
12933 | |
12934 | // Constructors |
12935 | SwiftVersionedRemovalAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
12936 | , VersionTuple Version |
12937 | , unsigned RawKind |
12938 | , bool IsReplacedByActive |
12939 | ); |
12940 | |
12941 | SwiftVersionedRemovalAttr *clone(ASTContext &C) const; |
12942 | void printPretty(raw_ostream &OS, |
12943 | const PrintingPolicy &Policy) const; |
12944 | const char *getSpelling() const; |
12945 | VersionTuple getVersion() const { |
12946 | return version; |
12947 | } |
12948 | void setVersion(ASTContext &C, VersionTuple V) { |
12949 | version = V; |
12950 | } |
12951 | |
12952 | unsigned getRawKind() const { |
12953 | return rawKind; |
12954 | } |
12955 | |
12956 | bool getIsReplacedByActive() const { |
12957 | return isReplacedByActive; |
12958 | } |
12959 | |
12960 | |
12961 | attr::Kind getAttrKindToRemove() const { |
12962 | return static_cast<attr::Kind>(getRawKind()); |
12963 | } |
12964 | |
12965 | |
12966 | static bool classof(const Attr *A) { return A->getKind() == attr::SwiftVersionedRemoval; } |
12967 | }; |
12968 | |
12969 | class SysVABIAttr : public InheritableAttr { |
12970 | public: |
12971 | enum Spelling { |
12972 | GNU_sysv_abi = 0, |
12973 | CXX11_gnu_sysv_abi = 1, |
12974 | C23_gnu_sysv_abi = 2, |
12975 | SpellingNotCalculated = 15 |
12976 | |
12977 | }; |
12978 | |
12979 | // Factory methods |
12980 | static SysVABIAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
12981 | static SysVABIAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
12982 | static SysVABIAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_sysv_abi); |
12983 | static SysVABIAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_sysv_abi); |
12984 | |
12985 | // Constructors |
12986 | SysVABIAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
12987 | ); |
12988 | |
12989 | SysVABIAttr *clone(ASTContext &C) const; |
12990 | void printPretty(raw_ostream &OS, |
12991 | const PrintingPolicy &Policy) const; |
12992 | const char *getSpelling() const; |
12993 | |
12994 | |
12995 | static bool classof(const Attr *A) { return A->getKind() == attr::SysVABI; } |
12996 | }; |
12997 | |
12998 | class TLSModelAttr : public InheritableAttr { |
12999 | unsigned modelLength; |
13000 | char *model; |
13001 | |
13002 | public: |
13003 | enum Spelling { |
13004 | GNU_tls_model = 0, |
13005 | CXX11_gnu_tls_model = 1, |
13006 | C23_gnu_tls_model = 2, |
13007 | SpellingNotCalculated = 15 |
13008 | |
13009 | }; |
13010 | |
13011 | // Factory methods |
13012 | static TLSModelAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Model, const AttributeCommonInfo &CommonInfo); |
13013 | static TLSModelAttr *Create(ASTContext &Ctx, llvm::StringRef Model, const AttributeCommonInfo &CommonInfo); |
13014 | static TLSModelAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Model, SourceRange Range = {}, Spelling S = GNU_tls_model); |
13015 | static TLSModelAttr *Create(ASTContext &Ctx, llvm::StringRef Model, SourceRange Range = {}, Spelling S = GNU_tls_model); |
13016 | |
13017 | // Constructors |
13018 | TLSModelAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
13019 | , llvm::StringRef Model |
13020 | ); |
13021 | |
13022 | TLSModelAttr *clone(ASTContext &C) const; |
13023 | void printPretty(raw_ostream &OS, |
13024 | const PrintingPolicy &Policy) const; |
13025 | const char *getSpelling() const; |
13026 | llvm::StringRef getModel() const { |
13027 | return llvm::StringRef(model, modelLength); |
13028 | } |
13029 | unsigned getModelLength() const { |
13030 | return modelLength; |
13031 | } |
13032 | void setModel(ASTContext &C, llvm::StringRef S) { |
13033 | modelLength = S.size(); |
13034 | this->model = new (C, 1) char [modelLength]; |
13035 | if (!S.empty()) |
13036 | std::memcpy(dest: this->model, src: S.data(), n: modelLength); |
13037 | } |
13038 | |
13039 | |
13040 | |
13041 | static bool classof(const Attr *A) { return A->getKind() == attr::TLSModel; } |
13042 | }; |
13043 | |
13044 | class TargetAttr : public InheritableAttr { |
13045 | unsigned featuresStrLength; |
13046 | char *featuresStr; |
13047 | |
13048 | public: |
13049 | enum Spelling { |
13050 | GNU_target = 0, |
13051 | CXX11_gnu_target = 1, |
13052 | C23_gnu_target = 2, |
13053 | SpellingNotCalculated = 15 |
13054 | |
13055 | }; |
13056 | |
13057 | // Factory methods |
13058 | static TargetAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef FeaturesStr, const AttributeCommonInfo &CommonInfo); |
13059 | static TargetAttr *Create(ASTContext &Ctx, llvm::StringRef FeaturesStr, const AttributeCommonInfo &CommonInfo); |
13060 | static TargetAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef FeaturesStr, SourceRange Range = {}, Spelling S = GNU_target); |
13061 | static TargetAttr *Create(ASTContext &Ctx, llvm::StringRef FeaturesStr, SourceRange Range = {}, Spelling S = GNU_target); |
13062 | |
13063 | // Constructors |
13064 | TargetAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
13065 | , llvm::StringRef FeaturesStr |
13066 | ); |
13067 | |
13068 | TargetAttr *clone(ASTContext &C) const; |
13069 | void printPretty(raw_ostream &OS, |
13070 | const PrintingPolicy &Policy) const; |
13071 | const char *getSpelling() const; |
13072 | llvm::StringRef getFeaturesStr() const { |
13073 | return llvm::StringRef(featuresStr, featuresStrLength); |
13074 | } |
13075 | unsigned getFeaturesStrLength() const { |
13076 | return featuresStrLength; |
13077 | } |
13078 | void setFeaturesStr(ASTContext &C, llvm::StringRef S) { |
13079 | featuresStrLength = S.size(); |
13080 | this->featuresStr = new (C, 1) char [featuresStrLength]; |
13081 | if (!S.empty()) |
13082 | std::memcpy(dest: this->featuresStr, src: S.data(), n: featuresStrLength); |
13083 | } |
13084 | |
13085 | |
13086 | StringRef getArchitecture() const { |
13087 | StringRef Features = getFeaturesStr(); |
13088 | if (Features == "default" ) return {}; |
13089 | |
13090 | SmallVector<StringRef, 1> AttrFeatures; |
13091 | Features.split(A&: AttrFeatures, Separator: "," ); |
13092 | |
13093 | for (auto &Feature : AttrFeatures) { |
13094 | Feature = Feature.trim(); |
13095 | if (Feature.starts_with(Prefix: "arch=" )) |
13096 | return Feature.drop_front(N: sizeof("arch=" ) - 1); |
13097 | } |
13098 | return "" ; |
13099 | } |
13100 | |
13101 | // Gets the list of features as simple string-refs with no +/- or 'no-'. |
13102 | // Only adds the items to 'Out' that are additions. |
13103 | void getAddedFeatures(llvm::SmallVectorImpl<StringRef> &Out) const { |
13104 | StringRef Features = getFeaturesStr(); |
13105 | if (Features == "default" ) return; |
13106 | |
13107 | SmallVector<StringRef, 1> AttrFeatures; |
13108 | Features.split(A&: AttrFeatures, Separator: "," ); |
13109 | |
13110 | for (auto &Feature : AttrFeatures) { |
13111 | Feature = Feature.trim(); |
13112 | |
13113 | if (!Feature.starts_with(Prefix: "no-" ) && !Feature.starts_with(Prefix: "arch=" ) && |
13114 | !Feature.starts_with(Prefix: "fpmath=" ) && !Feature.starts_with(Prefix: "tune=" )) |
13115 | Out.push_back(Elt: Feature); |
13116 | } |
13117 | } |
13118 | |
13119 | bool isDefaultVersion() const { return getFeaturesStr() == "default" ; } |
13120 | |
13121 | |
13122 | static bool classof(const Attr *A) { return A->getKind() == attr::Target; } |
13123 | }; |
13124 | |
13125 | class TargetClonesAttr : public InheritableAttr { |
13126 | unsigned featuresStrs_Size; |
13127 | StringRef *featuresStrs_; |
13128 | |
13129 | public: |
13130 | enum Spelling { |
13131 | GNU_target_clones = 0, |
13132 | CXX11_gnu_target_clones = 1, |
13133 | C23_gnu_target_clones = 2, |
13134 | SpellingNotCalculated = 15 |
13135 | |
13136 | }; |
13137 | |
13138 | // Factory methods |
13139 | static TargetClonesAttr *CreateImplicit(ASTContext &Ctx, StringRef *FeaturesStrs, unsigned , const AttributeCommonInfo &CommonInfo); |
13140 | static TargetClonesAttr *Create(ASTContext &Ctx, StringRef *FeaturesStrs, unsigned , const AttributeCommonInfo &CommonInfo); |
13141 | static TargetClonesAttr *CreateImplicit(ASTContext &Ctx, StringRef *FeaturesStrs, unsigned , SourceRange Range = {}, Spelling S = GNU_target_clones); |
13142 | static TargetClonesAttr *Create(ASTContext &Ctx, StringRef *FeaturesStrs, unsigned , SourceRange Range = {}, Spelling S = GNU_target_clones); |
13143 | |
13144 | // Constructors |
13145 | TargetClonesAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
13146 | , StringRef *FeaturesStrs, unsigned |
13147 | ); |
13148 | TargetClonesAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
13149 | ); |
13150 | |
13151 | TargetClonesAttr *clone(ASTContext &C) const; |
13152 | void printPretty(raw_ostream &OS, |
13153 | const PrintingPolicy &Policy) const; |
13154 | const char *getSpelling() const; |
13155 | typedef StringRef* featuresStrs_iterator; |
13156 | featuresStrs_iterator featuresStrs_begin() const { return featuresStrs_; } |
13157 | featuresStrs_iterator featuresStrs_end() const { return featuresStrs_ + featuresStrs_Size; } |
13158 | unsigned featuresStrs_size() const { return featuresStrs_Size; } |
13159 | llvm::iterator_range<featuresStrs_iterator> featuresStrs() const { return llvm::make_range(x: featuresStrs_begin(), y: featuresStrs_end()); } |
13160 | |
13161 | |
13162 | |
13163 | StringRef getFeatureStr(unsigned Index) const { |
13164 | return *(featuresStrs_begin() + Index); |
13165 | } |
13166 | bool isDefaultVersion(unsigned Index) const { |
13167 | return getFeatureStr(Index) == "default" ; |
13168 | } |
13169 | void getFeatures(llvm::SmallVectorImpl<StringRef> &Out, |
13170 | unsigned Index) const { |
13171 | if (isDefaultVersion(Index)) return; |
13172 | StringRef Features = getFeatureStr(Index); |
13173 | SmallVector<StringRef, 8> AttrFeatures; |
13174 | Features.split(A&: AttrFeatures, Separator: "+" ); |
13175 | for (auto &Feature : AttrFeatures) { |
13176 | Feature = Feature.trim(); |
13177 | Out.push_back(Elt: Feature); |
13178 | } |
13179 | } |
13180 | // Given an index into the 'featuresStrs' sequence, compute a unique |
13181 | // ID to be used with function name mangling for the associated variant. |
13182 | // This mapping is necessary due to a requirement that the mangling ID |
13183 | // used for the "default" variant be the largest mangling ID in the |
13184 | // variant set. Duplicate variants present in 'featuresStrs' are also |
13185 | // assigned their own unique ID (the mapping is bijective). |
13186 | unsigned getMangledIndex(unsigned Index) const { |
13187 | if (getFeatureStr(Index) == "default" ) |
13188 | return std::count_if(first: featuresStrs_begin(), last: featuresStrs_end(), |
13189 | pred: [](StringRef S) { return S != "default" ; }); |
13190 | |
13191 | return std::count_if(first: featuresStrs_begin(), last: featuresStrs_begin() + Index, |
13192 | pred: [](StringRef S) { return S != "default" ; }); |
13193 | } |
13194 | |
13195 | // Given an index into the 'featuresStrs' sequence, determine if the |
13196 | // index corresponds to the first instance of the named variant. This |
13197 | // is used to skip over duplicate variant instances when iterating over |
13198 | // 'featuresStrs'. |
13199 | bool isFirstOfVersion(unsigned Index) const { |
13200 | StringRef FeatureStr(getFeatureStr(Index)); |
13201 | return 0 == std::count_if( |
13202 | first: featuresStrs_begin(), last: featuresStrs_begin() + Index, |
13203 | pred: [FeatureStr](StringRef S) { return S == FeatureStr; }); |
13204 | |
13205 | } |
13206 | |
13207 | |
13208 | static bool classof(const Attr *A) { return A->getKind() == attr::TargetClones; } |
13209 | }; |
13210 | |
13211 | class TargetVersionAttr : public InheritableAttr { |
13212 | unsigned namesStrLength; |
13213 | char *namesStr; |
13214 | |
13215 | public: |
13216 | enum Spelling { |
13217 | GNU_target_version = 0, |
13218 | CXX11_gnu_target_version = 1, |
13219 | C23_gnu_target_version = 2, |
13220 | SpellingNotCalculated = 15 |
13221 | |
13222 | }; |
13223 | |
13224 | // Factory methods |
13225 | static TargetVersionAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef NamesStr, const AttributeCommonInfo &CommonInfo); |
13226 | static TargetVersionAttr *Create(ASTContext &Ctx, llvm::StringRef NamesStr, const AttributeCommonInfo &CommonInfo); |
13227 | static TargetVersionAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef NamesStr, SourceRange Range = {}, Spelling S = GNU_target_version); |
13228 | static TargetVersionAttr *Create(ASTContext &Ctx, llvm::StringRef NamesStr, SourceRange Range = {}, Spelling S = GNU_target_version); |
13229 | |
13230 | // Constructors |
13231 | TargetVersionAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
13232 | , llvm::StringRef NamesStr |
13233 | ); |
13234 | |
13235 | TargetVersionAttr *clone(ASTContext &C) const; |
13236 | void printPretty(raw_ostream &OS, |
13237 | const PrintingPolicy &Policy) const; |
13238 | const char *getSpelling() const; |
13239 | llvm::StringRef getNamesStr() const { |
13240 | return llvm::StringRef(namesStr, namesStrLength); |
13241 | } |
13242 | unsigned getNamesStrLength() const { |
13243 | return namesStrLength; |
13244 | } |
13245 | void setNamesStr(ASTContext &C, llvm::StringRef S) { |
13246 | namesStrLength = S.size(); |
13247 | this->namesStr = new (C, 1) char [namesStrLength]; |
13248 | if (!S.empty()) |
13249 | std::memcpy(dest: this->namesStr, src: S.data(), n: namesStrLength); |
13250 | } |
13251 | |
13252 | |
13253 | StringRef getName() const { return getNamesStr().trim(); } |
13254 | bool isDefaultVersion() const { |
13255 | return getName() == "default" ; |
13256 | } |
13257 | void getFeatures(llvm::SmallVectorImpl<StringRef> &Out) const { |
13258 | if (isDefaultVersion()) return; |
13259 | StringRef Features = getName(); |
13260 | |
13261 | SmallVector<StringRef, 8> AttrFeatures; |
13262 | Features.split(A&: AttrFeatures, Separator: "+" ); |
13263 | |
13264 | for (auto &Feature : AttrFeatures) { |
13265 | Feature = Feature.trim(); |
13266 | Out.push_back(Elt: Feature); |
13267 | } |
13268 | } |
13269 | |
13270 | |
13271 | static bool classof(const Attr *A) { return A->getKind() == attr::TargetVersion; } |
13272 | }; |
13273 | |
13274 | class TestTypestateAttr : public InheritableAttr { |
13275 | public: |
13276 | enum ConsumedState { |
13277 | Consumed, |
13278 | Unconsumed |
13279 | }; |
13280 | private: |
13281 | TestTypestateAttr::ConsumedState testState; |
13282 | |
13283 | public: |
13284 | enum Spelling { |
13285 | GNU_test_typestate = 0, |
13286 | CXX11_clang_test_typestate = 1, |
13287 | SpellingNotCalculated = 15 |
13288 | |
13289 | }; |
13290 | |
13291 | // Factory methods |
13292 | static TestTypestateAttr *CreateImplicit(ASTContext &Ctx, TestTypestateAttr::ConsumedState TestState, const AttributeCommonInfo &CommonInfo); |
13293 | static TestTypestateAttr *Create(ASTContext &Ctx, TestTypestateAttr::ConsumedState TestState, const AttributeCommonInfo &CommonInfo); |
13294 | static TestTypestateAttr *CreateImplicit(ASTContext &Ctx, TestTypestateAttr::ConsumedState TestState, SourceRange Range = {}, Spelling S = GNU_test_typestate); |
13295 | static TestTypestateAttr *Create(ASTContext &Ctx, TestTypestateAttr::ConsumedState TestState, SourceRange Range = {}, Spelling S = GNU_test_typestate); |
13296 | |
13297 | // Constructors |
13298 | TestTypestateAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
13299 | , TestTypestateAttr::ConsumedState TestState |
13300 | ); |
13301 | |
13302 | TestTypestateAttr *clone(ASTContext &C) const; |
13303 | void printPretty(raw_ostream &OS, |
13304 | const PrintingPolicy &Policy) const; |
13305 | const char *getSpelling() const; |
13306 | TestTypestateAttr::ConsumedState getTestState() const { |
13307 | return testState; |
13308 | } |
13309 | |
13310 | static bool ConvertStrToConsumedState(StringRef Val, TestTypestateAttr::ConsumedState &Out); |
13311 | static const char *ConvertConsumedStateToStr(TestTypestateAttr::ConsumedState Val); |
13312 | |
13313 | |
13314 | static bool classof(const Attr *A) { return A->getKind() == attr::TestTypestate; } |
13315 | }; |
13316 | |
13317 | class ThisCallAttr : public InheritableAttr { |
13318 | public: |
13319 | enum Spelling { |
13320 | GNU_thiscall = 0, |
13321 | CXX11_gnu_thiscall = 1, |
13322 | C23_gnu_thiscall = 2, |
13323 | Keyword_thiscall = 3, |
13324 | SpellingNotCalculated = 15 |
13325 | |
13326 | }; |
13327 | |
13328 | // Factory methods |
13329 | static ThisCallAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
13330 | static ThisCallAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
13331 | static ThisCallAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_thiscall); |
13332 | static ThisCallAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_thiscall); |
13333 | |
13334 | // Constructors |
13335 | ThisCallAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
13336 | ); |
13337 | |
13338 | ThisCallAttr *clone(ASTContext &C) const; |
13339 | void printPretty(raw_ostream &OS, |
13340 | const PrintingPolicy &Policy) const; |
13341 | const char *getSpelling() const; |
13342 | |
13343 | |
13344 | static bool classof(const Attr *A) { return A->getKind() == attr::ThisCall; } |
13345 | }; |
13346 | |
13347 | class ThreadAttr : public Attr { |
13348 | public: |
13349 | // Factory methods |
13350 | static ThreadAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
13351 | static ThreadAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
13352 | static ThreadAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
13353 | static ThreadAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
13354 | |
13355 | // Constructors |
13356 | ThreadAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
13357 | ); |
13358 | |
13359 | ThreadAttr *clone(ASTContext &C) const; |
13360 | void printPretty(raw_ostream &OS, |
13361 | const PrintingPolicy &Policy) const; |
13362 | const char *getSpelling() const; |
13363 | |
13364 | |
13365 | static bool classof(const Attr *A) { return A->getKind() == attr::Thread; } |
13366 | }; |
13367 | |
13368 | class TransparentUnionAttr : public InheritableAttr { |
13369 | public: |
13370 | enum Spelling { |
13371 | GNU_transparent_union = 0, |
13372 | CXX11_gnu_transparent_union = 1, |
13373 | C23_gnu_transparent_union = 2, |
13374 | SpellingNotCalculated = 15 |
13375 | |
13376 | }; |
13377 | |
13378 | // Factory methods |
13379 | static TransparentUnionAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
13380 | static TransparentUnionAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
13381 | static TransparentUnionAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_transparent_union); |
13382 | static TransparentUnionAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_transparent_union); |
13383 | |
13384 | // Constructors |
13385 | TransparentUnionAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
13386 | ); |
13387 | |
13388 | TransparentUnionAttr *clone(ASTContext &C) const; |
13389 | void printPretty(raw_ostream &OS, |
13390 | const PrintingPolicy &Policy) const; |
13391 | const char *getSpelling() const; |
13392 | |
13393 | |
13394 | static bool classof(const Attr *A) { return A->getKind() == attr::TransparentUnion; } |
13395 | }; |
13396 | |
13397 | class TrivialABIAttr : public InheritableAttr { |
13398 | public: |
13399 | enum Spelling { |
13400 | GNU_trivial_abi = 0, |
13401 | CXX11_clang_trivial_abi = 1, |
13402 | SpellingNotCalculated = 15 |
13403 | |
13404 | }; |
13405 | |
13406 | // Factory methods |
13407 | static TrivialABIAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
13408 | static TrivialABIAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
13409 | static TrivialABIAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_trivial_abi); |
13410 | static TrivialABIAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_trivial_abi); |
13411 | |
13412 | // Constructors |
13413 | TrivialABIAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
13414 | ); |
13415 | |
13416 | TrivialABIAttr *clone(ASTContext &C) const; |
13417 | void printPretty(raw_ostream &OS, |
13418 | const PrintingPolicy &Policy) const; |
13419 | const char *getSpelling() const; |
13420 | |
13421 | |
13422 | static bool classof(const Attr *A) { return A->getKind() == attr::TrivialABI; } |
13423 | }; |
13424 | |
13425 | class TryAcquireCapabilityAttr : public InheritableAttr { |
13426 | Expr * successValue; |
13427 | |
13428 | unsigned args_Size; |
13429 | Expr * *args_; |
13430 | |
13431 | public: |
13432 | enum Spelling { |
13433 | GNU_try_acquire_capability = 0, |
13434 | CXX11_clang_try_acquire_capability = 1, |
13435 | GNU_try_acquire_shared_capability = 2, |
13436 | CXX11_clang_try_acquire_shared_capability = 3, |
13437 | SpellingNotCalculated = 15 |
13438 | |
13439 | }; |
13440 | |
13441 | // Factory methods |
13442 | static TryAcquireCapabilityAttr *CreateImplicit(ASTContext &Ctx, Expr * SuccessValue, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo); |
13443 | static TryAcquireCapabilityAttr *Create(ASTContext &Ctx, Expr * SuccessValue, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo); |
13444 | static TryAcquireCapabilityAttr *CreateImplicit(ASTContext &Ctx, Expr * SuccessValue, Expr * *Args, unsigned ArgsSize, SourceRange Range = {}, Spelling S = GNU_try_acquire_capability); |
13445 | static TryAcquireCapabilityAttr *Create(ASTContext &Ctx, Expr * SuccessValue, Expr * *Args, unsigned ArgsSize, SourceRange Range = {}, Spelling S = GNU_try_acquire_capability); |
13446 | |
13447 | // Constructors |
13448 | TryAcquireCapabilityAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
13449 | , Expr * SuccessValue |
13450 | , Expr * *Args, unsigned ArgsSize |
13451 | ); |
13452 | TryAcquireCapabilityAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
13453 | , Expr * SuccessValue |
13454 | ); |
13455 | |
13456 | TryAcquireCapabilityAttr *clone(ASTContext &C) const; |
13457 | void printPretty(raw_ostream &OS, |
13458 | const PrintingPolicy &Policy) const; |
13459 | const char *getSpelling() const; |
13460 | Spelling getSemanticSpelling() const; |
13461 | bool isShared() const { return getAttributeSpellingListIndex() == 2 || |
13462 | getAttributeSpellingListIndex() == 3; } |
13463 | Expr * getSuccessValue() const { |
13464 | return successValue; |
13465 | } |
13466 | |
13467 | typedef Expr ** args_iterator; |
13468 | args_iterator args_begin() const { return args_; } |
13469 | args_iterator args_end() const { return args_ + args_Size; } |
13470 | unsigned args_size() const { return args_Size; } |
13471 | llvm::iterator_range<args_iterator> args() const { return llvm::make_range(x: args_begin(), y: args_end()); } |
13472 | |
13473 | |
13474 | |
13475 | |
13476 | static bool classof(const Attr *A) { return A->getKind() == attr::TryAcquireCapability; } |
13477 | }; |
13478 | |
13479 | class TypeNonNullAttr : public TypeAttr { |
13480 | public: |
13481 | // Factory methods |
13482 | static TypeNonNullAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
13483 | static TypeNonNullAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
13484 | static TypeNonNullAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
13485 | static TypeNonNullAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
13486 | |
13487 | // Constructors |
13488 | TypeNonNullAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
13489 | ); |
13490 | |
13491 | TypeNonNullAttr *clone(ASTContext &C) const; |
13492 | void printPretty(raw_ostream &OS, |
13493 | const PrintingPolicy &Policy) const; |
13494 | const char *getSpelling() const; |
13495 | |
13496 | |
13497 | static bool classof(const Attr *A) { return A->getKind() == attr::TypeNonNull; } |
13498 | }; |
13499 | |
13500 | class TypeNullUnspecifiedAttr : public TypeAttr { |
13501 | public: |
13502 | // Factory methods |
13503 | static TypeNullUnspecifiedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
13504 | static TypeNullUnspecifiedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
13505 | static TypeNullUnspecifiedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
13506 | static TypeNullUnspecifiedAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
13507 | |
13508 | // Constructors |
13509 | TypeNullUnspecifiedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
13510 | ); |
13511 | |
13512 | TypeNullUnspecifiedAttr *clone(ASTContext &C) const; |
13513 | void printPretty(raw_ostream &OS, |
13514 | const PrintingPolicy &Policy) const; |
13515 | const char *getSpelling() const; |
13516 | |
13517 | |
13518 | static bool classof(const Attr *A) { return A->getKind() == attr::TypeNullUnspecified; } |
13519 | }; |
13520 | |
13521 | class TypeNullableAttr : public InheritableAttr { |
13522 | public: |
13523 | // Factory methods |
13524 | static TypeNullableAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
13525 | static TypeNullableAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
13526 | static TypeNullableAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
13527 | static TypeNullableAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
13528 | |
13529 | // Constructors |
13530 | TypeNullableAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
13531 | ); |
13532 | |
13533 | TypeNullableAttr *clone(ASTContext &C) const; |
13534 | void printPretty(raw_ostream &OS, |
13535 | const PrintingPolicy &Policy) const; |
13536 | const char *getSpelling() const; |
13537 | |
13538 | |
13539 | static bool classof(const Attr *A) { return A->getKind() == attr::TypeNullable; } |
13540 | }; |
13541 | |
13542 | class TypeNullableResultAttr : public TypeAttr { |
13543 | public: |
13544 | // Factory methods |
13545 | static TypeNullableResultAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
13546 | static TypeNullableResultAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
13547 | static TypeNullableResultAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
13548 | static TypeNullableResultAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
13549 | |
13550 | // Constructors |
13551 | TypeNullableResultAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
13552 | ); |
13553 | |
13554 | TypeNullableResultAttr *clone(ASTContext &C) const; |
13555 | void printPretty(raw_ostream &OS, |
13556 | const PrintingPolicy &Policy) const; |
13557 | const char *getSpelling() const; |
13558 | |
13559 | |
13560 | static bool classof(const Attr *A) { return A->getKind() == attr::TypeNullableResult; } |
13561 | }; |
13562 | |
13563 | class TypeTagForDatatypeAttr : public InheritableAttr { |
13564 | IdentifierInfo * argumentKind; |
13565 | |
13566 | TypeSourceInfo * matchingCType; |
13567 | |
13568 | bool layoutCompatible; |
13569 | |
13570 | bool mustBeNull; |
13571 | |
13572 | public: |
13573 | enum Spelling { |
13574 | GNU_type_tag_for_datatype = 0, |
13575 | CXX11_clang_type_tag_for_datatype = 1, |
13576 | C23_clang_type_tag_for_datatype = 2, |
13577 | SpellingNotCalculated = 15 |
13578 | |
13579 | }; |
13580 | |
13581 | // Factory methods |
13582 | static TypeTagForDatatypeAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * ArgumentKind, TypeSourceInfo * MatchingCType, bool LayoutCompatible, bool MustBeNull, const AttributeCommonInfo &CommonInfo); |
13583 | static TypeTagForDatatypeAttr *Create(ASTContext &Ctx, IdentifierInfo * ArgumentKind, TypeSourceInfo * MatchingCType, bool LayoutCompatible, bool MustBeNull, const AttributeCommonInfo &CommonInfo); |
13584 | static TypeTagForDatatypeAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * ArgumentKind, TypeSourceInfo * MatchingCType, bool LayoutCompatible, bool MustBeNull, SourceRange Range = {}, Spelling S = GNU_type_tag_for_datatype); |
13585 | static TypeTagForDatatypeAttr *Create(ASTContext &Ctx, IdentifierInfo * ArgumentKind, TypeSourceInfo * MatchingCType, bool LayoutCompatible, bool MustBeNull, SourceRange Range = {}, Spelling S = GNU_type_tag_for_datatype); |
13586 | |
13587 | // Constructors |
13588 | TypeTagForDatatypeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
13589 | , IdentifierInfo * ArgumentKind |
13590 | , TypeSourceInfo * MatchingCType |
13591 | , bool LayoutCompatible |
13592 | , bool MustBeNull |
13593 | ); |
13594 | |
13595 | TypeTagForDatatypeAttr *clone(ASTContext &C) const; |
13596 | void printPretty(raw_ostream &OS, |
13597 | const PrintingPolicy &Policy) const; |
13598 | const char *getSpelling() const; |
13599 | IdentifierInfo * getArgumentKind() const { |
13600 | return argumentKind; |
13601 | } |
13602 | |
13603 | QualType getMatchingCType() const { |
13604 | return matchingCType->getType(); |
13605 | } TypeSourceInfo * getMatchingCTypeLoc() const { |
13606 | return matchingCType; |
13607 | } |
13608 | |
13609 | bool getLayoutCompatible() const { |
13610 | return layoutCompatible; |
13611 | } |
13612 | |
13613 | bool getMustBeNull() const { |
13614 | return mustBeNull; |
13615 | } |
13616 | |
13617 | |
13618 | |
13619 | static bool classof(const Attr *A) { return A->getKind() == attr::TypeTagForDatatype; } |
13620 | }; |
13621 | |
13622 | class TypeVisibilityAttr : public InheritableAttr { |
13623 | public: |
13624 | enum VisibilityType { |
13625 | Default, |
13626 | Hidden, |
13627 | Protected |
13628 | }; |
13629 | private: |
13630 | TypeVisibilityAttr::VisibilityType visibility; |
13631 | |
13632 | public: |
13633 | enum Spelling { |
13634 | GNU_type_visibility = 0, |
13635 | CXX11_clang_type_visibility = 1, |
13636 | C23_clang_type_visibility = 2, |
13637 | SpellingNotCalculated = 15 |
13638 | |
13639 | }; |
13640 | |
13641 | // Factory methods |
13642 | static TypeVisibilityAttr *CreateImplicit(ASTContext &Ctx, TypeVisibilityAttr::VisibilityType Visibility, const AttributeCommonInfo &CommonInfo); |
13643 | static TypeVisibilityAttr *Create(ASTContext &Ctx, TypeVisibilityAttr::VisibilityType Visibility, const AttributeCommonInfo &CommonInfo); |
13644 | static TypeVisibilityAttr *CreateImplicit(ASTContext &Ctx, TypeVisibilityAttr::VisibilityType Visibility, SourceRange Range = {}, Spelling S = GNU_type_visibility); |
13645 | static TypeVisibilityAttr *Create(ASTContext &Ctx, TypeVisibilityAttr::VisibilityType Visibility, SourceRange Range = {}, Spelling S = GNU_type_visibility); |
13646 | |
13647 | // Constructors |
13648 | TypeVisibilityAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
13649 | , TypeVisibilityAttr::VisibilityType Visibility |
13650 | ); |
13651 | |
13652 | TypeVisibilityAttr *clone(ASTContext &C) const; |
13653 | void printPretty(raw_ostream &OS, |
13654 | const PrintingPolicy &Policy) const; |
13655 | const char *getSpelling() const; |
13656 | TypeVisibilityAttr::VisibilityType getVisibility() const { |
13657 | return visibility; |
13658 | } |
13659 | |
13660 | static bool ConvertStrToVisibilityType(StringRef Val, TypeVisibilityAttr::VisibilityType &Out); |
13661 | static const char *ConvertVisibilityTypeToStr(TypeVisibilityAttr::VisibilityType Val); |
13662 | |
13663 | |
13664 | static bool classof(const Attr *A) { return A->getKind() == attr::TypeVisibility; } |
13665 | }; |
13666 | |
13667 | class UPtrAttr : public TypeAttr { |
13668 | public: |
13669 | // Factory methods |
13670 | static UPtrAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
13671 | static UPtrAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
13672 | static UPtrAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
13673 | static UPtrAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
13674 | |
13675 | // Constructors |
13676 | UPtrAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
13677 | ); |
13678 | |
13679 | UPtrAttr *clone(ASTContext &C) const; |
13680 | void printPretty(raw_ostream &OS, |
13681 | const PrintingPolicy &Policy) const; |
13682 | const char *getSpelling() const; |
13683 | |
13684 | |
13685 | static bool classof(const Attr *A) { return A->getKind() == attr::UPtr; } |
13686 | }; |
13687 | |
13688 | class UnavailableAttr : public InheritableAttr { |
13689 | unsigned messageLength; |
13690 | char *message; |
13691 | |
13692 | public: |
13693 | enum ImplicitReason { |
13694 | IR_None, |
13695 | IR_ARCForbiddenType, |
13696 | IR_ForbiddenWeak, |
13697 | IR_ARCForbiddenConversion, |
13698 | IR_ARCInitReturnsUnrelated, |
13699 | IR_ARCFieldWithOwnership |
13700 | }; |
13701 | private: |
13702 | UnavailableAttr::ImplicitReason implicitReason; |
13703 | |
13704 | public: |
13705 | enum Spelling { |
13706 | GNU_unavailable = 0, |
13707 | CXX11_clang_unavailable = 1, |
13708 | C23_clang_unavailable = 2, |
13709 | SpellingNotCalculated = 15 |
13710 | |
13711 | }; |
13712 | |
13713 | // Factory methods |
13714 | static UnavailableAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Message, UnavailableAttr::ImplicitReason ImplicitReason, const AttributeCommonInfo &CommonInfo); |
13715 | static UnavailableAttr *Create(ASTContext &Ctx, llvm::StringRef Message, UnavailableAttr::ImplicitReason ImplicitReason, const AttributeCommonInfo &CommonInfo); |
13716 | static UnavailableAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Message, UnavailableAttr::ImplicitReason ImplicitReason, SourceRange Range = {}, Spelling S = GNU_unavailable); |
13717 | static UnavailableAttr *Create(ASTContext &Ctx, llvm::StringRef Message, UnavailableAttr::ImplicitReason ImplicitReason, SourceRange Range = {}, Spelling S = GNU_unavailable); |
13718 | static UnavailableAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Message, const AttributeCommonInfo &CommonInfo); |
13719 | static UnavailableAttr *Create(ASTContext &Ctx, llvm::StringRef Message, const AttributeCommonInfo &CommonInfo); |
13720 | static UnavailableAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Message, SourceRange Range = {}, Spelling S = GNU_unavailable); |
13721 | static UnavailableAttr *Create(ASTContext &Ctx, llvm::StringRef Message, SourceRange Range = {}, Spelling S = GNU_unavailable); |
13722 | |
13723 | // Constructors |
13724 | UnavailableAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
13725 | , llvm::StringRef Message |
13726 | , UnavailableAttr::ImplicitReason ImplicitReason |
13727 | ); |
13728 | UnavailableAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
13729 | , llvm::StringRef Message |
13730 | ); |
13731 | UnavailableAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
13732 | ); |
13733 | |
13734 | UnavailableAttr *clone(ASTContext &C) const; |
13735 | void printPretty(raw_ostream &OS, |
13736 | const PrintingPolicy &Policy) const; |
13737 | const char *getSpelling() const; |
13738 | llvm::StringRef getMessage() const { |
13739 | return llvm::StringRef(message, messageLength); |
13740 | } |
13741 | unsigned getMessageLength() const { |
13742 | return messageLength; |
13743 | } |
13744 | void setMessage(ASTContext &C, llvm::StringRef S) { |
13745 | messageLength = S.size(); |
13746 | this->message = new (C, 1) char [messageLength]; |
13747 | if (!S.empty()) |
13748 | std::memcpy(dest: this->message, src: S.data(), n: messageLength); |
13749 | } |
13750 | |
13751 | UnavailableAttr::ImplicitReason getImplicitReason() const { |
13752 | return implicitReason; |
13753 | } |
13754 | |
13755 | |
13756 | |
13757 | static bool classof(const Attr *A) { return A->getKind() == attr::Unavailable; } |
13758 | }; |
13759 | |
13760 | class UninitializedAttr : public InheritableAttr { |
13761 | public: |
13762 | enum Spelling { |
13763 | GNU_uninitialized = 0, |
13764 | CXX11_clang_uninitialized = 1, |
13765 | SpellingNotCalculated = 15 |
13766 | |
13767 | }; |
13768 | |
13769 | // Factory methods |
13770 | static UninitializedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
13771 | static UninitializedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
13772 | static UninitializedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_uninitialized); |
13773 | static UninitializedAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_uninitialized); |
13774 | |
13775 | // Constructors |
13776 | UninitializedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
13777 | ); |
13778 | |
13779 | UninitializedAttr *clone(ASTContext &C) const; |
13780 | void printPretty(raw_ostream &OS, |
13781 | const PrintingPolicy &Policy) const; |
13782 | const char *getSpelling() const; |
13783 | |
13784 | |
13785 | static bool classof(const Attr *A) { return A->getKind() == attr::Uninitialized; } |
13786 | }; |
13787 | |
13788 | class UnlikelyAttr : public StmtAttr { |
13789 | public: |
13790 | enum Spelling { |
13791 | CXX11_unlikely = 0, |
13792 | C23_clang_unlikely = 1, |
13793 | SpellingNotCalculated = 15 |
13794 | |
13795 | }; |
13796 | |
13797 | // Factory methods |
13798 | static UnlikelyAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
13799 | static UnlikelyAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
13800 | static UnlikelyAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = CXX11_unlikely); |
13801 | static UnlikelyAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = CXX11_unlikely); |
13802 | |
13803 | // Constructors |
13804 | UnlikelyAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
13805 | ); |
13806 | |
13807 | UnlikelyAttr *clone(ASTContext &C) const; |
13808 | void printPretty(raw_ostream &OS, |
13809 | const PrintingPolicy &Policy) const; |
13810 | const char *getSpelling() const; |
13811 | |
13812 | |
13813 | static bool classof(const Attr *A) { return A->getKind() == attr::Unlikely; } |
13814 | }; |
13815 | |
13816 | class UnsafeBufferUsageAttr : public InheritableAttr { |
13817 | public: |
13818 | enum Spelling { |
13819 | GNU_unsafe_buffer_usage = 0, |
13820 | CXX11_clang_unsafe_buffer_usage = 1, |
13821 | C23_clang_unsafe_buffer_usage = 2, |
13822 | SpellingNotCalculated = 15 |
13823 | |
13824 | }; |
13825 | |
13826 | // Factory methods |
13827 | static UnsafeBufferUsageAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
13828 | static UnsafeBufferUsageAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
13829 | static UnsafeBufferUsageAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_unsafe_buffer_usage); |
13830 | static UnsafeBufferUsageAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_unsafe_buffer_usage); |
13831 | |
13832 | // Constructors |
13833 | UnsafeBufferUsageAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
13834 | ); |
13835 | |
13836 | UnsafeBufferUsageAttr *clone(ASTContext &C) const; |
13837 | void printPretty(raw_ostream &OS, |
13838 | const PrintingPolicy &Policy) const; |
13839 | const char *getSpelling() const; |
13840 | |
13841 | |
13842 | static bool classof(const Attr *A) { return A->getKind() == attr::UnsafeBufferUsage; } |
13843 | }; |
13844 | |
13845 | class UnusedAttr : public InheritableAttr { |
13846 | public: |
13847 | enum Spelling { |
13848 | CXX11_maybe_unused = 0, |
13849 | GNU_unused = 1, |
13850 | CXX11_gnu_unused = 2, |
13851 | C23_gnu_unused = 3, |
13852 | C23_maybe_unused = 4, |
13853 | SpellingNotCalculated = 15 |
13854 | |
13855 | }; |
13856 | |
13857 | // Factory methods |
13858 | static UnusedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
13859 | static UnusedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
13860 | static UnusedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = CXX11_maybe_unused); |
13861 | static UnusedAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = CXX11_maybe_unused); |
13862 | |
13863 | // Constructors |
13864 | UnusedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
13865 | ); |
13866 | |
13867 | UnusedAttr *clone(ASTContext &C) const; |
13868 | void printPretty(raw_ostream &OS, |
13869 | const PrintingPolicy &Policy) const; |
13870 | const char *getSpelling() const; |
13871 | Spelling getSemanticSpelling() const; |
13872 | |
13873 | |
13874 | static bool classof(const Attr *A) { return A->getKind() == attr::Unused; } |
13875 | }; |
13876 | |
13877 | class UseHandleAttr : public InheritableParamAttr { |
13878 | unsigned handleTypeLength; |
13879 | char *handleType; |
13880 | |
13881 | public: |
13882 | enum Spelling { |
13883 | GNU_use_handle = 0, |
13884 | CXX11_clang_use_handle = 1, |
13885 | C23_clang_use_handle = 2, |
13886 | SpellingNotCalculated = 15 |
13887 | |
13888 | }; |
13889 | |
13890 | // Factory methods |
13891 | static UseHandleAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef HandleType, const AttributeCommonInfo &CommonInfo); |
13892 | static UseHandleAttr *Create(ASTContext &Ctx, llvm::StringRef HandleType, const AttributeCommonInfo &CommonInfo); |
13893 | static UseHandleAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef HandleType, SourceRange Range = {}, Spelling S = GNU_use_handle); |
13894 | static UseHandleAttr *Create(ASTContext &Ctx, llvm::StringRef HandleType, SourceRange Range = {}, Spelling S = GNU_use_handle); |
13895 | |
13896 | // Constructors |
13897 | UseHandleAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
13898 | , llvm::StringRef HandleType |
13899 | ); |
13900 | |
13901 | UseHandleAttr *clone(ASTContext &C) const; |
13902 | void printPretty(raw_ostream &OS, |
13903 | const PrintingPolicy &Policy) const; |
13904 | const char *getSpelling() const; |
13905 | llvm::StringRef getHandleType() const { |
13906 | return llvm::StringRef(handleType, handleTypeLength); |
13907 | } |
13908 | unsigned getHandleTypeLength() const { |
13909 | return handleTypeLength; |
13910 | } |
13911 | void setHandleType(ASTContext &C, llvm::StringRef S) { |
13912 | handleTypeLength = S.size(); |
13913 | this->handleType = new (C, 1) char [handleTypeLength]; |
13914 | if (!S.empty()) |
13915 | std::memcpy(dest: this->handleType, src: S.data(), n: handleTypeLength); |
13916 | } |
13917 | |
13918 | |
13919 | |
13920 | static bool classof(const Attr *A) { return A->getKind() == attr::UseHandle; } |
13921 | }; |
13922 | |
13923 | class UsedAttr : public InheritableAttr { |
13924 | public: |
13925 | enum Spelling { |
13926 | GNU_used = 0, |
13927 | CXX11_gnu_used = 1, |
13928 | C23_gnu_used = 2, |
13929 | SpellingNotCalculated = 15 |
13930 | |
13931 | }; |
13932 | |
13933 | // Factory methods |
13934 | static UsedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
13935 | static UsedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
13936 | static UsedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_used); |
13937 | static UsedAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_used); |
13938 | |
13939 | // Constructors |
13940 | UsedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
13941 | ); |
13942 | |
13943 | UsedAttr *clone(ASTContext &C) const; |
13944 | void printPretty(raw_ostream &OS, |
13945 | const PrintingPolicy &Policy) const; |
13946 | const char *getSpelling() const; |
13947 | |
13948 | |
13949 | static bool classof(const Attr *A) { return A->getKind() == attr::Used; } |
13950 | }; |
13951 | |
13952 | class UsingIfExistsAttr : public InheritableAttr { |
13953 | public: |
13954 | enum Spelling { |
13955 | GNU_using_if_exists = 0, |
13956 | CXX11_clang_using_if_exists = 1, |
13957 | SpellingNotCalculated = 15 |
13958 | |
13959 | }; |
13960 | |
13961 | // Factory methods |
13962 | static UsingIfExistsAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
13963 | static UsingIfExistsAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
13964 | static UsingIfExistsAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_using_if_exists); |
13965 | static UsingIfExistsAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_using_if_exists); |
13966 | |
13967 | // Constructors |
13968 | UsingIfExistsAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
13969 | ); |
13970 | |
13971 | UsingIfExistsAttr *clone(ASTContext &C) const; |
13972 | void printPretty(raw_ostream &OS, |
13973 | const PrintingPolicy &Policy) const; |
13974 | const char *getSpelling() const; |
13975 | |
13976 | |
13977 | static bool classof(const Attr *A) { return A->getKind() == attr::UsingIfExists; } |
13978 | }; |
13979 | |
13980 | class UuidAttr : public InheritableAttr { |
13981 | unsigned guidLength; |
13982 | char *guid; |
13983 | |
13984 | MSGuidDecl * guidDecl; |
13985 | |
13986 | public: |
13987 | enum Spelling { |
13988 | Declspec_uuid = 0, |
13989 | Microsoft_uuid = 1, |
13990 | SpellingNotCalculated = 15 |
13991 | |
13992 | }; |
13993 | |
13994 | // Factory methods |
13995 | static UuidAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Guid, MSGuidDecl * GuidDecl, const AttributeCommonInfo &CommonInfo); |
13996 | static UuidAttr *Create(ASTContext &Ctx, llvm::StringRef Guid, MSGuidDecl * GuidDecl, const AttributeCommonInfo &CommonInfo); |
13997 | static UuidAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Guid, MSGuidDecl * GuidDecl, SourceRange Range = {}, Spelling S = Declspec_uuid); |
13998 | static UuidAttr *Create(ASTContext &Ctx, llvm::StringRef Guid, MSGuidDecl * GuidDecl, SourceRange Range = {}, Spelling S = Declspec_uuid); |
13999 | static UuidAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Guid, const AttributeCommonInfo &CommonInfo); |
14000 | static UuidAttr *Create(ASTContext &Ctx, llvm::StringRef Guid, const AttributeCommonInfo &CommonInfo); |
14001 | static UuidAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Guid, SourceRange Range = {}, Spelling S = Declspec_uuid); |
14002 | static UuidAttr *Create(ASTContext &Ctx, llvm::StringRef Guid, SourceRange Range = {}, Spelling S = Declspec_uuid); |
14003 | |
14004 | // Constructors |
14005 | UuidAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
14006 | , llvm::StringRef Guid |
14007 | , MSGuidDecl * GuidDecl |
14008 | ); |
14009 | UuidAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
14010 | , llvm::StringRef Guid |
14011 | ); |
14012 | |
14013 | UuidAttr *clone(ASTContext &C) const; |
14014 | void printPretty(raw_ostream &OS, |
14015 | const PrintingPolicy &Policy) const; |
14016 | const char *getSpelling() const; |
14017 | llvm::StringRef getGuid() const { |
14018 | return llvm::StringRef(guid, guidLength); |
14019 | } |
14020 | unsigned getGuidLength() const { |
14021 | return guidLength; |
14022 | } |
14023 | void setGuid(ASTContext &C, llvm::StringRef S) { |
14024 | guidLength = S.size(); |
14025 | this->guid = new (C, 1) char [guidLength]; |
14026 | if (!S.empty()) |
14027 | std::memcpy(dest: this->guid, src: S.data(), n: guidLength); |
14028 | } |
14029 | |
14030 | MSGuidDecl * getGuidDecl() const { |
14031 | return guidDecl; |
14032 | } |
14033 | |
14034 | |
14035 | |
14036 | static bool classof(const Attr *A) { return A->getKind() == attr::Uuid; } |
14037 | }; |
14038 | |
14039 | class VTablePointerAuthenticationAttr : public InheritableAttr { |
14040 | public: |
14041 | enum VPtrAuthKeyType { |
14042 | DefaultKey, |
14043 | NoKey, |
14044 | ProcessDependent, |
14045 | ProcessIndependent |
14046 | }; |
14047 | private: |
14048 | VTablePointerAuthenticationAttr::VPtrAuthKeyType key; |
14049 | |
14050 | public: |
14051 | enum AddressDiscriminationMode { |
14052 | DefaultAddressDiscrimination, |
14053 | NoAddressDiscrimination, |
14054 | AddressDiscrimination |
14055 | }; |
14056 | private: |
14057 | VTablePointerAuthenticationAttr::AddressDiscriminationMode addressDiscrimination; |
14058 | |
14059 | public: |
14060 | enum { |
14061 | , |
14062 | , |
14063 | TypeDiscrimination, |
14064 | CustomDiscrimination |
14065 | }; |
14066 | private: |
14067 | VTablePointerAuthenticationAttr::ExtraDiscrimination ; |
14068 | |
14069 | int customDiscriminationValue; |
14070 | |
14071 | public: |
14072 | enum Spelling { |
14073 | GNU_ptrauth_vtable_pointer = 0, |
14074 | CXX11_clang_ptrauth_vtable_pointer = 1, |
14075 | C23_clang_ptrauth_vtable_pointer = 2, |
14076 | SpellingNotCalculated = 15 |
14077 | |
14078 | }; |
14079 | |
14080 | // Factory methods |
14081 | static VTablePointerAuthenticationAttr *(ASTContext &Ctx, VTablePointerAuthenticationAttr::VPtrAuthKeyType Key, VTablePointerAuthenticationAttr::AddressDiscriminationMode AddressDiscrimination, VTablePointerAuthenticationAttr::ExtraDiscrimination , int CustomDiscriminationValue, const AttributeCommonInfo &CommonInfo); |
14082 | static VTablePointerAuthenticationAttr *(ASTContext &Ctx, VTablePointerAuthenticationAttr::VPtrAuthKeyType Key, VTablePointerAuthenticationAttr::AddressDiscriminationMode AddressDiscrimination, VTablePointerAuthenticationAttr::ExtraDiscrimination , int CustomDiscriminationValue, const AttributeCommonInfo &CommonInfo); |
14083 | static VTablePointerAuthenticationAttr *(ASTContext &Ctx, VTablePointerAuthenticationAttr::VPtrAuthKeyType Key, VTablePointerAuthenticationAttr::AddressDiscriminationMode AddressDiscrimination, VTablePointerAuthenticationAttr::ExtraDiscrimination , int CustomDiscriminationValue, SourceRange Range = {}, Spelling S = GNU_ptrauth_vtable_pointer); |
14084 | static VTablePointerAuthenticationAttr *(ASTContext &Ctx, VTablePointerAuthenticationAttr::VPtrAuthKeyType Key, VTablePointerAuthenticationAttr::AddressDiscriminationMode AddressDiscrimination, VTablePointerAuthenticationAttr::ExtraDiscrimination , int CustomDiscriminationValue, SourceRange Range = {}, Spelling S = GNU_ptrauth_vtable_pointer); |
14085 | |
14086 | // Constructors |
14087 | (ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
14088 | , VTablePointerAuthenticationAttr::VPtrAuthKeyType Key |
14089 | , VTablePointerAuthenticationAttr::AddressDiscriminationMode AddressDiscrimination |
14090 | , VTablePointerAuthenticationAttr::ExtraDiscrimination |
14091 | , int CustomDiscriminationValue |
14092 | ); |
14093 | (ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
14094 | , VTablePointerAuthenticationAttr::VPtrAuthKeyType Key |
14095 | , VTablePointerAuthenticationAttr::AddressDiscriminationMode AddressDiscrimination |
14096 | , VTablePointerAuthenticationAttr::ExtraDiscrimination |
14097 | ); |
14098 | |
14099 | VTablePointerAuthenticationAttr *clone(ASTContext &C) const; |
14100 | void printPretty(raw_ostream &OS, |
14101 | const PrintingPolicy &Policy) const; |
14102 | const char *getSpelling() const; |
14103 | VTablePointerAuthenticationAttr::VPtrAuthKeyType getKey() const { |
14104 | return key; |
14105 | } |
14106 | |
14107 | static bool ConvertStrToVPtrAuthKeyType(StringRef Val, VTablePointerAuthenticationAttr::VPtrAuthKeyType &Out); |
14108 | static const char *ConvertVPtrAuthKeyTypeToStr(VTablePointerAuthenticationAttr::VPtrAuthKeyType Val); |
14109 | VTablePointerAuthenticationAttr::AddressDiscriminationMode getAddressDiscrimination() const { |
14110 | return addressDiscrimination; |
14111 | } |
14112 | |
14113 | static bool ConvertStrToAddressDiscriminationMode(StringRef Val, VTablePointerAuthenticationAttr::AddressDiscriminationMode &Out); |
14114 | static const char *ConvertAddressDiscriminationModeToStr(VTablePointerAuthenticationAttr::AddressDiscriminationMode Val); |
14115 | VTablePointerAuthenticationAttr::ExtraDiscrimination () const { |
14116 | return extraDiscrimination; |
14117 | } |
14118 | |
14119 | static bool (StringRef Val, VTablePointerAuthenticationAttr::ExtraDiscrimination &Out); |
14120 | static const char *(VTablePointerAuthenticationAttr::ExtraDiscrimination Val); |
14121 | int getCustomDiscriminationValue() const { |
14122 | return customDiscriminationValue; |
14123 | } |
14124 | |
14125 | |
14126 | |
14127 | static bool classof(const Attr *A) { return A->getKind() == attr::VTablePointerAuthentication; } |
14128 | }; |
14129 | |
14130 | class VecReturnAttr : public InheritableAttr { |
14131 | public: |
14132 | enum Spelling { |
14133 | GNU_vecreturn = 0, |
14134 | CXX11_clang_vecreturn = 1, |
14135 | SpellingNotCalculated = 15 |
14136 | |
14137 | }; |
14138 | |
14139 | // Factory methods |
14140 | static VecReturnAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
14141 | static VecReturnAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
14142 | static VecReturnAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_vecreturn); |
14143 | static VecReturnAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_vecreturn); |
14144 | |
14145 | // Constructors |
14146 | VecReturnAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
14147 | ); |
14148 | |
14149 | VecReturnAttr *clone(ASTContext &C) const; |
14150 | void printPretty(raw_ostream &OS, |
14151 | const PrintingPolicy &Policy) const; |
14152 | const char *getSpelling() const; |
14153 | |
14154 | |
14155 | static bool classof(const Attr *A) { return A->getKind() == attr::VecReturn; } |
14156 | }; |
14157 | |
14158 | class VecTypeHintAttr : public InheritableAttr { |
14159 | TypeSourceInfo * typeHint; |
14160 | |
14161 | public: |
14162 | // Factory methods |
14163 | static VecTypeHintAttr *CreateImplicit(ASTContext &Ctx, TypeSourceInfo * TypeHint, const AttributeCommonInfo &CommonInfo); |
14164 | static VecTypeHintAttr *Create(ASTContext &Ctx, TypeSourceInfo * TypeHint, const AttributeCommonInfo &CommonInfo); |
14165 | static VecTypeHintAttr *CreateImplicit(ASTContext &Ctx, TypeSourceInfo * TypeHint, SourceRange Range = {}); |
14166 | static VecTypeHintAttr *Create(ASTContext &Ctx, TypeSourceInfo * TypeHint, SourceRange Range = {}); |
14167 | |
14168 | // Constructors |
14169 | VecTypeHintAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
14170 | , TypeSourceInfo * TypeHint |
14171 | ); |
14172 | |
14173 | VecTypeHintAttr *clone(ASTContext &C) const; |
14174 | void printPretty(raw_ostream &OS, |
14175 | const PrintingPolicy &Policy) const; |
14176 | const char *getSpelling() const; |
14177 | QualType getTypeHint() const { |
14178 | return typeHint->getType(); |
14179 | } TypeSourceInfo * getTypeHintLoc() const { |
14180 | return typeHint; |
14181 | } |
14182 | |
14183 | |
14184 | |
14185 | static bool classof(const Attr *A) { return A->getKind() == attr::VecTypeHint; } |
14186 | }; |
14187 | |
14188 | class VectorCallAttr : public InheritableAttr { |
14189 | public: |
14190 | enum Spelling { |
14191 | GNU_vectorcall = 0, |
14192 | CXX11_clang_vectorcall = 1, |
14193 | C23_clang_vectorcall = 2, |
14194 | Keyword_vectorcall = 3, |
14195 | SpellingNotCalculated = 15 |
14196 | |
14197 | }; |
14198 | |
14199 | // Factory methods |
14200 | static VectorCallAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
14201 | static VectorCallAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
14202 | static VectorCallAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_vectorcall); |
14203 | static VectorCallAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_vectorcall); |
14204 | |
14205 | // Constructors |
14206 | VectorCallAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
14207 | ); |
14208 | |
14209 | VectorCallAttr *clone(ASTContext &C) const; |
14210 | void printPretty(raw_ostream &OS, |
14211 | const PrintingPolicy &Policy) const; |
14212 | const char *getSpelling() const; |
14213 | |
14214 | |
14215 | static bool classof(const Attr *A) { return A->getKind() == attr::VectorCall; } |
14216 | }; |
14217 | |
14218 | class VisibilityAttr : public InheritableAttr { |
14219 | public: |
14220 | enum VisibilityType { |
14221 | Default, |
14222 | Hidden, |
14223 | Protected |
14224 | }; |
14225 | private: |
14226 | VisibilityAttr::VisibilityType visibility; |
14227 | |
14228 | public: |
14229 | enum Spelling { |
14230 | GNU_visibility = 0, |
14231 | CXX11_gnu_visibility = 1, |
14232 | C23_gnu_visibility = 2, |
14233 | SpellingNotCalculated = 15 |
14234 | |
14235 | }; |
14236 | |
14237 | // Factory methods |
14238 | static VisibilityAttr *CreateImplicit(ASTContext &Ctx, VisibilityAttr::VisibilityType Visibility, const AttributeCommonInfo &CommonInfo); |
14239 | static VisibilityAttr *Create(ASTContext &Ctx, VisibilityAttr::VisibilityType Visibility, const AttributeCommonInfo &CommonInfo); |
14240 | static VisibilityAttr *CreateImplicit(ASTContext &Ctx, VisibilityAttr::VisibilityType Visibility, SourceRange Range = {}, Spelling S = GNU_visibility); |
14241 | static VisibilityAttr *Create(ASTContext &Ctx, VisibilityAttr::VisibilityType Visibility, SourceRange Range = {}, Spelling S = GNU_visibility); |
14242 | |
14243 | // Constructors |
14244 | VisibilityAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
14245 | , VisibilityAttr::VisibilityType Visibility |
14246 | ); |
14247 | |
14248 | VisibilityAttr *clone(ASTContext &C) const; |
14249 | void printPretty(raw_ostream &OS, |
14250 | const PrintingPolicy &Policy) const; |
14251 | const char *getSpelling() const; |
14252 | VisibilityAttr::VisibilityType getVisibility() const { |
14253 | return visibility; |
14254 | } |
14255 | |
14256 | static bool ConvertStrToVisibilityType(StringRef Val, VisibilityAttr::VisibilityType &Out); |
14257 | static const char *ConvertVisibilityTypeToStr(VisibilityAttr::VisibilityType Val); |
14258 | |
14259 | |
14260 | static bool classof(const Attr *A) { return A->getKind() == attr::Visibility; } |
14261 | }; |
14262 | |
14263 | class WarnUnusedAttr : public InheritableAttr { |
14264 | public: |
14265 | enum Spelling { |
14266 | GNU_warn_unused = 0, |
14267 | CXX11_gnu_warn_unused = 1, |
14268 | C23_gnu_warn_unused = 2, |
14269 | SpellingNotCalculated = 15 |
14270 | |
14271 | }; |
14272 | |
14273 | // Factory methods |
14274 | static WarnUnusedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
14275 | static WarnUnusedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
14276 | static WarnUnusedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_warn_unused); |
14277 | static WarnUnusedAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_warn_unused); |
14278 | |
14279 | // Constructors |
14280 | WarnUnusedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
14281 | ); |
14282 | |
14283 | WarnUnusedAttr *clone(ASTContext &C) const; |
14284 | void printPretty(raw_ostream &OS, |
14285 | const PrintingPolicy &Policy) const; |
14286 | const char *getSpelling() const; |
14287 | |
14288 | |
14289 | static bool classof(const Attr *A) { return A->getKind() == attr::WarnUnused; } |
14290 | }; |
14291 | |
14292 | class WarnUnusedResultAttr : public InheritableAttr { |
14293 | unsigned messageLength; |
14294 | char *message; |
14295 | |
14296 | public: |
14297 | enum Spelling { |
14298 | CXX11_nodiscard = 0, |
14299 | C23_nodiscard = 1, |
14300 | CXX11_clang_warn_unused_result = 2, |
14301 | GNU_warn_unused_result = 3, |
14302 | CXX11_gnu_warn_unused_result = 4, |
14303 | C23_gnu_warn_unused_result = 5, |
14304 | SpellingNotCalculated = 15 |
14305 | |
14306 | }; |
14307 | |
14308 | // Factory methods |
14309 | static WarnUnusedResultAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Message, const AttributeCommonInfo &CommonInfo); |
14310 | static WarnUnusedResultAttr *Create(ASTContext &Ctx, llvm::StringRef Message, const AttributeCommonInfo &CommonInfo); |
14311 | static WarnUnusedResultAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Message, SourceRange Range = {}, Spelling S = CXX11_nodiscard); |
14312 | static WarnUnusedResultAttr *Create(ASTContext &Ctx, llvm::StringRef Message, SourceRange Range = {}, Spelling S = CXX11_nodiscard); |
14313 | |
14314 | // Constructors |
14315 | WarnUnusedResultAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
14316 | , llvm::StringRef Message |
14317 | ); |
14318 | WarnUnusedResultAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
14319 | ); |
14320 | |
14321 | WarnUnusedResultAttr *clone(ASTContext &C) const; |
14322 | void printPretty(raw_ostream &OS, |
14323 | const PrintingPolicy &Policy) const; |
14324 | const char *getSpelling() const; |
14325 | Spelling getSemanticSpelling() const; |
14326 | llvm::StringRef getMessage() const { |
14327 | return llvm::StringRef(message, messageLength); |
14328 | } |
14329 | unsigned getMessageLength() const { |
14330 | return messageLength; |
14331 | } |
14332 | void setMessage(ASTContext &C, llvm::StringRef S) { |
14333 | messageLength = S.size(); |
14334 | this->message = new (C, 1) char [messageLength]; |
14335 | if (!S.empty()) |
14336 | std::memcpy(dest: this->message, src: S.data(), n: messageLength); |
14337 | } |
14338 | |
14339 | |
14340 | // Check whether this the C++11 nodiscard version, even in non C++11 |
14341 | // spellings. |
14342 | bool IsCXX11NoDiscard() const { |
14343 | return this->getSemanticSpelling() == CXX11_nodiscard; |
14344 | } |
14345 | |
14346 | |
14347 | static bool classof(const Attr *A) { return A->getKind() == attr::WarnUnusedResult; } |
14348 | }; |
14349 | |
14350 | class WeakAttr : public InheritableAttr { |
14351 | public: |
14352 | enum Spelling { |
14353 | GNU_weak = 0, |
14354 | CXX11_gnu_weak = 1, |
14355 | C23_gnu_weak = 2, |
14356 | SpellingNotCalculated = 15 |
14357 | |
14358 | }; |
14359 | |
14360 | // Factory methods |
14361 | static WeakAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
14362 | static WeakAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
14363 | static WeakAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_weak); |
14364 | static WeakAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_weak); |
14365 | |
14366 | // Constructors |
14367 | WeakAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
14368 | ); |
14369 | |
14370 | WeakAttr *clone(ASTContext &C) const; |
14371 | void printPretty(raw_ostream &OS, |
14372 | const PrintingPolicy &Policy) const; |
14373 | const char *getSpelling() const; |
14374 | |
14375 | |
14376 | static bool classof(const Attr *A) { return A->getKind() == attr::Weak; } |
14377 | }; |
14378 | |
14379 | class WeakImportAttr : public InheritableAttr { |
14380 | public: |
14381 | enum Spelling { |
14382 | GNU_weak_import = 0, |
14383 | CXX11_clang_weak_import = 1, |
14384 | C23_clang_weak_import = 2, |
14385 | SpellingNotCalculated = 15 |
14386 | |
14387 | }; |
14388 | |
14389 | // Factory methods |
14390 | static WeakImportAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
14391 | static WeakImportAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
14392 | static WeakImportAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_weak_import); |
14393 | static WeakImportAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_weak_import); |
14394 | |
14395 | // Constructors |
14396 | WeakImportAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
14397 | ); |
14398 | |
14399 | WeakImportAttr *clone(ASTContext &C) const; |
14400 | void printPretty(raw_ostream &OS, |
14401 | const PrintingPolicy &Policy) const; |
14402 | const char *getSpelling() const; |
14403 | |
14404 | |
14405 | static bool classof(const Attr *A) { return A->getKind() == attr::WeakImport; } |
14406 | }; |
14407 | |
14408 | class WeakRefAttr : public InheritableAttr { |
14409 | unsigned aliaseeLength; |
14410 | char *aliasee; |
14411 | |
14412 | public: |
14413 | enum Spelling { |
14414 | GNU_weakref = 0, |
14415 | CXX11_gnu_weakref = 1, |
14416 | C23_gnu_weakref = 2, |
14417 | SpellingNotCalculated = 15 |
14418 | |
14419 | }; |
14420 | |
14421 | // Factory methods |
14422 | static WeakRefAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Aliasee, const AttributeCommonInfo &CommonInfo); |
14423 | static WeakRefAttr *Create(ASTContext &Ctx, llvm::StringRef Aliasee, const AttributeCommonInfo &CommonInfo); |
14424 | static WeakRefAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Aliasee, SourceRange Range = {}, Spelling S = GNU_weakref); |
14425 | static WeakRefAttr *Create(ASTContext &Ctx, llvm::StringRef Aliasee, SourceRange Range = {}, Spelling S = GNU_weakref); |
14426 | |
14427 | // Constructors |
14428 | WeakRefAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
14429 | , llvm::StringRef Aliasee |
14430 | ); |
14431 | WeakRefAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
14432 | ); |
14433 | |
14434 | WeakRefAttr *clone(ASTContext &C) const; |
14435 | void printPretty(raw_ostream &OS, |
14436 | const PrintingPolicy &Policy) const; |
14437 | const char *getSpelling() const; |
14438 | llvm::StringRef getAliasee() const { |
14439 | return llvm::StringRef(aliasee, aliaseeLength); |
14440 | } |
14441 | unsigned getAliaseeLength() const { |
14442 | return aliaseeLength; |
14443 | } |
14444 | void setAliasee(ASTContext &C, llvm::StringRef S) { |
14445 | aliaseeLength = S.size(); |
14446 | this->aliasee = new (C, 1) char [aliaseeLength]; |
14447 | if (!S.empty()) |
14448 | std::memcpy(dest: this->aliasee, src: S.data(), n: aliaseeLength); |
14449 | } |
14450 | |
14451 | |
14452 | |
14453 | static bool classof(const Attr *A) { return A->getKind() == attr::WeakRef; } |
14454 | }; |
14455 | |
14456 | class WebAssemblyExportNameAttr : public InheritableAttr { |
14457 | unsigned exportNameLength; |
14458 | char *exportName; |
14459 | |
14460 | public: |
14461 | enum Spelling { |
14462 | GNU_export_name = 0, |
14463 | CXX11_clang_export_name = 1, |
14464 | C23_clang_export_name = 2, |
14465 | SpellingNotCalculated = 15 |
14466 | |
14467 | }; |
14468 | |
14469 | // Factory methods |
14470 | static WebAssemblyExportNameAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef ExportName, const AttributeCommonInfo &CommonInfo); |
14471 | static WebAssemblyExportNameAttr *Create(ASTContext &Ctx, llvm::StringRef ExportName, const AttributeCommonInfo &CommonInfo); |
14472 | static WebAssemblyExportNameAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef ExportName, SourceRange Range = {}, Spelling S = GNU_export_name); |
14473 | static WebAssemblyExportNameAttr *Create(ASTContext &Ctx, llvm::StringRef ExportName, SourceRange Range = {}, Spelling S = GNU_export_name); |
14474 | |
14475 | // Constructors |
14476 | WebAssemblyExportNameAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
14477 | , llvm::StringRef ExportName |
14478 | ); |
14479 | |
14480 | WebAssemblyExportNameAttr *clone(ASTContext &C) const; |
14481 | void printPretty(raw_ostream &OS, |
14482 | const PrintingPolicy &Policy) const; |
14483 | const char *getSpelling() const; |
14484 | llvm::StringRef getExportName() const { |
14485 | return llvm::StringRef(exportName, exportNameLength); |
14486 | } |
14487 | unsigned getExportNameLength() const { |
14488 | return exportNameLength; |
14489 | } |
14490 | void setExportName(ASTContext &C, llvm::StringRef S) { |
14491 | exportNameLength = S.size(); |
14492 | this->exportName = new (C, 1) char [exportNameLength]; |
14493 | if (!S.empty()) |
14494 | std::memcpy(dest: this->exportName, src: S.data(), n: exportNameLength); |
14495 | } |
14496 | |
14497 | |
14498 | |
14499 | static bool classof(const Attr *A) { return A->getKind() == attr::WebAssemblyExportName; } |
14500 | }; |
14501 | |
14502 | class WebAssemblyFuncrefAttr : public TypeAttr { |
14503 | public: |
14504 | // Factory methods |
14505 | static WebAssemblyFuncrefAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
14506 | static WebAssemblyFuncrefAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
14507 | static WebAssemblyFuncrefAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}); |
14508 | static WebAssemblyFuncrefAttr *Create(ASTContext &Ctx, SourceRange Range = {}); |
14509 | |
14510 | // Constructors |
14511 | WebAssemblyFuncrefAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
14512 | ); |
14513 | |
14514 | WebAssemblyFuncrefAttr *clone(ASTContext &C) const; |
14515 | void printPretty(raw_ostream &OS, |
14516 | const PrintingPolicy &Policy) const; |
14517 | const char *getSpelling() const; |
14518 | |
14519 | |
14520 | static bool classof(const Attr *A) { return A->getKind() == attr::WebAssemblyFuncref; } |
14521 | }; |
14522 | |
14523 | class WebAssemblyImportModuleAttr : public InheritableAttr { |
14524 | unsigned importModuleLength; |
14525 | char *importModule; |
14526 | |
14527 | public: |
14528 | enum Spelling { |
14529 | GNU_import_module = 0, |
14530 | CXX11_clang_import_module = 1, |
14531 | C23_clang_import_module = 2, |
14532 | SpellingNotCalculated = 15 |
14533 | |
14534 | }; |
14535 | |
14536 | // Factory methods |
14537 | static WebAssemblyImportModuleAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef ImportModule, const AttributeCommonInfo &CommonInfo); |
14538 | static WebAssemblyImportModuleAttr *Create(ASTContext &Ctx, llvm::StringRef ImportModule, const AttributeCommonInfo &CommonInfo); |
14539 | static WebAssemblyImportModuleAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef ImportModule, SourceRange Range = {}, Spelling S = GNU_import_module); |
14540 | static WebAssemblyImportModuleAttr *Create(ASTContext &Ctx, llvm::StringRef ImportModule, SourceRange Range = {}, Spelling S = GNU_import_module); |
14541 | |
14542 | // Constructors |
14543 | WebAssemblyImportModuleAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
14544 | , llvm::StringRef ImportModule |
14545 | ); |
14546 | |
14547 | WebAssemblyImportModuleAttr *clone(ASTContext &C) const; |
14548 | void printPretty(raw_ostream &OS, |
14549 | const PrintingPolicy &Policy) const; |
14550 | const char *getSpelling() const; |
14551 | llvm::StringRef getImportModule() const { |
14552 | return llvm::StringRef(importModule, importModuleLength); |
14553 | } |
14554 | unsigned getImportModuleLength() const { |
14555 | return importModuleLength; |
14556 | } |
14557 | void setImportModule(ASTContext &C, llvm::StringRef S) { |
14558 | importModuleLength = S.size(); |
14559 | this->importModule = new (C, 1) char [importModuleLength]; |
14560 | if (!S.empty()) |
14561 | std::memcpy(dest: this->importModule, src: S.data(), n: importModuleLength); |
14562 | } |
14563 | |
14564 | |
14565 | |
14566 | static bool classof(const Attr *A) { return A->getKind() == attr::WebAssemblyImportModule; } |
14567 | }; |
14568 | |
14569 | class WebAssemblyImportNameAttr : public InheritableAttr { |
14570 | unsigned importNameLength; |
14571 | char *importName; |
14572 | |
14573 | public: |
14574 | enum Spelling { |
14575 | GNU_import_name = 0, |
14576 | CXX11_clang_import_name = 1, |
14577 | C23_clang_import_name = 2, |
14578 | SpellingNotCalculated = 15 |
14579 | |
14580 | }; |
14581 | |
14582 | // Factory methods |
14583 | static WebAssemblyImportNameAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef ImportName, const AttributeCommonInfo &CommonInfo); |
14584 | static WebAssemblyImportNameAttr *Create(ASTContext &Ctx, llvm::StringRef ImportName, const AttributeCommonInfo &CommonInfo); |
14585 | static WebAssemblyImportNameAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef ImportName, SourceRange Range = {}, Spelling S = GNU_import_name); |
14586 | static WebAssemblyImportNameAttr *Create(ASTContext &Ctx, llvm::StringRef ImportName, SourceRange Range = {}, Spelling S = GNU_import_name); |
14587 | |
14588 | // Constructors |
14589 | WebAssemblyImportNameAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
14590 | , llvm::StringRef ImportName |
14591 | ); |
14592 | |
14593 | WebAssemblyImportNameAttr *clone(ASTContext &C) const; |
14594 | void printPretty(raw_ostream &OS, |
14595 | const PrintingPolicy &Policy) const; |
14596 | const char *getSpelling() const; |
14597 | llvm::StringRef getImportName() const { |
14598 | return llvm::StringRef(importName, importNameLength); |
14599 | } |
14600 | unsigned getImportNameLength() const { |
14601 | return importNameLength; |
14602 | } |
14603 | void setImportName(ASTContext &C, llvm::StringRef S) { |
14604 | importNameLength = S.size(); |
14605 | this->importName = new (C, 1) char [importNameLength]; |
14606 | if (!S.empty()) |
14607 | std::memcpy(dest: this->importName, src: S.data(), n: importNameLength); |
14608 | } |
14609 | |
14610 | |
14611 | |
14612 | static bool classof(const Attr *A) { return A->getKind() == attr::WebAssemblyImportName; } |
14613 | }; |
14614 | |
14615 | class WorkGroupSizeHintAttr : public InheritableAttr { |
14616 | unsigned xDim; |
14617 | |
14618 | unsigned yDim; |
14619 | |
14620 | unsigned zDim; |
14621 | |
14622 | public: |
14623 | // Factory methods |
14624 | static WorkGroupSizeHintAttr *CreateImplicit(ASTContext &Ctx, unsigned XDim, unsigned YDim, unsigned ZDim, const AttributeCommonInfo &CommonInfo); |
14625 | static WorkGroupSizeHintAttr *Create(ASTContext &Ctx, unsigned XDim, unsigned YDim, unsigned ZDim, const AttributeCommonInfo &CommonInfo); |
14626 | static WorkGroupSizeHintAttr *CreateImplicit(ASTContext &Ctx, unsigned XDim, unsigned YDim, unsigned ZDim, SourceRange Range = {}); |
14627 | static WorkGroupSizeHintAttr *Create(ASTContext &Ctx, unsigned XDim, unsigned YDim, unsigned ZDim, SourceRange Range = {}); |
14628 | |
14629 | // Constructors |
14630 | WorkGroupSizeHintAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
14631 | , unsigned XDim |
14632 | , unsigned YDim |
14633 | , unsigned ZDim |
14634 | ); |
14635 | |
14636 | WorkGroupSizeHintAttr *clone(ASTContext &C) const; |
14637 | void printPretty(raw_ostream &OS, |
14638 | const PrintingPolicy &Policy) const; |
14639 | const char *getSpelling() const; |
14640 | unsigned getXDim() const { |
14641 | return xDim; |
14642 | } |
14643 | |
14644 | unsigned getYDim() const { |
14645 | return yDim; |
14646 | } |
14647 | |
14648 | unsigned getZDim() const { |
14649 | return zDim; |
14650 | } |
14651 | |
14652 | |
14653 | |
14654 | static bool classof(const Attr *A) { return A->getKind() == attr::WorkGroupSizeHint; } |
14655 | }; |
14656 | |
14657 | class X86ForceAlignArgPointerAttr : public InheritableAttr { |
14658 | public: |
14659 | enum Spelling { |
14660 | GNU_force_align_arg_pointer = 0, |
14661 | CXX11_gnu_force_align_arg_pointer = 1, |
14662 | C23_gnu_force_align_arg_pointer = 2, |
14663 | SpellingNotCalculated = 15 |
14664 | |
14665 | }; |
14666 | |
14667 | // Factory methods |
14668 | static X86ForceAlignArgPointerAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
14669 | static X86ForceAlignArgPointerAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
14670 | static X86ForceAlignArgPointerAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_force_align_arg_pointer); |
14671 | static X86ForceAlignArgPointerAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_force_align_arg_pointer); |
14672 | |
14673 | // Constructors |
14674 | X86ForceAlignArgPointerAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
14675 | ); |
14676 | |
14677 | X86ForceAlignArgPointerAttr *clone(ASTContext &C) const; |
14678 | void printPretty(raw_ostream &OS, |
14679 | const PrintingPolicy &Policy) const; |
14680 | const char *getSpelling() const; |
14681 | |
14682 | |
14683 | static bool classof(const Attr *A) { return A->getKind() == attr::X86ForceAlignArgPointer; } |
14684 | }; |
14685 | |
14686 | class XRayInstrumentAttr : public InheritableAttr { |
14687 | public: |
14688 | enum Spelling { |
14689 | GNU_xray_always_instrument = 0, |
14690 | CXX11_clang_xray_always_instrument = 1, |
14691 | C23_clang_xray_always_instrument = 2, |
14692 | GNU_xray_never_instrument = 3, |
14693 | CXX11_clang_xray_never_instrument = 4, |
14694 | C23_clang_xray_never_instrument = 5, |
14695 | SpellingNotCalculated = 15 |
14696 | |
14697 | }; |
14698 | |
14699 | // Factory methods |
14700 | static XRayInstrumentAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
14701 | static XRayInstrumentAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo); |
14702 | static XRayInstrumentAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_xray_always_instrument); |
14703 | static XRayInstrumentAttr *Create(ASTContext &Ctx, SourceRange Range = {}, Spelling S = GNU_xray_always_instrument); |
14704 | |
14705 | // Constructors |
14706 | XRayInstrumentAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
14707 | ); |
14708 | |
14709 | XRayInstrumentAttr *clone(ASTContext &C) const; |
14710 | void printPretty(raw_ostream &OS, |
14711 | const PrintingPolicy &Policy) const; |
14712 | const char *getSpelling() const; |
14713 | Spelling getSemanticSpelling() const; |
14714 | bool alwaysXRayInstrument() const { return getAttributeSpellingListIndex() == 0 || |
14715 | getAttributeSpellingListIndex() == 1 || |
14716 | getAttributeSpellingListIndex() == 2; } |
14717 | bool neverXRayInstrument() const { return getAttributeSpellingListIndex() == 3 || |
14718 | getAttributeSpellingListIndex() == 4 || |
14719 | getAttributeSpellingListIndex() == 5; } |
14720 | |
14721 | |
14722 | static bool classof(const Attr *A) { return A->getKind() == attr::XRayInstrument; } |
14723 | }; |
14724 | |
14725 | class XRayLogArgsAttr : public InheritableAttr { |
14726 | unsigned argumentCount; |
14727 | |
14728 | public: |
14729 | enum Spelling { |
14730 | GNU_xray_log_args = 0, |
14731 | CXX11_clang_xray_log_args = 1, |
14732 | C23_clang_xray_log_args = 2, |
14733 | SpellingNotCalculated = 15 |
14734 | |
14735 | }; |
14736 | |
14737 | // Factory methods |
14738 | static XRayLogArgsAttr *CreateImplicit(ASTContext &Ctx, unsigned ArgumentCount, const AttributeCommonInfo &CommonInfo); |
14739 | static XRayLogArgsAttr *Create(ASTContext &Ctx, unsigned ArgumentCount, const AttributeCommonInfo &CommonInfo); |
14740 | static XRayLogArgsAttr *CreateImplicit(ASTContext &Ctx, unsigned ArgumentCount, SourceRange Range = {}, Spelling S = GNU_xray_log_args); |
14741 | static XRayLogArgsAttr *Create(ASTContext &Ctx, unsigned ArgumentCount, SourceRange Range = {}, Spelling S = GNU_xray_log_args); |
14742 | |
14743 | // Constructors |
14744 | XRayLogArgsAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
14745 | , unsigned ArgumentCount |
14746 | ); |
14747 | |
14748 | XRayLogArgsAttr *clone(ASTContext &C) const; |
14749 | void printPretty(raw_ostream &OS, |
14750 | const PrintingPolicy &Policy) const; |
14751 | const char *getSpelling() const; |
14752 | unsigned getArgumentCount() const { |
14753 | return argumentCount; |
14754 | } |
14755 | |
14756 | |
14757 | |
14758 | static bool classof(const Attr *A) { return A->getKind() == attr::XRayLogArgs; } |
14759 | }; |
14760 | |
14761 | class ZeroCallUsedRegsAttr : public InheritableAttr { |
14762 | public: |
14763 | enum ZeroCallUsedRegsKind { |
14764 | Skip, |
14765 | UsedGPRArg, |
14766 | UsedGPR, |
14767 | UsedArg, |
14768 | Used, |
14769 | AllGPRArg, |
14770 | AllGPR, |
14771 | AllArg, |
14772 | All |
14773 | }; |
14774 | private: |
14775 | ZeroCallUsedRegsAttr::ZeroCallUsedRegsKind zeroCallUsedRegs; |
14776 | |
14777 | public: |
14778 | enum Spelling { |
14779 | GNU_zero_call_used_regs = 0, |
14780 | CXX11_gnu_zero_call_used_regs = 1, |
14781 | C23_gnu_zero_call_used_regs = 2, |
14782 | SpellingNotCalculated = 15 |
14783 | |
14784 | }; |
14785 | |
14786 | // Factory methods |
14787 | static ZeroCallUsedRegsAttr *CreateImplicit(ASTContext &Ctx, ZeroCallUsedRegsAttr::ZeroCallUsedRegsKind ZeroCallUsedRegs, const AttributeCommonInfo &CommonInfo); |
14788 | static ZeroCallUsedRegsAttr *Create(ASTContext &Ctx, ZeroCallUsedRegsAttr::ZeroCallUsedRegsKind ZeroCallUsedRegs, const AttributeCommonInfo &CommonInfo); |
14789 | static ZeroCallUsedRegsAttr *CreateImplicit(ASTContext &Ctx, ZeroCallUsedRegsAttr::ZeroCallUsedRegsKind ZeroCallUsedRegs, SourceRange Range = {}, Spelling S = GNU_zero_call_used_regs); |
14790 | static ZeroCallUsedRegsAttr *Create(ASTContext &Ctx, ZeroCallUsedRegsAttr::ZeroCallUsedRegsKind ZeroCallUsedRegs, SourceRange Range = {}, Spelling S = GNU_zero_call_used_regs); |
14791 | |
14792 | // Constructors |
14793 | ZeroCallUsedRegsAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo |
14794 | , ZeroCallUsedRegsAttr::ZeroCallUsedRegsKind ZeroCallUsedRegs |
14795 | ); |
14796 | |
14797 | ZeroCallUsedRegsAttr *clone(ASTContext &C) const; |
14798 | void printPretty(raw_ostream &OS, |
14799 | const PrintingPolicy &Policy) const; |
14800 | const char *getSpelling() const; |
14801 | ZeroCallUsedRegsAttr::ZeroCallUsedRegsKind getZeroCallUsedRegs() const { |
14802 | return zeroCallUsedRegs; |
14803 | } |
14804 | |
14805 | static bool ConvertStrToZeroCallUsedRegsKind(StringRef Val, ZeroCallUsedRegsAttr::ZeroCallUsedRegsKind &Out); |
14806 | static const char *ConvertZeroCallUsedRegsKindToStr(ZeroCallUsedRegsAttr::ZeroCallUsedRegsKind Val); |
14807 | |
14808 | |
14809 | static bool classof(const Attr *A) { return A->getKind() == attr::ZeroCallUsedRegs; } |
14810 | }; |
14811 | |
14812 | #endif // LLVM_CLANG_ATTR_CLASSES_INC |
14813 | |