Subversion Repositories QNX 8.QNX8 LLVM/Clang compiler suite

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
14 pmbaty 1
/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2
|*                                                                            *|
3
|* Attribute classes' definitions                                             *|
4
|*                                                                            *|
5
|* Automatically generated file, do not edit!                                 *|
6
|*                                                                            *|
7
\*===----------------------------------------------------------------------===*/
8
 
9
#ifndef LLVM_CLANG_ATTR_CLASSES_INC
10
#define LLVM_CLANG_ATTR_CLASSES_INC
11
 
12
static inline void DelimitAttributeArgument(raw_ostream& OS, bool& IsFirst) {
13
  if (IsFirst) {
14
    IsFirst = false;
15
    OS << "(";
16
  } else
17
    OS << ", ";
18
}
19
class AArch64SVEPcsAttr : public InheritableAttr {
20
public:
21
  enum Spelling {
22
    GNU_aarch64_sve_pcs = 0,
23
    CXX11_clang_aarch64_sve_pcs = 1,
24
    C2x_clang_aarch64_sve_pcs = 2,
25
  SpellingNotCalculated = 15
26
 
27
  };
28
 
29
  // Factory methods
30
  static AArch64SVEPcsAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
31
  static AArch64SVEPcsAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
32
  static AArch64SVEPcsAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
33
  static AArch64SVEPcsAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
34
 
35
  // Constructors
36
  AArch64SVEPcsAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
37
             );
38
 
39
  AArch64SVEPcsAttr *clone(ASTContext &C) const;
40
  void printPretty(raw_ostream &OS,
41
                   const PrintingPolicy &Policy) const;
42
  const char *getSpelling() const;
43
 
44
 
45
  static bool classof(const Attr *A) { return A->getKind() == attr::AArch64SVEPcs; }
46
};
47
 
48
class AArch64VectorPcsAttr : public InheritableAttr {
49
public:
50
  enum Spelling {
51
    GNU_aarch64_vector_pcs = 0,
52
    CXX11_clang_aarch64_vector_pcs = 1,
53
    C2x_clang_aarch64_vector_pcs = 2,
54
  SpellingNotCalculated = 15
55
 
56
  };
57
 
58
  // Factory methods
59
  static AArch64VectorPcsAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
60
  static AArch64VectorPcsAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
61
  static AArch64VectorPcsAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
62
  static AArch64VectorPcsAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
63
 
64
  // Constructors
65
  AArch64VectorPcsAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
66
             );
67
 
68
  AArch64VectorPcsAttr *clone(ASTContext &C) const;
69
  void printPretty(raw_ostream &OS,
70
                   const PrintingPolicy &Policy) const;
71
  const char *getSpelling() const;
72
 
73
 
74
  static bool classof(const Attr *A) { return A->getKind() == attr::AArch64VectorPcs; }
75
};
76
 
77
class AMDGPUFlatWorkGroupSizeAttr : public InheritableAttr {
78
Expr * min;
79
 
80
Expr * max;
81
 
82
public:
83
  enum Spelling {
84
    GNU_amdgpu_flat_work_group_size = 0,
85
    CXX11_clang_amdgpu_flat_work_group_size = 1,
86
  SpellingNotCalculated = 15
87
 
88
  };
89
 
90
  // Factory methods
91
  static AMDGPUFlatWorkGroupSizeAttr *CreateImplicit(ASTContext &Ctx, Expr * Min, Expr * Max, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
92
  static AMDGPUFlatWorkGroupSizeAttr *Create(ASTContext &Ctx, Expr * Min, Expr * Max, const AttributeCommonInfo &CommonInfo);
93
  static AMDGPUFlatWorkGroupSizeAttr *CreateImplicit(ASTContext &Ctx, Expr * Min, Expr * Max, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
94
  static AMDGPUFlatWorkGroupSizeAttr *Create(ASTContext &Ctx, Expr * Min, Expr * Max, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
95
 
96
  // Constructors
97
  AMDGPUFlatWorkGroupSizeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
98
              , Expr * Min
99
              , Expr * Max
100
             );
101
 
102
  AMDGPUFlatWorkGroupSizeAttr *clone(ASTContext &C) const;
103
  void printPretty(raw_ostream &OS,
104
                   const PrintingPolicy &Policy) const;
105
  const char *getSpelling() const;
106
  Expr * getMin() const {
107
    return min;
108
  }
109
 
110
  Expr * getMax() const {
111
    return max;
112
  }
113
 
114
 
115
 
116
  static bool classof(const Attr *A) { return A->getKind() == attr::AMDGPUFlatWorkGroupSize; }
117
};
118
 
119
class AMDGPUKernelCallAttr : public InheritableAttr {
120
public:
121
  enum Spelling {
122
    GNU_amdgpu_kernel = 0,
123
    CXX11_clang_amdgpu_kernel = 1,
124
    C2x_clang_amdgpu_kernel = 2,
125
  SpellingNotCalculated = 15
126
 
127
  };
128
 
129
  // Factory methods
130
  static AMDGPUKernelCallAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
131
  static AMDGPUKernelCallAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
132
  static AMDGPUKernelCallAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
133
  static AMDGPUKernelCallAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
134
 
135
  // Constructors
136
  AMDGPUKernelCallAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
137
             );
138
 
139
  AMDGPUKernelCallAttr *clone(ASTContext &C) const;
140
  void printPretty(raw_ostream &OS,
141
                   const PrintingPolicy &Policy) const;
142
  const char *getSpelling() const;
143
 
144
 
145
  static bool classof(const Attr *A) { return A->getKind() == attr::AMDGPUKernelCall; }
146
};
147
 
148
class AMDGPUNumSGPRAttr : public InheritableAttr {
149
unsigned numSGPR;
150
 
151
public:
152
  enum Spelling {
153
    GNU_amdgpu_num_sgpr = 0,
154
    CXX11_clang_amdgpu_num_sgpr = 1,
155
  SpellingNotCalculated = 15
156
 
157
  };
158
 
159
  // Factory methods
160
  static AMDGPUNumSGPRAttr *CreateImplicit(ASTContext &Ctx, unsigned NumSGPR, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
161
  static AMDGPUNumSGPRAttr *Create(ASTContext &Ctx, unsigned NumSGPR, const AttributeCommonInfo &CommonInfo);
162
  static AMDGPUNumSGPRAttr *CreateImplicit(ASTContext &Ctx, unsigned NumSGPR, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
163
  static AMDGPUNumSGPRAttr *Create(ASTContext &Ctx, unsigned NumSGPR, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
164
 
165
  // Constructors
166
  AMDGPUNumSGPRAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
167
              , unsigned NumSGPR
168
             );
169
 
170
  AMDGPUNumSGPRAttr *clone(ASTContext &C) const;
171
  void printPretty(raw_ostream &OS,
172
                   const PrintingPolicy &Policy) const;
173
  const char *getSpelling() const;
174
  unsigned getNumSGPR() const {
175
    return numSGPR;
176
  }
177
 
178
 
179
 
180
  static bool classof(const Attr *A) { return A->getKind() == attr::AMDGPUNumSGPR; }
181
};
182
 
183
class AMDGPUNumVGPRAttr : public InheritableAttr {
184
unsigned numVGPR;
185
 
186
public:
187
  enum Spelling {
188
    GNU_amdgpu_num_vgpr = 0,
189
    CXX11_clang_amdgpu_num_vgpr = 1,
190
  SpellingNotCalculated = 15
191
 
192
  };
193
 
194
  // Factory methods
195
  static AMDGPUNumVGPRAttr *CreateImplicit(ASTContext &Ctx, unsigned NumVGPR, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
196
  static AMDGPUNumVGPRAttr *Create(ASTContext &Ctx, unsigned NumVGPR, const AttributeCommonInfo &CommonInfo);
197
  static AMDGPUNumVGPRAttr *CreateImplicit(ASTContext &Ctx, unsigned NumVGPR, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
198
  static AMDGPUNumVGPRAttr *Create(ASTContext &Ctx, unsigned NumVGPR, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
199
 
200
  // Constructors
201
  AMDGPUNumVGPRAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
202
              , unsigned NumVGPR
203
             );
204
 
205
  AMDGPUNumVGPRAttr *clone(ASTContext &C) const;
206
  void printPretty(raw_ostream &OS,
207
                   const PrintingPolicy &Policy) const;
208
  const char *getSpelling() const;
209
  unsigned getNumVGPR() const {
210
    return numVGPR;
211
  }
212
 
213
 
214
 
215
  static bool classof(const Attr *A) { return A->getKind() == attr::AMDGPUNumVGPR; }
216
};
217
 
218
class AMDGPUWavesPerEUAttr : public InheritableAttr {
219
Expr * min;
220
 
221
Expr * max;
222
 
223
public:
224
  enum Spelling {
225
    GNU_amdgpu_waves_per_eu = 0,
226
    CXX11_clang_amdgpu_waves_per_eu = 1,
227
  SpellingNotCalculated = 15
228
 
229
  };
230
 
231
  // Factory methods
232
  static AMDGPUWavesPerEUAttr *CreateImplicit(ASTContext &Ctx, Expr * Min, Expr * Max, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
233
  static AMDGPUWavesPerEUAttr *Create(ASTContext &Ctx, Expr * Min, Expr * Max, const AttributeCommonInfo &CommonInfo);
234
  static AMDGPUWavesPerEUAttr *CreateImplicit(ASTContext &Ctx, Expr * Min, Expr * Max, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
235
  static AMDGPUWavesPerEUAttr *Create(ASTContext &Ctx, Expr * Min, Expr * Max, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
236
 
237
  // Constructors
238
  AMDGPUWavesPerEUAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
239
              , Expr * Min
240
              , Expr * Max
241
             );
242
  AMDGPUWavesPerEUAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
243
              , Expr * Min
244
             );
245
 
246
  AMDGPUWavesPerEUAttr *clone(ASTContext &C) const;
247
  void printPretty(raw_ostream &OS,
248
                   const PrintingPolicy &Policy) const;
249
  const char *getSpelling() const;
250
  Expr * getMin() const {
251
    return min;
252
  }
253
 
254
  Expr * getMax() const {
255
    return max;
256
  }
257
 
258
 
259
 
260
  static bool classof(const Attr *A) { return A->getKind() == attr::AMDGPUWavesPerEU; }
261
};
262
 
263
class ARMInterruptAttr : public InheritableAttr {
264
public:
265
  enum InterruptType {
266
    IRQ,
267
    FIQ,
268
    SWI,
269
    ABORT,
270
    UNDEF,
271
    Generic
272
  };
273
private:
274
  InterruptType interrupt;
275
 
276
public:
277
  enum Spelling {
278
    GNU_interrupt = 0,
279
    CXX11_gnu_interrupt = 1,
280
    C2x_gnu_interrupt = 2,
281
  SpellingNotCalculated = 15
282
 
283
  };
284
 
285
  // Factory methods
286
  static ARMInterruptAttr *CreateImplicit(ASTContext &Ctx, InterruptType Interrupt, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
287
  static ARMInterruptAttr *Create(ASTContext &Ctx, InterruptType Interrupt, const AttributeCommonInfo &CommonInfo);
288
  static ARMInterruptAttr *CreateImplicit(ASTContext &Ctx, InterruptType Interrupt, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
289
  static ARMInterruptAttr *Create(ASTContext &Ctx, InterruptType Interrupt, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
290
 
291
  // Constructors
292
  ARMInterruptAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
293
              , InterruptType Interrupt
294
             );
295
  ARMInterruptAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
296
             );
297
 
298
  ARMInterruptAttr *clone(ASTContext &C) const;
299
  void printPretty(raw_ostream &OS,
300
                   const PrintingPolicy &Policy) const;
301
  const char *getSpelling() const;
302
  InterruptType getInterrupt() const {
303
    return interrupt;
304
  }
305
 
306
  static bool ConvertStrToInterruptType(StringRef Val, InterruptType &Out);
307
  static const char *ConvertInterruptTypeToStr(InterruptType Val);
308
 
309
 
310
  static bool classof(const Attr *A) { return A->getKind() == attr::ARMInterrupt; }
311
};
312
 
313
class AVRInterruptAttr : public InheritableAttr {
314
public:
315
  enum Spelling {
316
    GNU_interrupt = 0,
317
    CXX11_gnu_interrupt = 1,
318
    C2x_gnu_interrupt = 2,
319
  SpellingNotCalculated = 15
320
 
321
  };
322
 
323
  // Factory methods
324
  static AVRInterruptAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
325
  static AVRInterruptAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
326
  static AVRInterruptAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
327
  static AVRInterruptAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
328
 
329
  // Constructors
330
  AVRInterruptAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
331
             );
332
 
333
  AVRInterruptAttr *clone(ASTContext &C) const;
334
  void printPretty(raw_ostream &OS,
335
                   const PrintingPolicy &Policy) const;
336
  const char *getSpelling() const;
337
 
338
 
339
  static bool classof(const Attr *A) { return A->getKind() == attr::AVRInterrupt; }
340
};
341
 
342
class AVRSignalAttr : public InheritableAttr {
343
public:
344
  enum Spelling {
345
    GNU_signal = 0,
346
    CXX11_gnu_signal = 1,
347
    C2x_gnu_signal = 2,
348
  SpellingNotCalculated = 15
349
 
350
  };
351
 
352
  // Factory methods
353
  static AVRSignalAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
354
  static AVRSignalAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
355
  static AVRSignalAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
356
  static AVRSignalAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
357
 
358
  // Constructors
359
  AVRSignalAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
360
             );
361
 
362
  AVRSignalAttr *clone(ASTContext &C) const;
363
  void printPretty(raw_ostream &OS,
364
                   const PrintingPolicy &Policy) const;
365
  const char *getSpelling() const;
366
 
367
 
368
  static bool classof(const Attr *A) { return A->getKind() == attr::AVRSignal; }
369
};
370
 
371
class AbiTagAttr : public Attr {
372
  unsigned tags_Size;
373
  StringRef *tags_;
374
 
375
public:
376
  enum Spelling {
377
    GNU_abi_tag = 0,
378
    CXX11_gnu_abi_tag = 1,
379
  SpellingNotCalculated = 15
380
 
381
  };
382
 
383
  // Factory methods
384
  static AbiTagAttr *CreateImplicit(ASTContext &Ctx, StringRef *Tags, unsigned TagsSize, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
385
  static AbiTagAttr *Create(ASTContext &Ctx, StringRef *Tags, unsigned TagsSize, const AttributeCommonInfo &CommonInfo);
386
  static AbiTagAttr *CreateImplicit(ASTContext &Ctx, StringRef *Tags, unsigned TagsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
387
  static AbiTagAttr *Create(ASTContext &Ctx, StringRef *Tags, unsigned TagsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
388
 
389
  // Constructors
390
  AbiTagAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
391
              , StringRef *Tags, unsigned TagsSize
392
             );
393
  AbiTagAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
394
             );
395
 
396
  AbiTagAttr *clone(ASTContext &C) const;
397
  void printPretty(raw_ostream &OS,
398
                   const PrintingPolicy &Policy) const;
399
  const char *getSpelling() const;
400
  typedef StringRef* tags_iterator;
401
  tags_iterator tags_begin() const { return tags_; }
402
  tags_iterator tags_end() const { return tags_ + tags_Size; }
403
  unsigned tags_size() const { return tags_Size; }
404
  llvm::iterator_range<tags_iterator> tags() const { return llvm::make_range(tags_begin(), tags_end()); }
405
 
406
 
407
 
408
 
409
  static bool classof(const Attr *A) { return A->getKind() == attr::AbiTag; }
410
};
411
 
412
class AcquireCapabilityAttr : public InheritableAttr {
413
  unsigned args_Size;
414
  Expr * *args_;
415
 
416
public:
417
  enum Spelling {
418
    GNU_acquire_capability = 0,
419
    CXX11_clang_acquire_capability = 1,
420
    GNU_acquire_shared_capability = 2,
421
    CXX11_clang_acquire_shared_capability = 3,
422
    GNU_exclusive_lock_function = 4,
423
    GNU_shared_lock_function = 5,
424
  SpellingNotCalculated = 15
425
 
426
  };
427
 
428
  // Factory methods
429
  static AcquireCapabilityAttr *CreateImplicit(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
430
  static AcquireCapabilityAttr *Create(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo);
431
  static AcquireCapabilityAttr *CreateImplicit(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax, AcquireCapabilityAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
432
  static AcquireCapabilityAttr *Create(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax, AcquireCapabilityAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
433
 
434
  // Constructors
435
  AcquireCapabilityAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
436
              , Expr * *Args, unsigned ArgsSize
437
             );
438
  AcquireCapabilityAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
439
             );
440
 
441
  AcquireCapabilityAttr *clone(ASTContext &C) const;
442
  void printPretty(raw_ostream &OS,
443
                   const PrintingPolicy &Policy) const;
444
  const char *getSpelling() const;
445
  Spelling getSemanticSpelling() const;
446
  bool isShared() const { return getAttributeSpellingListIndex() == 2 ||
447
    getAttributeSpellingListIndex() == 3 ||
448
    getAttributeSpellingListIndex() == 5; }
449
  typedef Expr ** args_iterator;
450
  args_iterator args_begin() const { return args_; }
451
  args_iterator args_end() const { return args_ + args_Size; }
452
  unsigned args_size() const { return args_Size; }
453
  llvm::iterator_range<args_iterator> args() const { return llvm::make_range(args_begin(), args_end()); }
454
 
455
 
456
 
457
 
458
  static bool classof(const Attr *A) { return A->getKind() == attr::AcquireCapability; }
459
};
460
 
461
class AcquireHandleAttr : public InheritableAttr {
462
unsigned handleTypeLength;
463
char *handleType;
464
 
465
public:
466
  enum Spelling {
467
    GNU_acquire_handle = 0,
468
    CXX11_clang_acquire_handle = 1,
469
    C2x_clang_acquire_handle = 2,
470
  SpellingNotCalculated = 15
471
 
472
  };
473
 
474
  // Factory methods
475
  static AcquireHandleAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef HandleType, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
476
  static AcquireHandleAttr *Create(ASTContext &Ctx, llvm::StringRef HandleType, const AttributeCommonInfo &CommonInfo);
477
  static AcquireHandleAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef HandleType, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
478
  static AcquireHandleAttr *Create(ASTContext &Ctx, llvm::StringRef HandleType, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
479
 
480
  // Constructors
481
  AcquireHandleAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
482
              , llvm::StringRef HandleType
483
             );
484
 
485
  AcquireHandleAttr *clone(ASTContext &C) const;
486
  void printPretty(raw_ostream &OS,
487
                   const PrintingPolicy &Policy) const;
488
  const char *getSpelling() const;
489
  llvm::StringRef getHandleType() const {
490
    return llvm::StringRef(handleType, handleTypeLength);
491
  }
492
  unsigned getHandleTypeLength() const {
493
    return handleTypeLength;
494
  }
495
  void setHandleType(ASTContext &C, llvm::StringRef S) {
496
    handleTypeLength = S.size();
497
    this->handleType = new (C, 1) char [handleTypeLength];
498
    if (!S.empty())
499
      std::memcpy(this->handleType, S.data(), handleTypeLength);
500
  }
501
 
502
 
503
 
504
  static bool classof(const Attr *A) { return A->getKind() == attr::AcquireHandle; }
505
};
506
 
507
class AcquiredAfterAttr : public InheritableAttr {
508
  unsigned args_Size;
509
  Expr * *args_;
510
 
511
public:
512
  // Factory methods
513
  static AcquiredAfterAttr *CreateImplicit(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
514
  static AcquiredAfterAttr *Create(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo);
515
  static AcquiredAfterAttr *CreateImplicit(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
516
  static AcquiredAfterAttr *Create(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
517
 
518
  // Constructors
519
  AcquiredAfterAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
520
              , Expr * *Args, unsigned ArgsSize
521
             );
522
  AcquiredAfterAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
523
             );
524
 
525
  AcquiredAfterAttr *clone(ASTContext &C) const;
526
  void printPretty(raw_ostream &OS,
527
                   const PrintingPolicy &Policy) const;
528
  const char *getSpelling() const;
529
  typedef Expr ** args_iterator;
530
  args_iterator args_begin() const { return args_; }
531
  args_iterator args_end() const { return args_ + args_Size; }
532
  unsigned args_size() const { return args_Size; }
533
  llvm::iterator_range<args_iterator> args() const { return llvm::make_range(args_begin(), args_end()); }
534
 
535
 
536
 
537
 
538
  static bool classof(const Attr *A) { return A->getKind() == attr::AcquiredAfter; }
539
};
540
 
541
class AcquiredBeforeAttr : public InheritableAttr {
542
  unsigned args_Size;
543
  Expr * *args_;
544
 
545
public:
546
  // Factory methods
547
  static AcquiredBeforeAttr *CreateImplicit(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
548
  static AcquiredBeforeAttr *Create(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo);
549
  static AcquiredBeforeAttr *CreateImplicit(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
550
  static AcquiredBeforeAttr *Create(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
551
 
552
  // Constructors
553
  AcquiredBeforeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
554
              , Expr * *Args, unsigned ArgsSize
555
             );
556
  AcquiredBeforeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
557
             );
558
 
559
  AcquiredBeforeAttr *clone(ASTContext &C) const;
560
  void printPretty(raw_ostream &OS,
561
                   const PrintingPolicy &Policy) const;
562
  const char *getSpelling() const;
563
  typedef Expr ** args_iterator;
564
  args_iterator args_begin() const { return args_; }
565
  args_iterator args_end() const { return args_ + args_Size; }
566
  unsigned args_size() const { return args_Size; }
567
  llvm::iterator_range<args_iterator> args() const { return llvm::make_range(args_begin(), args_end()); }
568
 
569
 
570
 
571
 
572
  static bool classof(const Attr *A) { return A->getKind() == attr::AcquiredBefore; }
573
};
574
 
575
class AddressSpaceAttr : public TypeAttr {
576
int addressSpace;
577
 
578
public:
579
  enum Spelling {
580
    GNU_address_space = 0,
581
    CXX11_clang_address_space = 1,
582
    C2x_clang_address_space = 2,
583
  SpellingNotCalculated = 15
584
 
585
  };
586
 
587
  // Factory methods
588
  static AddressSpaceAttr *CreateImplicit(ASTContext &Ctx, int AddressSpace, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
589
  static AddressSpaceAttr *Create(ASTContext &Ctx, int AddressSpace, const AttributeCommonInfo &CommonInfo);
590
  static AddressSpaceAttr *CreateImplicit(ASTContext &Ctx, int AddressSpace, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
591
  static AddressSpaceAttr *Create(ASTContext &Ctx, int AddressSpace, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
592
 
593
  // Constructors
594
  AddressSpaceAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
595
              , int AddressSpace
596
             );
597
 
598
  AddressSpaceAttr *clone(ASTContext &C) const;
599
  void printPretty(raw_ostream &OS,
600
                   const PrintingPolicy &Policy) const;
601
  const char *getSpelling() const;
602
  int getAddressSpace() const {
603
    return addressSpace;
604
  }
605
 
606
 
607
 
608
  static bool classof(const Attr *A) { return A->getKind() == attr::AddressSpace; }
609
};
610
 
611
class AliasAttr : public Attr {
612
unsigned aliaseeLength;
613
char *aliasee;
614
 
615
public:
616
  enum Spelling {
617
    GNU_alias = 0,
618
    CXX11_gnu_alias = 1,
619
    C2x_gnu_alias = 2,
620
  SpellingNotCalculated = 15
621
 
622
  };
623
 
624
  // Factory methods
625
  static AliasAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Aliasee, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
626
  static AliasAttr *Create(ASTContext &Ctx, llvm::StringRef Aliasee, const AttributeCommonInfo &CommonInfo);
627
  static AliasAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Aliasee, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
628
  static AliasAttr *Create(ASTContext &Ctx, llvm::StringRef Aliasee, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
629
 
630
  // Constructors
631
  AliasAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
632
              , llvm::StringRef Aliasee
633
             );
634
 
635
  AliasAttr *clone(ASTContext &C) const;
636
  void printPretty(raw_ostream &OS,
637
                   const PrintingPolicy &Policy) const;
638
  const char *getSpelling() const;
639
  llvm::StringRef getAliasee() const {
640
    return llvm::StringRef(aliasee, aliaseeLength);
641
  }
642
  unsigned getAliaseeLength() const {
643
    return aliaseeLength;
644
  }
645
  void setAliasee(ASTContext &C, llvm::StringRef S) {
646
    aliaseeLength = S.size();
647
    this->aliasee = new (C, 1) char [aliaseeLength];
648
    if (!S.empty())
649
      std::memcpy(this->aliasee, S.data(), aliaseeLength);
650
  }
651
 
652
 
653
 
654
  static bool classof(const Attr *A) { return A->getKind() == attr::Alias; }
655
};
656
 
657
class AlignMac68kAttr : public InheritableAttr {
658
public:
659
  // Factory methods
660
  static AlignMac68kAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
661
  static AlignMac68kAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
662
  static AlignMac68kAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
663
  static AlignMac68kAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
664
 
665
  // Constructors
666
  AlignMac68kAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
667
             );
668
 
669
  AlignMac68kAttr *clone(ASTContext &C) const;
670
  void printPretty(raw_ostream &OS,
671
                   const PrintingPolicy &Policy) const;
672
  const char *getSpelling() const;
673
 
674
 
675
  static bool classof(const Attr *A) { return A->getKind() == attr::AlignMac68k; }
676
};
677
 
678
class AlignNaturalAttr : public InheritableAttr {
679
public:
680
  // Factory methods
681
  static AlignNaturalAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
682
  static AlignNaturalAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
683
  static AlignNaturalAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
684
  static AlignNaturalAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
685
 
686
  // Constructors
687
  AlignNaturalAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
688
             );
689
 
690
  AlignNaturalAttr *clone(ASTContext &C) const;
691
  void printPretty(raw_ostream &OS,
692
                   const PrintingPolicy &Policy) const;
693
  const char *getSpelling() const;
694
 
695
 
696
  static bool classof(const Attr *A) { return A->getKind() == attr::AlignNatural; }
697
};
698
 
699
class AlignValueAttr : public Attr {
700
Expr * alignment;
701
 
702
public:
703
  // Factory methods
704
  static AlignValueAttr *CreateImplicit(ASTContext &Ctx, Expr * Alignment, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
705
  static AlignValueAttr *Create(ASTContext &Ctx, Expr * Alignment, const AttributeCommonInfo &CommonInfo);
706
  static AlignValueAttr *CreateImplicit(ASTContext &Ctx, Expr * Alignment, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
707
  static AlignValueAttr *Create(ASTContext &Ctx, Expr * Alignment, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
708
 
709
  // Constructors
710
  AlignValueAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
711
              , Expr * Alignment
712
             );
713
 
714
  AlignValueAttr *clone(ASTContext &C) const;
715
  void printPretty(raw_ostream &OS,
716
                   const PrintingPolicy &Policy) const;
717
  const char *getSpelling() const;
718
  Expr * getAlignment() const {
719
    return alignment;
720
  }
721
 
722
 
723
 
724
  static bool classof(const Attr *A) { return A->getKind() == attr::AlignValue; }
725
};
726
 
727
class AlignedAttr : public InheritableAttr {
728
bool isalignmentExpr;
729
union {
730
Expr *alignmentExpr;
731
TypeSourceInfo *alignmentType;
732
};
733
 
734
public:
735
  enum Spelling {
736
    GNU_aligned = 0,
737
    CXX11_gnu_aligned = 1,
738
    C2x_gnu_aligned = 2,
739
    Declspec_align = 3,
740
    Keyword_alignas = 4,
741
    Keyword_Alignas = 5,
742
  SpellingNotCalculated = 15
743
 
744
  };
745
 
746
  // Factory methods
747
  static AlignedAttr *CreateImplicit(ASTContext &Ctx, bool IsAlignmentExpr, void *Alignment, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
748
  static AlignedAttr *Create(ASTContext &Ctx, bool IsAlignmentExpr, void *Alignment, const AttributeCommonInfo &CommonInfo);
749
  static AlignedAttr *CreateImplicit(ASTContext &Ctx, bool IsAlignmentExpr, void *Alignment, SourceRange Range, AttributeCommonInfo::Syntax Syntax, AlignedAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
750
  static AlignedAttr *Create(ASTContext &Ctx, bool IsAlignmentExpr, void *Alignment, SourceRange Range, AttributeCommonInfo::Syntax Syntax, AlignedAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
751
 
752
  // Constructors
753
  AlignedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
754
              , bool IsAlignmentExpr, void *Alignment
755
             );
756
  AlignedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
757
             );
758
 
759
  AlignedAttr *clone(ASTContext &C) const;
760
  void printPretty(raw_ostream &OS,
761
                   const PrintingPolicy &Policy) const;
762
  const char *getSpelling() const;
763
  Spelling getSemanticSpelling() const;
764
  bool isGNU() const { return getAttributeSpellingListIndex() == 0 ||
765
    getAttributeSpellingListIndex() == 1 ||
766
    getAttributeSpellingListIndex() == 2; }
767
  bool isC11() const { return getAttributeSpellingListIndex() == 5; }
768
  bool isAlignas() const { return getAttributeSpellingListIndex() == 4 ||
769
    getAttributeSpellingListIndex() == 5; }
770
  bool isDeclspec() const { return getAttributeSpellingListIndex() == 3; }
771
  bool isAlignmentDependent() const;
772
  bool isAlignmentErrorDependent() const;
773
  unsigned getAlignment(ASTContext &Ctx) const;
774
  bool isAlignmentExpr() const {
775
    return isalignmentExpr;
776
  }
777
  Expr *getAlignmentExpr() const {
778
    assert(isalignmentExpr);
779
    return alignmentExpr;
780
  }
781
  TypeSourceInfo *getAlignmentType() const {
782
    assert(!isalignmentExpr);
783
    return alignmentType;
784
  }
785
 
786
 
787
 
788
  static bool classof(const Attr *A) { return A->getKind() == attr::Aligned; }
789
};
790
 
791
class AllocAlignAttr : public InheritableAttr {
792
ParamIdx paramIndex;
793
 
794
public:
795
  enum Spelling {
796
    GNU_alloc_align = 0,
797
    CXX11_gnu_alloc_align = 1,
798
    C2x_gnu_alloc_align = 2,
799
  SpellingNotCalculated = 15
800
 
801
  };
802
 
803
  // Factory methods
804
  static AllocAlignAttr *CreateImplicit(ASTContext &Ctx, ParamIdx ParamIndex, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
805
  static AllocAlignAttr *Create(ASTContext &Ctx, ParamIdx ParamIndex, const AttributeCommonInfo &CommonInfo);
806
  static AllocAlignAttr *CreateImplicit(ASTContext &Ctx, ParamIdx ParamIndex, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
807
  static AllocAlignAttr *Create(ASTContext &Ctx, ParamIdx ParamIndex, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
808
 
809
  // Constructors
810
  AllocAlignAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
811
              , ParamIdx ParamIndex
812
             );
813
 
814
  AllocAlignAttr *clone(ASTContext &C) const;
815
  void printPretty(raw_ostream &OS,
816
                   const PrintingPolicy &Policy) const;
817
  const char *getSpelling() const;
818
  ParamIdx getParamIndex() const {
819
    return paramIndex;
820
  }
821
 
822
 
823
 
824
  static bool classof(const Attr *A) { return A->getKind() == attr::AllocAlign; }
825
};
826
 
827
class AllocSizeAttr : public InheritableAttr {
828
ParamIdx elemSizeParam;
829
 
830
ParamIdx numElemsParam;
831
 
832
public:
833
  enum Spelling {
834
    GNU_alloc_size = 0,
835
    CXX11_gnu_alloc_size = 1,
836
    C2x_gnu_alloc_size = 2,
837
  SpellingNotCalculated = 15
838
 
839
  };
840
 
841
  // Factory methods
842
  static AllocSizeAttr *CreateImplicit(ASTContext &Ctx, ParamIdx ElemSizeParam, ParamIdx NumElemsParam, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
843
  static AllocSizeAttr *Create(ASTContext &Ctx, ParamIdx ElemSizeParam, ParamIdx NumElemsParam, const AttributeCommonInfo &CommonInfo);
844
  static AllocSizeAttr *CreateImplicit(ASTContext &Ctx, ParamIdx ElemSizeParam, ParamIdx NumElemsParam, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
845
  static AllocSizeAttr *Create(ASTContext &Ctx, ParamIdx ElemSizeParam, ParamIdx NumElemsParam, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
846
 
847
  // Constructors
848
  AllocSizeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
849
              , ParamIdx ElemSizeParam
850
              , ParamIdx NumElemsParam
851
             );
852
  AllocSizeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
853
              , ParamIdx ElemSizeParam
854
             );
855
 
856
  AllocSizeAttr *clone(ASTContext &C) const;
857
  void printPretty(raw_ostream &OS,
858
                   const PrintingPolicy &Policy) const;
859
  const char *getSpelling() const;
860
  ParamIdx getElemSizeParam() const {
861
    return elemSizeParam;
862
  }
863
 
864
  ParamIdx getNumElemsParam() const {
865
    return numElemsParam;
866
  }
867
 
868
 
869
 
870
  static bool classof(const Attr *A) { return A->getKind() == attr::AllocSize; }
871
};
872
 
873
class AlwaysDestroyAttr : public InheritableAttr {
874
public:
875
  enum Spelling {
876
    GNU_always_destroy = 0,
877
    CXX11_clang_always_destroy = 1,
878
  SpellingNotCalculated = 15
879
 
880
  };
881
 
882
  // Factory methods
883
  static AlwaysDestroyAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
884
  static AlwaysDestroyAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
885
  static AlwaysDestroyAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
886
  static AlwaysDestroyAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
887
 
888
  // Constructors
889
  AlwaysDestroyAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
890
             );
891
 
892
  AlwaysDestroyAttr *clone(ASTContext &C) const;
893
  void printPretty(raw_ostream &OS,
894
                   const PrintingPolicy &Policy) const;
895
  const char *getSpelling() const;
896
 
897
 
898
  static bool classof(const Attr *A) { return A->getKind() == attr::AlwaysDestroy; }
899
};
900
 
901
class AlwaysInlineAttr : public DeclOrStmtAttr {
902
public:
903
  enum Spelling {
904
    GNU_always_inline = 0,
905
    CXX11_gnu_always_inline = 1,
906
    C2x_gnu_always_inline = 2,
907
    CXX11_clang_always_inline = 3,
908
    C2x_clang_always_inline = 4,
909
    Keyword_forceinline = 5,
910
  SpellingNotCalculated = 15
911
 
912
  };
913
 
914
  // Factory methods
915
  static AlwaysInlineAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
916
  static AlwaysInlineAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
917
  static AlwaysInlineAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax, AlwaysInlineAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
918
  static AlwaysInlineAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax, AlwaysInlineAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
919
 
920
  // Constructors
921
  AlwaysInlineAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
922
             );
923
 
924
  AlwaysInlineAttr *clone(ASTContext &C) const;
925
  void printPretty(raw_ostream &OS,
926
                   const PrintingPolicy &Policy) const;
927
  const char *getSpelling() const;
928
  Spelling getSemanticSpelling() const;
929
  bool isClangAlwaysInline() const { return getAttributeSpellingListIndex() == 3 ||
930
    getAttributeSpellingListIndex() == 4; }
931
 
932
 
933
  static bool classof(const Attr *A) { return A->getKind() == attr::AlwaysInline; }
934
};
935
 
936
class AnalyzerNoReturnAttr : public InheritableAttr {
937
public:
938
  // Factory methods
939
  static AnalyzerNoReturnAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
940
  static AnalyzerNoReturnAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
941
  static AnalyzerNoReturnAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
942
  static AnalyzerNoReturnAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
943
 
944
  // Constructors
945
  AnalyzerNoReturnAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
946
             );
947
 
948
  AnalyzerNoReturnAttr *clone(ASTContext &C) const;
949
  void printPretty(raw_ostream &OS,
950
                   const PrintingPolicy &Policy) const;
951
  const char *getSpelling() const;
952
 
953
 
954
  static bool classof(const Attr *A) { return A->getKind() == attr::AnalyzerNoReturn; }
955
};
956
 
957
class AnnotateAttr : public InheritableParamAttr {
958
unsigned annotationLength;
959
char *annotation;
960
 
961
  unsigned args_Size;
962
  Expr * *args_;
963
 
964
  unsigned delayedArgs_Size;
965
  Expr * *delayedArgs_;
966
 
967
public:
968
  enum Spelling {
969
    GNU_annotate = 0,
970
    CXX11_clang_annotate = 1,
971
    C2x_clang_annotate = 2,
972
  SpellingNotCalculated = 15
973
 
974
  };
975
 
976
  // Factory methods
977
  static AnnotateAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Annotation, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
978
  static AnnotateAttr *Create(ASTContext &Ctx, llvm::StringRef Annotation, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo);
979
  static AnnotateAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Annotation, Expr * *Args, unsigned ArgsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
980
  static AnnotateAttr *Create(ASTContext &Ctx, llvm::StringRef Annotation, Expr * *Args, unsigned ArgsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
981
  static AnnotateAttr *CreateImplicitWithDelayedArgs(ASTContext &Ctx, Expr * *DelayedArgs, unsigned DelayedArgsSize, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
982
  static AnnotateAttr *CreateWithDelayedArgs(ASTContext &Ctx, Expr * *DelayedArgs, unsigned DelayedArgsSize, const AttributeCommonInfo &CommonInfo);
983
  static AnnotateAttr *CreateImplicitWithDelayedArgs(ASTContext &Ctx, Expr * *DelayedArgs, unsigned DelayedArgsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
984
  static AnnotateAttr *CreateWithDelayedArgs(ASTContext &Ctx, Expr * *DelayedArgs, unsigned DelayedArgsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
985
 
986
  // Constructors
987
  AnnotateAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
988
              , llvm::StringRef Annotation
989
              , Expr * *Args, unsigned ArgsSize
990
             );
991
  AnnotateAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
992
              , llvm::StringRef Annotation
993
             );
994
  AnnotateAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
995
             );
996
 
997
  AnnotateAttr *clone(ASTContext &C) const;
998
  void printPretty(raw_ostream &OS,
999
                   const PrintingPolicy &Policy) const;
1000
  const char *getSpelling() const;
1001
  llvm::StringRef getAnnotation() const {
1002
    return llvm::StringRef(annotation, annotationLength);
1003
  }
1004
  unsigned getAnnotationLength() const {
1005
    return annotationLength;
1006
  }
1007
  void setAnnotation(ASTContext &C, llvm::StringRef S) {
1008
    annotationLength = S.size();
1009
    this->annotation = new (C, 1) char [annotationLength];
1010
    if (!S.empty())
1011
      std::memcpy(this->annotation, S.data(), annotationLength);
1012
  }
1013
 
1014
  typedef Expr ** args_iterator;
1015
  args_iterator args_begin() const { return args_; }
1016
  args_iterator args_end() const { return args_ + args_Size; }
1017
  unsigned args_size() const { return args_Size; }
1018
  llvm::iterator_range<args_iterator> args() const { return llvm::make_range(args_begin(), args_end()); }
1019
 
1020
 
1021
  typedef Expr ** delayedArgs_iterator;
1022
  delayedArgs_iterator delayedArgs_begin() const { return delayedArgs_; }
1023
  delayedArgs_iterator delayedArgs_end() const { return delayedArgs_ + delayedArgs_Size; }
1024
  unsigned delayedArgs_size() const { return delayedArgs_Size; }
1025
  llvm::iterator_range<delayedArgs_iterator> delayedArgs() const { return llvm::make_range(delayedArgs_begin(), delayedArgs_end()); }
1026
  void setDelayedArgs(ASTContext &Ctx, Expr * *DelayedArgs, unsigned DelayedArgsSize) {
1027
    delayedArgs_Size = DelayedArgsSize;
1028
    delayedArgs_ = new (Ctx, 16) Expr *[delayedArgs_Size];
1029
    std::copy(DelayedArgs, DelayedArgs + delayedArgs_Size, delayedArgs_);
1030
  }
1031
 
1032
  static AnnotateAttr *Create(ASTContext &Ctx, llvm::StringRef Annotation, \
1033
              const AttributeCommonInfo &CommonInfo) {
1034
    return AnnotateAttr::Create(Ctx, Annotation, nullptr, 0, CommonInfo);
1035
  }
1036
  static AnnotateAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Annotation, \
1037
              const AttributeCommonInfo &CommonInfo = {SourceRange{}}) {
1038
    return AnnotateAttr::CreateImplicit(Ctx, Annotation, nullptr, 0, CommonInfo);
1039
  }
1040
 
1041
 
1042
  static bool classof(const Attr *A) { return A->getKind() == attr::Annotate; }
1043
};
1044
 
1045
class AnnotateTypeAttr : public TypeAttr {
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
    CXX11_clang_annotate_type = 0,
1058
    C2x_clang_annotate_type = 1,
1059
  SpellingNotCalculated = 15
1060
 
1061
  };
1062
 
1063
  // Factory methods
1064
  static AnnotateTypeAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Annotation, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
1065
  static AnnotateTypeAttr *Create(ASTContext &Ctx, llvm::StringRef Annotation, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo);
1066
  static AnnotateTypeAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Annotation, Expr * *Args, unsigned ArgsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
1067
  static AnnotateTypeAttr *Create(ASTContext &Ctx, llvm::StringRef Annotation, Expr * *Args, unsigned ArgsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
1068
  static AnnotateTypeAttr *CreateImplicitWithDelayedArgs(ASTContext &Ctx, Expr * *DelayedArgs, unsigned DelayedArgsSize, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
1069
  static AnnotateTypeAttr *CreateWithDelayedArgs(ASTContext &Ctx, Expr * *DelayedArgs, unsigned DelayedArgsSize, const AttributeCommonInfo &CommonInfo);
1070
  static AnnotateTypeAttr *CreateImplicitWithDelayedArgs(ASTContext &Ctx, Expr * *DelayedArgs, unsigned DelayedArgsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
1071
  static AnnotateTypeAttr *CreateWithDelayedArgs(ASTContext &Ctx, Expr * *DelayedArgs, unsigned DelayedArgsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
1072
 
1073
  // Constructors
1074
  AnnotateTypeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
1075
              , llvm::StringRef Annotation
1076
              , Expr * *Args, unsigned ArgsSize
1077
             );
1078
  AnnotateTypeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
1079
              , llvm::StringRef Annotation
1080
             );
1081
  AnnotateTypeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
1082
             );
1083
 
1084
  AnnotateTypeAttr *clone(ASTContext &C) const;
1085
  void printPretty(raw_ostream &OS,
1086
                   const PrintingPolicy &Policy) const;
1087
  const char *getSpelling() const;
1088
  llvm::StringRef getAnnotation() const {
1089
    return llvm::StringRef(annotation, annotationLength);
1090
  }
1091
  unsigned getAnnotationLength() const {
1092
    return annotationLength;
1093
  }
1094
  void setAnnotation(ASTContext &C, llvm::StringRef S) {
1095
    annotationLength = S.size();
1096
    this->annotation = new (C, 1) char [annotationLength];
1097
    if (!S.empty())
1098
      std::memcpy(this->annotation, S.data(), annotationLength);
1099
  }
1100
 
1101
  typedef Expr ** args_iterator;
1102
  args_iterator args_begin() const { return args_; }
1103
  args_iterator args_end() const { return args_ + args_Size; }
1104
  unsigned args_size() const { return args_Size; }
1105
  llvm::iterator_range<args_iterator> args() const { return llvm::make_range(args_begin(), args_end()); }
1106
 
1107
 
1108
  typedef Expr ** delayedArgs_iterator;
1109
  delayedArgs_iterator delayedArgs_begin() const { return delayedArgs_; }
1110
  delayedArgs_iterator delayedArgs_end() const { return delayedArgs_ + delayedArgs_Size; }
1111
  unsigned delayedArgs_size() const { return delayedArgs_Size; }
1112
  llvm::iterator_range<delayedArgs_iterator> delayedArgs() const { return llvm::make_range(delayedArgs_begin(), delayedArgs_end()); }
1113
  void setDelayedArgs(ASTContext &Ctx, Expr * *DelayedArgs, unsigned DelayedArgsSize) {
1114
    delayedArgs_Size = DelayedArgsSize;
1115
    delayedArgs_ = new (Ctx, 16) Expr *[delayedArgs_Size];
1116
    std::copy(DelayedArgs, DelayedArgs + delayedArgs_Size, delayedArgs_);
1117
  }
1118
 
1119
 
1120
  static bool classof(const Attr *A) { return A->getKind() == attr::AnnotateType; }
1121
};
1122
 
1123
class AnyX86InterruptAttr : public InheritableAttr {
1124
public:
1125
  enum Spelling {
1126
    GNU_interrupt = 0,
1127
    CXX11_gnu_interrupt = 1,
1128
    C2x_gnu_interrupt = 2,
1129
  SpellingNotCalculated = 15
1130
 
1131
  };
1132
 
1133
  // Factory methods
1134
  static AnyX86InterruptAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
1135
  static AnyX86InterruptAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
1136
  static AnyX86InterruptAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
1137
  static AnyX86InterruptAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
1138
 
1139
  // Constructors
1140
  AnyX86InterruptAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
1141
             );
1142
 
1143
  AnyX86InterruptAttr *clone(ASTContext &C) const;
1144
  void printPretty(raw_ostream &OS,
1145
                   const PrintingPolicy &Policy) const;
1146
  const char *getSpelling() const;
1147
 
1148
 
1149
  static bool classof(const Attr *A) { return A->getKind() == attr::AnyX86Interrupt; }
1150
};
1151
 
1152
class AnyX86NoCallerSavedRegistersAttr : public InheritableAttr {
1153
public:
1154
  enum Spelling {
1155
    GNU_no_caller_saved_registers = 0,
1156
    CXX11_gnu_no_caller_saved_registers = 1,
1157
    C2x_gnu_no_caller_saved_registers = 2,
1158
  SpellingNotCalculated = 15
1159
 
1160
  };
1161
 
1162
  // Factory methods
1163
  static AnyX86NoCallerSavedRegistersAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
1164
  static AnyX86NoCallerSavedRegistersAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
1165
  static AnyX86NoCallerSavedRegistersAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
1166
  static AnyX86NoCallerSavedRegistersAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
1167
 
1168
  // Constructors
1169
  AnyX86NoCallerSavedRegistersAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
1170
             );
1171
 
1172
  AnyX86NoCallerSavedRegistersAttr *clone(ASTContext &C) const;
1173
  void printPretty(raw_ostream &OS,
1174
                   const PrintingPolicy &Policy) const;
1175
  const char *getSpelling() const;
1176
 
1177
 
1178
  static bool classof(const Attr *A) { return A->getKind() == attr::AnyX86NoCallerSavedRegisters; }
1179
};
1180
 
1181
class AnyX86NoCfCheckAttr : public InheritableAttr {
1182
public:
1183
  enum Spelling {
1184
    GNU_nocf_check = 0,
1185
    CXX11_gnu_nocf_check = 1,
1186
    C2x_gnu_nocf_check = 2,
1187
  SpellingNotCalculated = 15
1188
 
1189
  };
1190
 
1191
  // Factory methods
1192
  static AnyX86NoCfCheckAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
1193
  static AnyX86NoCfCheckAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
1194
  static AnyX86NoCfCheckAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
1195
  static AnyX86NoCfCheckAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
1196
 
1197
  // Constructors
1198
  AnyX86NoCfCheckAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
1199
             );
1200
 
1201
  AnyX86NoCfCheckAttr *clone(ASTContext &C) const;
1202
  void printPretty(raw_ostream &OS,
1203
                   const PrintingPolicy &Policy) const;
1204
  const char *getSpelling() const;
1205
 
1206
 
1207
  static bool classof(const Attr *A) { return A->getKind() == attr::AnyX86NoCfCheck; }
1208
};
1209
 
1210
class ArcWeakrefUnavailableAttr : public InheritableAttr {
1211
public:
1212
  enum Spelling {
1213
    GNU_objc_arc_weak_reference_unavailable = 0,
1214
    CXX11_clang_objc_arc_weak_reference_unavailable = 1,
1215
    C2x_clang_objc_arc_weak_reference_unavailable = 2,
1216
  SpellingNotCalculated = 15
1217
 
1218
  };
1219
 
1220
  // Factory methods
1221
  static ArcWeakrefUnavailableAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
1222
  static ArcWeakrefUnavailableAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
1223
  static ArcWeakrefUnavailableAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
1224
  static ArcWeakrefUnavailableAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
1225
 
1226
  // Constructors
1227
  ArcWeakrefUnavailableAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
1228
             );
1229
 
1230
  ArcWeakrefUnavailableAttr *clone(ASTContext &C) const;
1231
  void printPretty(raw_ostream &OS,
1232
                   const PrintingPolicy &Policy) const;
1233
  const char *getSpelling() const;
1234
 
1235
 
1236
  static bool classof(const Attr *A) { return A->getKind() == attr::ArcWeakrefUnavailable; }
1237
};
1238
 
1239
class ArgumentWithTypeTagAttr : public InheritableAttr {
1240
IdentifierInfo * argumentKind;
1241
 
1242
ParamIdx argumentIdx;
1243
 
1244
ParamIdx typeTagIdx;
1245
 
1246
bool isPointer;
1247
 
1248
public:
1249
  enum Spelling {
1250
    GNU_argument_with_type_tag = 0,
1251
    CXX11_clang_argument_with_type_tag = 1,
1252
    C2x_clang_argument_with_type_tag = 2,
1253
    GNU_pointer_with_type_tag = 3,
1254
    CXX11_clang_pointer_with_type_tag = 4,
1255
    C2x_clang_pointer_with_type_tag = 5,
1256
  SpellingNotCalculated = 15
1257
 
1258
  };
1259
 
1260
  // Factory methods
1261
  static ArgumentWithTypeTagAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * ArgumentKind, ParamIdx ArgumentIdx, ParamIdx TypeTagIdx, bool IsPointer, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
1262
  static ArgumentWithTypeTagAttr *Create(ASTContext &Ctx, IdentifierInfo * ArgumentKind, ParamIdx ArgumentIdx, ParamIdx TypeTagIdx, bool IsPointer, const AttributeCommonInfo &CommonInfo);
1263
  static ArgumentWithTypeTagAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * ArgumentKind, ParamIdx ArgumentIdx, ParamIdx TypeTagIdx, bool IsPointer, SourceRange Range, AttributeCommonInfo::Syntax Syntax, ArgumentWithTypeTagAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
1264
  static ArgumentWithTypeTagAttr *Create(ASTContext &Ctx, IdentifierInfo * ArgumentKind, ParamIdx ArgumentIdx, ParamIdx TypeTagIdx, bool IsPointer, SourceRange Range, AttributeCommonInfo::Syntax Syntax, ArgumentWithTypeTagAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
1265
  static ArgumentWithTypeTagAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * ArgumentKind, ParamIdx ArgumentIdx, ParamIdx TypeTagIdx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
1266
  static ArgumentWithTypeTagAttr *Create(ASTContext &Ctx, IdentifierInfo * ArgumentKind, ParamIdx ArgumentIdx, ParamIdx TypeTagIdx, const AttributeCommonInfo &CommonInfo);
1267
  static ArgumentWithTypeTagAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * ArgumentKind, ParamIdx ArgumentIdx, ParamIdx TypeTagIdx, SourceRange Range, AttributeCommonInfo::Syntax Syntax, ArgumentWithTypeTagAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
1268
  static ArgumentWithTypeTagAttr *Create(ASTContext &Ctx, IdentifierInfo * ArgumentKind, ParamIdx ArgumentIdx, ParamIdx TypeTagIdx, SourceRange Range, AttributeCommonInfo::Syntax Syntax, ArgumentWithTypeTagAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
1269
 
1270
  // Constructors
1271
  ArgumentWithTypeTagAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
1272
              , IdentifierInfo * ArgumentKind
1273
              , ParamIdx ArgumentIdx
1274
              , ParamIdx TypeTagIdx
1275
              , bool IsPointer
1276
             );
1277
  ArgumentWithTypeTagAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
1278
              , IdentifierInfo * ArgumentKind
1279
              , ParamIdx ArgumentIdx
1280
              , ParamIdx TypeTagIdx
1281
             );
1282
 
1283
  ArgumentWithTypeTagAttr *clone(ASTContext &C) const;
1284
  void printPretty(raw_ostream &OS,
1285
                   const PrintingPolicy &Policy) const;
1286
  const char *getSpelling() const;
1287
  Spelling getSemanticSpelling() const;
1288
  IdentifierInfo * getArgumentKind() const {
1289
    return argumentKind;
1290
  }
1291
 
1292
  ParamIdx getArgumentIdx() const {
1293
    return argumentIdx;
1294
  }
1295
 
1296
  ParamIdx getTypeTagIdx() const {
1297
    return typeTagIdx;
1298
  }
1299
 
1300
  bool getIsPointer() const {
1301
    return isPointer;
1302
  }
1303
 
1304
 
1305
 
1306
  static bool classof(const Attr *A) { return A->getKind() == attr::ArgumentWithTypeTag; }
1307
};
1308
 
1309
class ArmBuiltinAliasAttr : public InheritableAttr {
1310
IdentifierInfo * builtinName;
1311
 
1312
public:
1313
  enum Spelling {
1314
    GNU_clang_arm_builtin_alias = 0,
1315
    CXX11_clang_clang_arm_builtin_alias = 1,
1316
    C2x_clang_clang_arm_builtin_alias = 2,
1317
  SpellingNotCalculated = 15
1318
 
1319
  };
1320
 
1321
  // Factory methods
1322
  static ArmBuiltinAliasAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * BuiltinName, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
1323
  static ArmBuiltinAliasAttr *Create(ASTContext &Ctx, IdentifierInfo * BuiltinName, const AttributeCommonInfo &CommonInfo);
1324
  static ArmBuiltinAliasAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * BuiltinName, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
1325
  static ArmBuiltinAliasAttr *Create(ASTContext &Ctx, IdentifierInfo * BuiltinName, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
1326
 
1327
  // Constructors
1328
  ArmBuiltinAliasAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
1329
              , IdentifierInfo * BuiltinName
1330
             );
1331
 
1332
  ArmBuiltinAliasAttr *clone(ASTContext &C) const;
1333
  void printPretty(raw_ostream &OS,
1334
                   const PrintingPolicy &Policy) const;
1335
  const char *getSpelling() const;
1336
  IdentifierInfo * getBuiltinName() const {
1337
    return builtinName;
1338
  }
1339
 
1340
 
1341
 
1342
  static bool classof(const Attr *A) { return A->getKind() == attr::ArmBuiltinAlias; }
1343
};
1344
 
1345
class ArmMveStrictPolymorphismAttr : public TypeAttr {
1346
public:
1347
  enum Spelling {
1348
    GNU_clang_arm_mve_strict_polymorphism = 0,
1349
    CXX11_clang_clang_arm_mve_strict_polymorphism = 1,
1350
    C2x_clang_clang_arm_mve_strict_polymorphism = 2,
1351
  SpellingNotCalculated = 15
1352
 
1353
  };
1354
 
1355
  // Factory methods
1356
  static ArmMveStrictPolymorphismAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
1357
  static ArmMveStrictPolymorphismAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
1358
  static ArmMveStrictPolymorphismAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
1359
  static ArmMveStrictPolymorphismAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
1360
 
1361
  // Constructors
1362
  ArmMveStrictPolymorphismAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
1363
             );
1364
 
1365
  ArmMveStrictPolymorphismAttr *clone(ASTContext &C) const;
1366
  void printPretty(raw_ostream &OS,
1367
                   const PrintingPolicy &Policy) const;
1368
  const char *getSpelling() const;
1369
 
1370
 
1371
  static bool classof(const Attr *A) { return A->getKind() == attr::ArmMveStrictPolymorphism; }
1372
};
1373
 
1374
class ArtificialAttr : public InheritableAttr {
1375
public:
1376
  enum Spelling {
1377
    GNU_artificial = 0,
1378
    CXX11_gnu_artificial = 1,
1379
    C2x_gnu_artificial = 2,
1380
  SpellingNotCalculated = 15
1381
 
1382
  };
1383
 
1384
  // Factory methods
1385
  static ArtificialAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
1386
  static ArtificialAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
1387
  static ArtificialAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
1388
  static ArtificialAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
1389
 
1390
  // Constructors
1391
  ArtificialAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
1392
             );
1393
 
1394
  ArtificialAttr *clone(ASTContext &C) const;
1395
  void printPretty(raw_ostream &OS,
1396
                   const PrintingPolicy &Policy) const;
1397
  const char *getSpelling() const;
1398
 
1399
 
1400
  static bool classof(const Attr *A) { return A->getKind() == attr::Artificial; }
1401
};
1402
 
1403
class AsmLabelAttr : public InheritableAttr {
1404
unsigned labelLength;
1405
char *label;
1406
 
1407
bool isLiteralLabel;
1408
 
1409
public:
1410
  enum Spelling {
1411
    Keyword_asm = 0,
1412
  SpellingNotCalculated = 15
1413
 
1414
  };
1415
 
1416
  // Factory methods
1417
  static AsmLabelAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Label, bool IsLiteralLabel, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
1418
  static AsmLabelAttr *Create(ASTContext &Ctx, llvm::StringRef Label, bool IsLiteralLabel, const AttributeCommonInfo &CommonInfo);
1419
  static AsmLabelAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Label, bool IsLiteralLabel, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
1420
  static AsmLabelAttr *Create(ASTContext &Ctx, llvm::StringRef Label, bool IsLiteralLabel, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
1421
  static AsmLabelAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Label, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
1422
  static AsmLabelAttr *Create(ASTContext &Ctx, llvm::StringRef Label, const AttributeCommonInfo &CommonInfo);
1423
  static AsmLabelAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Label, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
1424
  static AsmLabelAttr *Create(ASTContext &Ctx, llvm::StringRef Label, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
1425
 
1426
  // Constructors
1427
  AsmLabelAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
1428
              , llvm::StringRef Label
1429
              , bool IsLiteralLabel
1430
             );
1431
  AsmLabelAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
1432
              , llvm::StringRef Label
1433
             );
1434
 
1435
  AsmLabelAttr *clone(ASTContext &C) const;
1436
  void printPretty(raw_ostream &OS,
1437
                   const PrintingPolicy &Policy) const;
1438
  const char *getSpelling() const;
1439
  llvm::StringRef getLabel() const {
1440
    return llvm::StringRef(label, labelLength);
1441
  }
1442
  unsigned getLabelLength() const {
1443
    return labelLength;
1444
  }
1445
  void setLabel(ASTContext &C, llvm::StringRef S) {
1446
    labelLength = S.size();
1447
    this->label = new (C, 1) char [labelLength];
1448
    if (!S.empty())
1449
      std::memcpy(this->label, S.data(), labelLength);
1450
  }
1451
 
1452
  bool getIsLiteralLabel() const {
1453
    return isLiteralLabel;
1454
  }
1455
 
1456
 
1457
bool isEquivalent(AsmLabelAttr *Other) const {
1458
  return getLabel() == Other->getLabel() && getIsLiteralLabel() == Other->getIsLiteralLabel();
1459
}
1460
 
1461
 
1462
  static bool classof(const Attr *A) { return A->getKind() == attr::AsmLabel; }
1463
};
1464
 
1465
class AssertCapabilityAttr : public InheritableAttr {
1466
  unsigned args_Size;
1467
  Expr * *args_;
1468
 
1469
public:
1470
  enum Spelling {
1471
    GNU_assert_capability = 0,
1472
    CXX11_clang_assert_capability = 1,
1473
    GNU_assert_shared_capability = 2,
1474
    CXX11_clang_assert_shared_capability = 3,
1475
  SpellingNotCalculated = 15
1476
 
1477
  };
1478
 
1479
  // Factory methods
1480
  static AssertCapabilityAttr *CreateImplicit(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
1481
  static AssertCapabilityAttr *Create(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo);
1482
  static AssertCapabilityAttr *CreateImplicit(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax, AssertCapabilityAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
1483
  static AssertCapabilityAttr *Create(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax, AssertCapabilityAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
1484
 
1485
  // Constructors
1486
  AssertCapabilityAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
1487
              , Expr * *Args, unsigned ArgsSize
1488
             );
1489
  AssertCapabilityAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
1490
             );
1491
 
1492
  AssertCapabilityAttr *clone(ASTContext &C) const;
1493
  void printPretty(raw_ostream &OS,
1494
                   const PrintingPolicy &Policy) const;
1495
  const char *getSpelling() const;
1496
  Spelling getSemanticSpelling() const;
1497
  bool isShared() const { return getAttributeSpellingListIndex() == 2 ||
1498
    getAttributeSpellingListIndex() == 3; }
1499
  typedef Expr ** args_iterator;
1500
  args_iterator args_begin() const { return args_; }
1501
  args_iterator args_end() const { return args_ + args_Size; }
1502
  unsigned args_size() const { return args_Size; }
1503
  llvm::iterator_range<args_iterator> args() const { return llvm::make_range(args_begin(), args_end()); }
1504
 
1505
 
1506
 
1507
 
1508
  static bool classof(const Attr *A) { return A->getKind() == attr::AssertCapability; }
1509
};
1510
 
1511
class AssertExclusiveLockAttr : public InheritableAttr {
1512
  unsigned args_Size;
1513
  Expr * *args_;
1514
 
1515
public:
1516
  // Factory methods
1517
  static AssertExclusiveLockAttr *CreateImplicit(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
1518
  static AssertExclusiveLockAttr *Create(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo);
1519
  static AssertExclusiveLockAttr *CreateImplicit(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
1520
  static AssertExclusiveLockAttr *Create(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
1521
 
1522
  // Constructors
1523
  AssertExclusiveLockAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
1524
              , Expr * *Args, unsigned ArgsSize
1525
             );
1526
  AssertExclusiveLockAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
1527
             );
1528
 
1529
  AssertExclusiveLockAttr *clone(ASTContext &C) const;
1530
  void printPretty(raw_ostream &OS,
1531
                   const PrintingPolicy &Policy) const;
1532
  const char *getSpelling() const;
1533
  typedef Expr ** args_iterator;
1534
  args_iterator args_begin() const { return args_; }
1535
  args_iterator args_end() const { return args_ + args_Size; }
1536
  unsigned args_size() const { return args_Size; }
1537
  llvm::iterator_range<args_iterator> args() const { return llvm::make_range(args_begin(), args_end()); }
1538
 
1539
 
1540
 
1541
 
1542
  static bool classof(const Attr *A) { return A->getKind() == attr::AssertExclusiveLock; }
1543
};
1544
 
1545
class AssertSharedLockAttr : public InheritableAttr {
1546
  unsigned args_Size;
1547
  Expr * *args_;
1548
 
1549
public:
1550
  // Factory methods
1551
  static AssertSharedLockAttr *CreateImplicit(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
1552
  static AssertSharedLockAttr *Create(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo);
1553
  static AssertSharedLockAttr *CreateImplicit(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
1554
  static AssertSharedLockAttr *Create(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
1555
 
1556
  // Constructors
1557
  AssertSharedLockAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
1558
              , Expr * *Args, unsigned ArgsSize
1559
             );
1560
  AssertSharedLockAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
1561
             );
1562
 
1563
  AssertSharedLockAttr *clone(ASTContext &C) const;
1564
  void printPretty(raw_ostream &OS,
1565
                   const PrintingPolicy &Policy) const;
1566
  const char *getSpelling() const;
1567
  typedef Expr ** args_iterator;
1568
  args_iterator args_begin() const { return args_; }
1569
  args_iterator args_end() const { return args_ + args_Size; }
1570
  unsigned args_size() const { return args_Size; }
1571
  llvm::iterator_range<args_iterator> args() const { return llvm::make_range(args_begin(), args_end()); }
1572
 
1573
 
1574
 
1575
 
1576
  static bool classof(const Attr *A) { return A->getKind() == attr::AssertSharedLock; }
1577
};
1578
 
1579
class AssumeAlignedAttr : public InheritableAttr {
1580
Expr * alignment;
1581
 
1582
Expr * offset;
1583
 
1584
public:
1585
  enum Spelling {
1586
    GNU_assume_aligned = 0,
1587
    CXX11_gnu_assume_aligned = 1,
1588
    C2x_gnu_assume_aligned = 2,
1589
  SpellingNotCalculated = 15
1590
 
1591
  };
1592
 
1593
  // Factory methods
1594
  static AssumeAlignedAttr *CreateImplicit(ASTContext &Ctx, Expr * Alignment, Expr * Offset, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
1595
  static AssumeAlignedAttr *Create(ASTContext &Ctx, Expr * Alignment, Expr * Offset, const AttributeCommonInfo &CommonInfo);
1596
  static AssumeAlignedAttr *CreateImplicit(ASTContext &Ctx, Expr * Alignment, Expr * Offset, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
1597
  static AssumeAlignedAttr *Create(ASTContext &Ctx, Expr * Alignment, Expr * Offset, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
1598
 
1599
  // Constructors
1600
  AssumeAlignedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
1601
              , Expr * Alignment
1602
              , Expr * Offset
1603
             );
1604
  AssumeAlignedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
1605
              , Expr * Alignment
1606
             );
1607
 
1608
  AssumeAlignedAttr *clone(ASTContext &C) const;
1609
  void printPretty(raw_ostream &OS,
1610
                   const PrintingPolicy &Policy) const;
1611
  const char *getSpelling() const;
1612
  Expr * getAlignment() const {
1613
    return alignment;
1614
  }
1615
 
1616
  Expr * getOffset() const {
1617
    return offset;
1618
  }
1619
 
1620
 
1621
 
1622
  static bool classof(const Attr *A) { return A->getKind() == attr::AssumeAligned; }
1623
};
1624
 
1625
class AssumptionAttr : public InheritableAttr {
1626
unsigned assumptionLength;
1627
char *assumption;
1628
 
1629
public:
1630
  enum Spelling {
1631
    GNU_assume = 0,
1632
    CXX11_clang_assume = 1,
1633
    C2x_clang_assume = 2,
1634
  SpellingNotCalculated = 15
1635
 
1636
  };
1637
 
1638
  // Factory methods
1639
  static AssumptionAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Assumption, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
1640
  static AssumptionAttr *Create(ASTContext &Ctx, llvm::StringRef Assumption, const AttributeCommonInfo &CommonInfo);
1641
  static AssumptionAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Assumption, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
1642
  static AssumptionAttr *Create(ASTContext &Ctx, llvm::StringRef Assumption, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
1643
 
1644
  // Constructors
1645
  AssumptionAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
1646
              , llvm::StringRef Assumption
1647
             );
1648
 
1649
  AssumptionAttr *clone(ASTContext &C) const;
1650
  void printPretty(raw_ostream &OS,
1651
                   const PrintingPolicy &Policy) const;
1652
  const char *getSpelling() const;
1653
  llvm::StringRef getAssumption() const {
1654
    return llvm::StringRef(assumption, assumptionLength);
1655
  }
1656
  unsigned getAssumptionLength() const {
1657
    return assumptionLength;
1658
  }
1659
  void setAssumption(ASTContext &C, llvm::StringRef S) {
1660
    assumptionLength = S.size();
1661
    this->assumption = new (C, 1) char [assumptionLength];
1662
    if (!S.empty())
1663
      std::memcpy(this->assumption, S.data(), assumptionLength);
1664
  }
1665
 
1666
 
1667
 
1668
  static bool classof(const Attr *A) { return A->getKind() == attr::Assumption; }
1669
};
1670
 
1671
class AvailabilityAttr : public InheritableAttr {
1672
IdentifierInfo * platform;
1673
 
1674
VersionTuple introduced;
1675
 
1676
 
1677
VersionTuple deprecated;
1678
 
1679
 
1680
VersionTuple obsoleted;
1681
 
1682
 
1683
bool unavailable;
1684
 
1685
unsigned messageLength;
1686
char *message;
1687
 
1688
bool strict;
1689
 
1690
unsigned replacementLength;
1691
char *replacement;
1692
 
1693
int priority;
1694
 
1695
public:
1696
  enum Spelling {
1697
    GNU_availability = 0,
1698
    CXX11_clang_availability = 1,
1699
    C2x_clang_availability = 2,
1700
  SpellingNotCalculated = 15
1701
 
1702
  };
1703
 
1704
  // Factory methods
1705
  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, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
1706
  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, const AttributeCommonInfo &CommonInfo);
1707
  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, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
1708
  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, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
1709
 
1710
  // Constructors
1711
  AvailabilityAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
1712
              , IdentifierInfo * Platform
1713
              , VersionTuple Introduced
1714
              , VersionTuple Deprecated
1715
              , VersionTuple Obsoleted
1716
              , bool Unavailable
1717
              , llvm::StringRef Message
1718
              , bool Strict
1719
              , llvm::StringRef Replacement
1720
              , int Priority
1721
             );
1722
 
1723
  AvailabilityAttr *clone(ASTContext &C) const;
1724
  void printPretty(raw_ostream &OS,
1725
                   const PrintingPolicy &Policy) const;
1726
  const char *getSpelling() const;
1727
  IdentifierInfo * getPlatform() const {
1728
    return platform;
1729
  }
1730
 
1731
  VersionTuple getIntroduced() const {
1732
    return introduced;
1733
  }
1734
  void setIntroduced(ASTContext &C, VersionTuple V) {
1735
    introduced = V;
1736
  }
1737
 
1738
  VersionTuple getDeprecated() const {
1739
    return deprecated;
1740
  }
1741
  void setDeprecated(ASTContext &C, VersionTuple V) {
1742
    deprecated = V;
1743
  }
1744
 
1745
  VersionTuple getObsoleted() const {
1746
    return obsoleted;
1747
  }
1748
  void setObsoleted(ASTContext &C, VersionTuple V) {
1749
    obsoleted = V;
1750
  }
1751
 
1752
  bool getUnavailable() const {
1753
    return unavailable;
1754
  }
1755
 
1756
  llvm::StringRef getMessage() const {
1757
    return llvm::StringRef(message, messageLength);
1758
  }
1759
  unsigned getMessageLength() const {
1760
    return messageLength;
1761
  }
1762
  void setMessage(ASTContext &C, llvm::StringRef S) {
1763
    messageLength = S.size();
1764
    this->message = new (C, 1) char [messageLength];
1765
    if (!S.empty())
1766
      std::memcpy(this->message, S.data(), messageLength);
1767
  }
1768
 
1769
  bool getStrict() const {
1770
    return strict;
1771
  }
1772
 
1773
  llvm::StringRef getReplacement() const {
1774
    return llvm::StringRef(replacement, replacementLength);
1775
  }
1776
  unsigned getReplacementLength() const {
1777
    return replacementLength;
1778
  }
1779
  void setReplacement(ASTContext &C, llvm::StringRef S) {
1780
    replacementLength = S.size();
1781
    this->replacement = new (C, 1) char [replacementLength];
1782
    if (!S.empty())
1783
      std::memcpy(this->replacement, S.data(), replacementLength);
1784
  }
1785
 
1786
  int getPriority() const {
1787
    return priority;
1788
  }
1789
 
1790
static llvm::StringRef getPrettyPlatformName(llvm::StringRef Platform) {
1791
    return llvm::StringSwitch<llvm::StringRef>(Platform)
1792
             .Case("android", "Android")
1793
             .Case("fuchsia", "Fuchsia")
1794
             .Case("ios", "iOS")
1795
             .Case("macos", "macOS")
1796
             .Case("tvos", "tvOS")
1797
             .Case("watchos", "watchOS")
1798
             .Case("driverkit", "DriverKit")
1799
             .Case("ios_app_extension", "iOS (App Extension)")
1800
             .Case("macos_app_extension", "macOS (App Extension)")
1801
             .Case("tvos_app_extension", "tvOS (App Extension)")
1802
             .Case("watchos_app_extension", "watchOS (App Extension)")
1803
             .Case("maccatalyst", "macCatalyst")
1804
             .Case("maccatalyst_app_extension", "macCatalyst (App Extension)")
1805
             .Case("swift", "Swift")
1806
             .Case("shadermodel", "HLSL ShaderModel")
1807
             .Default(llvm::StringRef());
1808
}
1809
static llvm::StringRef getPlatformNameSourceSpelling(llvm::StringRef Platform) {
1810
    return llvm::StringSwitch<llvm::StringRef>(Platform)
1811
             .Case("ios", "iOS")
1812
             .Case("macos", "macOS")
1813
             .Case("tvos", "tvOS")
1814
             .Case("watchos", "watchOS")
1815
             .Case("ios_app_extension", "iOSApplicationExtension")
1816
             .Case("macos_app_extension", "macOSApplicationExtension")
1817
             .Case("tvos_app_extension", "tvOSApplicationExtension")
1818
             .Case("watchos_app_extension", "watchOSApplicationExtension")
1819
             .Case("maccatalyst", "macCatalyst")
1820
             .Case("maccatalyst_app_extension", "macCatalystApplicationExtension")
1821
             .Case("zos", "z/OS")
1822
             .Case("shadermodel", "ShaderModel")
1823
             .Default(Platform);
1824
}
1825
static llvm::StringRef canonicalizePlatformName(llvm::StringRef Platform) {
1826
    return llvm::StringSwitch<llvm::StringRef>(Platform)
1827
             .Case("iOS", "ios")
1828
             .Case("macOS", "macos")
1829
             .Case("tvOS", "tvos")
1830
             .Case("watchOS", "watchos")
1831
             .Case("iOSApplicationExtension", "ios_app_extension")
1832
             .Case("macOSApplicationExtension", "macos_app_extension")
1833
             .Case("tvOSApplicationExtension", "tvos_app_extension")
1834
             .Case("watchOSApplicationExtension", "watchos_app_extension")
1835
             .Case("macCatalyst", "maccatalyst")
1836
             .Case("macCatalystApplicationExtension", "maccatalyst_app_extension")
1837
             .Case("ShaderModel", "shadermodel")
1838
             .Default(Platform);
1839
} 
1840
 
1841
  static bool classof(const Attr *A) { return A->getKind() == attr::Availability; }
1842
};
1843
 
1844
class BPFPreserveAccessIndexAttr : public InheritableAttr {
1845
public:
1846
  enum Spelling {
1847
    GNU_preserve_access_index = 0,
1848
    CXX11_clang_preserve_access_index = 1,
1849
    C2x_clang_preserve_access_index = 2,
1850
  SpellingNotCalculated = 15
1851
 
1852
  };
1853
 
1854
  // Factory methods
1855
  static BPFPreserveAccessIndexAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
1856
  static BPFPreserveAccessIndexAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
1857
  static BPFPreserveAccessIndexAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
1858
  static BPFPreserveAccessIndexAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
1859
 
1860
  // Constructors
1861
  BPFPreserveAccessIndexAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
1862
             );
1863
 
1864
  BPFPreserveAccessIndexAttr *clone(ASTContext &C) const;
1865
  void printPretty(raw_ostream &OS,
1866
                   const PrintingPolicy &Policy) const;
1867
  const char *getSpelling() const;
1868
 
1869
 
1870
  static bool classof(const Attr *A) { return A->getKind() == attr::BPFPreserveAccessIndex; }
1871
};
1872
 
1873
class BTFDeclTagAttr : public InheritableAttr {
1874
unsigned bTFDeclTagLength;
1875
char *bTFDeclTag;
1876
 
1877
public:
1878
  enum Spelling {
1879
    GNU_btf_decl_tag = 0,
1880
    CXX11_clang_btf_decl_tag = 1,
1881
    C2x_clang_btf_decl_tag = 2,
1882
  SpellingNotCalculated = 15
1883
 
1884
  };
1885
 
1886
  // Factory methods
1887
  static BTFDeclTagAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef BTFDeclTag, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
1888
  static BTFDeclTagAttr *Create(ASTContext &Ctx, llvm::StringRef BTFDeclTag, const AttributeCommonInfo &CommonInfo);
1889
  static BTFDeclTagAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef BTFDeclTag, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
1890
  static BTFDeclTagAttr *Create(ASTContext &Ctx, llvm::StringRef BTFDeclTag, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
1891
 
1892
  // Constructors
1893
  BTFDeclTagAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
1894
              , llvm::StringRef BTFDeclTag
1895
             );
1896
 
1897
  BTFDeclTagAttr *clone(ASTContext &C) const;
1898
  void printPretty(raw_ostream &OS,
1899
                   const PrintingPolicy &Policy) const;
1900
  const char *getSpelling() const;
1901
  llvm::StringRef getBTFDeclTag() const {
1902
    return llvm::StringRef(bTFDeclTag, bTFDeclTagLength);
1903
  }
1904
  unsigned getBTFDeclTagLength() const {
1905
    return bTFDeclTagLength;
1906
  }
1907
  void setBTFDeclTag(ASTContext &C, llvm::StringRef S) {
1908
    bTFDeclTagLength = S.size();
1909
    this->bTFDeclTag = new (C, 1) char [bTFDeclTagLength];
1910
    if (!S.empty())
1911
      std::memcpy(this->bTFDeclTag, S.data(), bTFDeclTagLength);
1912
  }
1913
 
1914
 
1915
 
1916
  static bool classof(const Attr *A) { return A->getKind() == attr::BTFDeclTag; }
1917
};
1918
 
1919
class BTFTypeTagAttr : public TypeAttr {
1920
unsigned bTFTypeTagLength;
1921
char *bTFTypeTag;
1922
 
1923
public:
1924
  enum Spelling {
1925
    GNU_btf_type_tag = 0,
1926
    CXX11_clang_btf_type_tag = 1,
1927
    C2x_clang_btf_type_tag = 2,
1928
  SpellingNotCalculated = 15
1929
 
1930
  };
1931
 
1932
  // Factory methods
1933
  static BTFTypeTagAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef BTFTypeTag, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
1934
  static BTFTypeTagAttr *Create(ASTContext &Ctx, llvm::StringRef BTFTypeTag, const AttributeCommonInfo &CommonInfo);
1935
  static BTFTypeTagAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef BTFTypeTag, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
1936
  static BTFTypeTagAttr *Create(ASTContext &Ctx, llvm::StringRef BTFTypeTag, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
1937
 
1938
  // Constructors
1939
  BTFTypeTagAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
1940
              , llvm::StringRef BTFTypeTag
1941
             );
1942
 
1943
  BTFTypeTagAttr *clone(ASTContext &C) const;
1944
  void printPretty(raw_ostream &OS,
1945
                   const PrintingPolicy &Policy) const;
1946
  const char *getSpelling() const;
1947
  llvm::StringRef getBTFTypeTag() const {
1948
    return llvm::StringRef(bTFTypeTag, bTFTypeTagLength);
1949
  }
1950
  unsigned getBTFTypeTagLength() const {
1951
    return bTFTypeTagLength;
1952
  }
1953
  void setBTFTypeTag(ASTContext &C, llvm::StringRef S) {
1954
    bTFTypeTagLength = S.size();
1955
    this->bTFTypeTag = new (C, 1) char [bTFTypeTagLength];
1956
    if (!S.empty())
1957
      std::memcpy(this->bTFTypeTag, S.data(), bTFTypeTagLength);
1958
  }
1959
 
1960
 
1961
 
1962
  static bool classof(const Attr *A) { return A->getKind() == attr::BTFTypeTag; }
1963
};
1964
 
1965
class BlocksAttr : public InheritableAttr {
1966
public:
1967
  enum BlockType {
1968
    ByRef
1969
  };
1970
private:
1971
  BlockType type;
1972
 
1973
public:
1974
  enum Spelling {
1975
    GNU_blocks = 0,
1976
    CXX11_clang_blocks = 1,
1977
    C2x_clang_blocks = 2,
1978
  SpellingNotCalculated = 15
1979
 
1980
  };
1981
 
1982
  // Factory methods
1983
  static BlocksAttr *CreateImplicit(ASTContext &Ctx, BlockType Type, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
1984
  static BlocksAttr *Create(ASTContext &Ctx, BlockType Type, const AttributeCommonInfo &CommonInfo);
1985
  static BlocksAttr *CreateImplicit(ASTContext &Ctx, BlockType Type, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
1986
  static BlocksAttr *Create(ASTContext &Ctx, BlockType Type, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
1987
 
1988
  // Constructors
1989
  BlocksAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
1990
              , BlockType Type
1991
             );
1992
 
1993
  BlocksAttr *clone(ASTContext &C) const;
1994
  void printPretty(raw_ostream &OS,
1995
                   const PrintingPolicy &Policy) const;
1996
  const char *getSpelling() const;
1997
  BlockType getType() const {
1998
    return type;
1999
  }
2000
 
2001
  static bool ConvertStrToBlockType(StringRef Val, BlockType &Out);
2002
  static const char *ConvertBlockTypeToStr(BlockType Val);
2003
 
2004
 
2005
  static bool classof(const Attr *A) { return A->getKind() == attr::Blocks; }
2006
};
2007
 
2008
class BuiltinAttr : public InheritableAttr {
2009
unsigned iD;
2010
 
2011
public:
2012
  // Factory methods
2013
  static BuiltinAttr *CreateImplicit(ASTContext &Ctx, unsigned ID, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
2014
  static BuiltinAttr *Create(ASTContext &Ctx, unsigned ID, const AttributeCommonInfo &CommonInfo);
2015
  static BuiltinAttr *CreateImplicit(ASTContext &Ctx, unsigned ID, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2016
  static BuiltinAttr *Create(ASTContext &Ctx, unsigned ID, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2017
 
2018
  // Constructors
2019
  BuiltinAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
2020
              , unsigned ID
2021
             );
2022
 
2023
  BuiltinAttr *clone(ASTContext &C) const;
2024
  void printPretty(raw_ostream &OS,
2025
                   const PrintingPolicy &Policy) const;
2026
  const char *getSpelling() const;
2027
  unsigned getID() const {
2028
    return iD;
2029
  }
2030
 
2031
 
2032
 
2033
  static bool classof(const Attr *A) { return A->getKind() == attr::Builtin; }
2034
};
2035
 
2036
class BuiltinAliasAttr : public Attr {
2037
IdentifierInfo * builtinName;
2038
 
2039
public:
2040
  enum Spelling {
2041
    CXX11_clang_builtin_alias = 0,
2042
    C2x_clang_builtin_alias = 1,
2043
    GNU_clang_builtin_alias = 2,
2044
  SpellingNotCalculated = 15
2045
 
2046
  };
2047
 
2048
  // Factory methods
2049
  static BuiltinAliasAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * BuiltinName, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
2050
  static BuiltinAliasAttr *Create(ASTContext &Ctx, IdentifierInfo * BuiltinName, const AttributeCommonInfo &CommonInfo);
2051
  static BuiltinAliasAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * BuiltinName, SourceRange Range, AttributeCommonInfo::Syntax Syntax, BuiltinAliasAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
2052
  static BuiltinAliasAttr *Create(ASTContext &Ctx, IdentifierInfo * BuiltinName, SourceRange Range, AttributeCommonInfo::Syntax Syntax, BuiltinAliasAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
2053
 
2054
  // Constructors
2055
  BuiltinAliasAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
2056
              , IdentifierInfo * BuiltinName
2057
             );
2058
 
2059
  BuiltinAliasAttr *clone(ASTContext &C) const;
2060
  void printPretty(raw_ostream &OS,
2061
                   const PrintingPolicy &Policy) const;
2062
  const char *getSpelling() const;
2063
  Spelling getSemanticSpelling() const;
2064
  IdentifierInfo * getBuiltinName() const {
2065
    return builtinName;
2066
  }
2067
 
2068
 
2069
 
2070
  static bool classof(const Attr *A) { return A->getKind() == attr::BuiltinAlias; }
2071
};
2072
 
2073
class C11NoReturnAttr : public InheritableAttr {
2074
public:
2075
  // Factory methods
2076
  static C11NoReturnAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
2077
  static C11NoReturnAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
2078
  static C11NoReturnAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2079
  static C11NoReturnAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2080
 
2081
  // Constructors
2082
  C11NoReturnAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
2083
             );
2084
 
2085
  C11NoReturnAttr *clone(ASTContext &C) const;
2086
  void printPretty(raw_ostream &OS,
2087
                   const PrintingPolicy &Policy) const;
2088
  const char *getSpelling() const;
2089
 
2090
 
2091
  static bool classof(const Attr *A) { return A->getKind() == attr::C11NoReturn; }
2092
};
2093
 
2094
class CDeclAttr : public InheritableAttr {
2095
public:
2096
  enum Spelling {
2097
    GNU_cdecl = 0,
2098
    CXX11_gnu_cdecl = 1,
2099
    C2x_gnu_cdecl = 2,
2100
    Keyword_cdecl = 3,
2101
  SpellingNotCalculated = 15
2102
 
2103
  };
2104
 
2105
  // Factory methods
2106
  static CDeclAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
2107
  static CDeclAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
2108
  static CDeclAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2109
  static CDeclAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2110
 
2111
  // Constructors
2112
  CDeclAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
2113
             );
2114
 
2115
  CDeclAttr *clone(ASTContext &C) const;
2116
  void printPretty(raw_ostream &OS,
2117
                   const PrintingPolicy &Policy) const;
2118
  const char *getSpelling() const;
2119
 
2120
 
2121
  static bool classof(const Attr *A) { return A->getKind() == attr::CDecl; }
2122
};
2123
 
2124
class CFAuditedTransferAttr : public InheritableAttr {
2125
public:
2126
  enum Spelling {
2127
    GNU_cf_audited_transfer = 0,
2128
    CXX11_clang_cf_audited_transfer = 1,
2129
    C2x_clang_cf_audited_transfer = 2,
2130
  SpellingNotCalculated = 15
2131
 
2132
  };
2133
 
2134
  // Factory methods
2135
  static CFAuditedTransferAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
2136
  static CFAuditedTransferAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
2137
  static CFAuditedTransferAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2138
  static CFAuditedTransferAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2139
 
2140
  // Constructors
2141
  CFAuditedTransferAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
2142
             );
2143
 
2144
  CFAuditedTransferAttr *clone(ASTContext &C) const;
2145
  void printPretty(raw_ostream &OS,
2146
                   const PrintingPolicy &Policy) const;
2147
  const char *getSpelling() const;
2148
 
2149
 
2150
  static bool classof(const Attr *A) { return A->getKind() == attr::CFAuditedTransfer; }
2151
};
2152
 
2153
class CFConsumedAttr : public InheritableParamAttr {
2154
public:
2155
  enum Spelling {
2156
    GNU_cf_consumed = 0,
2157
    CXX11_clang_cf_consumed = 1,
2158
    C2x_clang_cf_consumed = 2,
2159
  SpellingNotCalculated = 15
2160
 
2161
  };
2162
 
2163
  // Factory methods
2164
  static CFConsumedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
2165
  static CFConsumedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
2166
  static CFConsumedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2167
  static CFConsumedAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2168
 
2169
  // Constructors
2170
  CFConsumedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
2171
             );
2172
 
2173
  CFConsumedAttr *clone(ASTContext &C) const;
2174
  void printPretty(raw_ostream &OS,
2175
                   const PrintingPolicy &Policy) const;
2176
  const char *getSpelling() const;
2177
 
2178
 
2179
  static bool classof(const Attr *A) { return A->getKind() == attr::CFConsumed; }
2180
};
2181
 
2182
class CFGuardAttr : public InheritableAttr {
2183
public:
2184
  enum GuardArg {
2185
    nocf
2186
  };
2187
private:
2188
  GuardArg guard;
2189
 
2190
public:
2191
  enum Spelling {
2192
    Declspec_guard = 0,
2193
    GNU_guard = 1,
2194
    CXX11_clang_guard = 2,
2195
    C2x_clang_guard = 3,
2196
  SpellingNotCalculated = 15
2197
 
2198
  };
2199
 
2200
  // Factory methods
2201
  static CFGuardAttr *CreateImplicit(ASTContext &Ctx, GuardArg Guard, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
2202
  static CFGuardAttr *Create(ASTContext &Ctx, GuardArg Guard, const AttributeCommonInfo &CommonInfo);
2203
  static CFGuardAttr *CreateImplicit(ASTContext &Ctx, GuardArg Guard, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2204
  static CFGuardAttr *Create(ASTContext &Ctx, GuardArg Guard, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2205
 
2206
  // Constructors
2207
  CFGuardAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
2208
              , GuardArg Guard
2209
             );
2210
 
2211
  CFGuardAttr *clone(ASTContext &C) const;
2212
  void printPretty(raw_ostream &OS,
2213
                   const PrintingPolicy &Policy) const;
2214
  const char *getSpelling() const;
2215
  GuardArg getGuard() const {
2216
    return guard;
2217
  }
2218
 
2219
  static bool ConvertStrToGuardArg(StringRef Val, GuardArg &Out);
2220
  static const char *ConvertGuardArgToStr(GuardArg Val);
2221
 
2222
 
2223
  static bool classof(const Attr *A) { return A->getKind() == attr::CFGuard; }
2224
};
2225
 
2226
class CFICanonicalJumpTableAttr : public InheritableAttr {
2227
public:
2228
  enum Spelling {
2229
    GNU_cfi_canonical_jump_table = 0,
2230
    CXX11_clang_cfi_canonical_jump_table = 1,
2231
    C2x_clang_cfi_canonical_jump_table = 2,
2232
  SpellingNotCalculated = 15
2233
 
2234
  };
2235
 
2236
  // Factory methods
2237
  static CFICanonicalJumpTableAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
2238
  static CFICanonicalJumpTableAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
2239
  static CFICanonicalJumpTableAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2240
  static CFICanonicalJumpTableAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2241
 
2242
  // Constructors
2243
  CFICanonicalJumpTableAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
2244
             );
2245
 
2246
  CFICanonicalJumpTableAttr *clone(ASTContext &C) const;
2247
  void printPretty(raw_ostream &OS,
2248
                   const PrintingPolicy &Policy) const;
2249
  const char *getSpelling() const;
2250
 
2251
 
2252
  static bool classof(const Attr *A) { return A->getKind() == attr::CFICanonicalJumpTable; }
2253
};
2254
 
2255
class CFReturnsNotRetainedAttr : public InheritableAttr {
2256
public:
2257
  enum Spelling {
2258
    GNU_cf_returns_not_retained = 0,
2259
    CXX11_clang_cf_returns_not_retained = 1,
2260
    C2x_clang_cf_returns_not_retained = 2,
2261
  SpellingNotCalculated = 15
2262
 
2263
  };
2264
 
2265
  // Factory methods
2266
  static CFReturnsNotRetainedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
2267
  static CFReturnsNotRetainedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
2268
  static CFReturnsNotRetainedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2269
  static CFReturnsNotRetainedAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2270
 
2271
  // Constructors
2272
  CFReturnsNotRetainedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
2273
             );
2274
 
2275
  CFReturnsNotRetainedAttr *clone(ASTContext &C) const;
2276
  void printPretty(raw_ostream &OS,
2277
                   const PrintingPolicy &Policy) const;
2278
  const char *getSpelling() const;
2279
 
2280
 
2281
  static bool classof(const Attr *A) { return A->getKind() == attr::CFReturnsNotRetained; }
2282
};
2283
 
2284
class CFReturnsRetainedAttr : public InheritableAttr {
2285
public:
2286
  enum Spelling {
2287
    GNU_cf_returns_retained = 0,
2288
    CXX11_clang_cf_returns_retained = 1,
2289
    C2x_clang_cf_returns_retained = 2,
2290
  SpellingNotCalculated = 15
2291
 
2292
  };
2293
 
2294
  // Factory methods
2295
  static CFReturnsRetainedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
2296
  static CFReturnsRetainedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
2297
  static CFReturnsRetainedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2298
  static CFReturnsRetainedAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2299
 
2300
  // Constructors
2301
  CFReturnsRetainedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
2302
             );
2303
 
2304
  CFReturnsRetainedAttr *clone(ASTContext &C) const;
2305
  void printPretty(raw_ostream &OS,
2306
                   const PrintingPolicy &Policy) const;
2307
  const char *getSpelling() const;
2308
 
2309
 
2310
  static bool classof(const Attr *A) { return A->getKind() == attr::CFReturnsRetained; }
2311
};
2312
 
2313
class CFUnknownTransferAttr : public InheritableAttr {
2314
public:
2315
  enum Spelling {
2316
    GNU_cf_unknown_transfer = 0,
2317
    CXX11_clang_cf_unknown_transfer = 1,
2318
    C2x_clang_cf_unknown_transfer = 2,
2319
  SpellingNotCalculated = 15
2320
 
2321
  };
2322
 
2323
  // Factory methods
2324
  static CFUnknownTransferAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
2325
  static CFUnknownTransferAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
2326
  static CFUnknownTransferAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2327
  static CFUnknownTransferAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2328
 
2329
  // Constructors
2330
  CFUnknownTransferAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
2331
             );
2332
 
2333
  CFUnknownTransferAttr *clone(ASTContext &C) const;
2334
  void printPretty(raw_ostream &OS,
2335
                   const PrintingPolicy &Policy) const;
2336
  const char *getSpelling() const;
2337
 
2338
 
2339
  static bool classof(const Attr *A) { return A->getKind() == attr::CFUnknownTransfer; }
2340
};
2341
 
2342
class CPUDispatchAttr : public InheritableAttr {
2343
  unsigned cpus_Size;
2344
  IdentifierInfo * *cpus_;
2345
 
2346
public:
2347
  enum Spelling {
2348
    GNU_cpu_dispatch = 0,
2349
    CXX11_clang_cpu_dispatch = 1,
2350
    C2x_clang_cpu_dispatch = 2,
2351
    Declspec_cpu_dispatch = 3,
2352
  SpellingNotCalculated = 15
2353
 
2354
  };
2355
 
2356
  // Factory methods
2357
  static CPUDispatchAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * *Cpus, unsigned CpusSize, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
2358
  static CPUDispatchAttr *Create(ASTContext &Ctx, IdentifierInfo * *Cpus, unsigned CpusSize, const AttributeCommonInfo &CommonInfo);
2359
  static CPUDispatchAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * *Cpus, unsigned CpusSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2360
  static CPUDispatchAttr *Create(ASTContext &Ctx, IdentifierInfo * *Cpus, unsigned CpusSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2361
 
2362
  // Constructors
2363
  CPUDispatchAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
2364
              , IdentifierInfo * *Cpus, unsigned CpusSize
2365
             );
2366
  CPUDispatchAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
2367
             );
2368
 
2369
  CPUDispatchAttr *clone(ASTContext &C) const;
2370
  void printPretty(raw_ostream &OS,
2371
                   const PrintingPolicy &Policy) const;
2372
  const char *getSpelling() const;
2373
  typedef IdentifierInfo ** cpus_iterator;
2374
  cpus_iterator cpus_begin() const { return cpus_; }
2375
  cpus_iterator cpus_end() const { return cpus_ + cpus_Size; }
2376
  unsigned cpus_size() const { return cpus_Size; }
2377
  llvm::iterator_range<cpus_iterator> cpus() const { return llvm::make_range(cpus_begin(), cpus_end()); }
2378
 
2379
 
2380
 
2381
 
2382
  static bool classof(const Attr *A) { return A->getKind() == attr::CPUDispatch; }
2383
};
2384
 
2385
class CPUSpecificAttr : public InheritableAttr {
2386
  unsigned cpus_Size;
2387
  IdentifierInfo * *cpus_;
2388
 
2389
public:
2390
  enum Spelling {
2391
    GNU_cpu_specific = 0,
2392
    CXX11_clang_cpu_specific = 1,
2393
    C2x_clang_cpu_specific = 2,
2394
    Declspec_cpu_specific = 3,
2395
  SpellingNotCalculated = 15
2396
 
2397
  };
2398
 
2399
  // Factory methods
2400
  static CPUSpecificAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * *Cpus, unsigned CpusSize, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
2401
  static CPUSpecificAttr *Create(ASTContext &Ctx, IdentifierInfo * *Cpus, unsigned CpusSize, const AttributeCommonInfo &CommonInfo);
2402
  static CPUSpecificAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * *Cpus, unsigned CpusSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2403
  static CPUSpecificAttr *Create(ASTContext &Ctx, IdentifierInfo * *Cpus, unsigned CpusSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2404
 
2405
  // Constructors
2406
  CPUSpecificAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
2407
              , IdentifierInfo * *Cpus, unsigned CpusSize
2408
             );
2409
  CPUSpecificAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
2410
             );
2411
 
2412
  CPUSpecificAttr *clone(ASTContext &C) const;
2413
  void printPretty(raw_ostream &OS,
2414
                   const PrintingPolicy &Policy) const;
2415
  const char *getSpelling() const;
2416
  typedef IdentifierInfo ** cpus_iterator;
2417
  cpus_iterator cpus_begin() const { return cpus_; }
2418
  cpus_iterator cpus_end() const { return cpus_ + cpus_Size; }
2419
  unsigned cpus_size() const { return cpus_Size; }
2420
  llvm::iterator_range<cpus_iterator> cpus() const { return llvm::make_range(cpus_begin(), cpus_end()); }
2421
 
2422
 
2423
 
2424
    IdentifierInfo *getCPUName(unsigned Index) const {
2425
      return *(cpus_begin() + Index);
2426
    }
2427
 
2428
 
2429
  static bool classof(const Attr *A) { return A->getKind() == attr::CPUSpecific; }
2430
};
2431
 
2432
class CUDAConstantAttr : public InheritableAttr {
2433
public:
2434
  enum Spelling {
2435
    GNU_constant = 0,
2436
    Declspec_constant = 1,
2437
  SpellingNotCalculated = 15
2438
 
2439
  };
2440
 
2441
  // Factory methods
2442
  static CUDAConstantAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
2443
  static CUDAConstantAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
2444
  static CUDAConstantAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2445
  static CUDAConstantAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2446
 
2447
  // Constructors
2448
  CUDAConstantAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
2449
             );
2450
 
2451
  CUDAConstantAttr *clone(ASTContext &C) const;
2452
  void printPretty(raw_ostream &OS,
2453
                   const PrintingPolicy &Policy) const;
2454
  const char *getSpelling() const;
2455
 
2456
 
2457
  static bool classof(const Attr *A) { return A->getKind() == attr::CUDAConstant; }
2458
};
2459
 
2460
class CUDADeviceAttr : public InheritableAttr {
2461
public:
2462
  enum Spelling {
2463
    GNU_device = 0,
2464
    Declspec_device = 1,
2465
  SpellingNotCalculated = 15
2466
 
2467
  };
2468
 
2469
  // Factory methods
2470
  static CUDADeviceAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
2471
  static CUDADeviceAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
2472
  static CUDADeviceAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2473
  static CUDADeviceAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2474
 
2475
  // Constructors
2476
  CUDADeviceAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
2477
             );
2478
 
2479
  CUDADeviceAttr *clone(ASTContext &C) const;
2480
  void printPretty(raw_ostream &OS,
2481
                   const PrintingPolicy &Policy) const;
2482
  const char *getSpelling() const;
2483
 
2484
 
2485
  static bool classof(const Attr *A) { return A->getKind() == attr::CUDADevice; }
2486
};
2487
 
2488
class CUDADeviceBuiltinSurfaceTypeAttr : public InheritableAttr {
2489
public:
2490
  enum Spelling {
2491
    GNU_device_builtin_surface_type = 0,
2492
    Declspec_device_builtin_surface_type = 1,
2493
  SpellingNotCalculated = 15
2494
 
2495
  };
2496
 
2497
  // Factory methods
2498
  static CUDADeviceBuiltinSurfaceTypeAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
2499
  static CUDADeviceBuiltinSurfaceTypeAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
2500
  static CUDADeviceBuiltinSurfaceTypeAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2501
  static CUDADeviceBuiltinSurfaceTypeAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2502
 
2503
  // Constructors
2504
  CUDADeviceBuiltinSurfaceTypeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
2505
             );
2506
 
2507
  CUDADeviceBuiltinSurfaceTypeAttr *clone(ASTContext &C) const;
2508
  void printPretty(raw_ostream &OS,
2509
                   const PrintingPolicy &Policy) const;
2510
  const char *getSpelling() const;
2511
 
2512
 
2513
  static bool classof(const Attr *A) { return A->getKind() == attr::CUDADeviceBuiltinSurfaceType; }
2514
};
2515
 
2516
class CUDADeviceBuiltinTextureTypeAttr : public InheritableAttr {
2517
public:
2518
  enum Spelling {
2519
    GNU_device_builtin_texture_type = 0,
2520
    Declspec_device_builtin_texture_type = 1,
2521
  SpellingNotCalculated = 15
2522
 
2523
  };
2524
 
2525
  // Factory methods
2526
  static CUDADeviceBuiltinTextureTypeAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
2527
  static CUDADeviceBuiltinTextureTypeAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
2528
  static CUDADeviceBuiltinTextureTypeAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2529
  static CUDADeviceBuiltinTextureTypeAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2530
 
2531
  // Constructors
2532
  CUDADeviceBuiltinTextureTypeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
2533
             );
2534
 
2535
  CUDADeviceBuiltinTextureTypeAttr *clone(ASTContext &C) const;
2536
  void printPretty(raw_ostream &OS,
2537
                   const PrintingPolicy &Policy) const;
2538
  const char *getSpelling() const;
2539
 
2540
 
2541
  static bool classof(const Attr *A) { return A->getKind() == attr::CUDADeviceBuiltinTextureType; }
2542
};
2543
 
2544
class CUDAGlobalAttr : public InheritableAttr {
2545
public:
2546
  enum Spelling {
2547
    GNU_global = 0,
2548
    Declspec_global = 1,
2549
  SpellingNotCalculated = 15
2550
 
2551
  };
2552
 
2553
  // Factory methods
2554
  static CUDAGlobalAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
2555
  static CUDAGlobalAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
2556
  static CUDAGlobalAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2557
  static CUDAGlobalAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2558
 
2559
  // Constructors
2560
  CUDAGlobalAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
2561
             );
2562
 
2563
  CUDAGlobalAttr *clone(ASTContext &C) const;
2564
  void printPretty(raw_ostream &OS,
2565
                   const PrintingPolicy &Policy) const;
2566
  const char *getSpelling() const;
2567
 
2568
 
2569
  static bool classof(const Attr *A) { return A->getKind() == attr::CUDAGlobal; }
2570
};
2571
 
2572
class CUDAHostAttr : public InheritableAttr {
2573
public:
2574
  enum Spelling {
2575
    GNU_host = 0,
2576
    Declspec_host = 1,
2577
  SpellingNotCalculated = 15
2578
 
2579
  };
2580
 
2581
  // Factory methods
2582
  static CUDAHostAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
2583
  static CUDAHostAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
2584
  static CUDAHostAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2585
  static CUDAHostAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2586
 
2587
  // Constructors
2588
  CUDAHostAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
2589
             );
2590
 
2591
  CUDAHostAttr *clone(ASTContext &C) const;
2592
  void printPretty(raw_ostream &OS,
2593
                   const PrintingPolicy &Policy) const;
2594
  const char *getSpelling() const;
2595
 
2596
 
2597
  static bool classof(const Attr *A) { return A->getKind() == attr::CUDAHost; }
2598
};
2599
 
2600
class CUDAInvalidTargetAttr : public InheritableAttr {
2601
public:
2602
  // Factory methods
2603
  static CUDAInvalidTargetAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
2604
  static CUDAInvalidTargetAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
2605
  static CUDAInvalidTargetAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2606
  static CUDAInvalidTargetAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2607
 
2608
  // Constructors
2609
  CUDAInvalidTargetAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
2610
             );
2611
 
2612
  CUDAInvalidTargetAttr *clone(ASTContext &C) const;
2613
  void printPretty(raw_ostream &OS,
2614
                   const PrintingPolicy &Policy) const;
2615
  const char *getSpelling() const;
2616
 
2617
 
2618
  static bool classof(const Attr *A) { return A->getKind() == attr::CUDAInvalidTarget; }
2619
};
2620
 
2621
class CUDALaunchBoundsAttr : public InheritableAttr {
2622
Expr * maxThreads;
2623
 
2624
Expr * minBlocks;
2625
 
2626
public:
2627
  enum Spelling {
2628
    GNU_launch_bounds = 0,
2629
    Declspec_launch_bounds = 1,
2630
  SpellingNotCalculated = 15
2631
 
2632
  };
2633
 
2634
  // Factory methods
2635
  static CUDALaunchBoundsAttr *CreateImplicit(ASTContext &Ctx, Expr * MaxThreads, Expr * MinBlocks, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
2636
  static CUDALaunchBoundsAttr *Create(ASTContext &Ctx, Expr * MaxThreads, Expr * MinBlocks, const AttributeCommonInfo &CommonInfo);
2637
  static CUDALaunchBoundsAttr *CreateImplicit(ASTContext &Ctx, Expr * MaxThreads, Expr * MinBlocks, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2638
  static CUDALaunchBoundsAttr *Create(ASTContext &Ctx, Expr * MaxThreads, Expr * MinBlocks, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2639
 
2640
  // Constructors
2641
  CUDALaunchBoundsAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
2642
              , Expr * MaxThreads
2643
              , Expr * MinBlocks
2644
             );
2645
  CUDALaunchBoundsAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
2646
              , Expr * MaxThreads
2647
             );
2648
 
2649
  CUDALaunchBoundsAttr *clone(ASTContext &C) const;
2650
  void printPretty(raw_ostream &OS,
2651
                   const PrintingPolicy &Policy) const;
2652
  const char *getSpelling() const;
2653
  Expr * getMaxThreads() const {
2654
    return maxThreads;
2655
  }
2656
 
2657
  Expr * getMinBlocks() const {
2658
    return minBlocks;
2659
  }
2660
 
2661
 
2662
 
2663
  static bool classof(const Attr *A) { return A->getKind() == attr::CUDALaunchBounds; }
2664
};
2665
 
2666
class CUDASharedAttr : public InheritableAttr {
2667
public:
2668
  enum Spelling {
2669
    GNU_shared = 0,
2670
    Declspec_shared = 1,
2671
  SpellingNotCalculated = 15
2672
 
2673
  };
2674
 
2675
  // Factory methods
2676
  static CUDASharedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
2677
  static CUDASharedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
2678
  static CUDASharedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2679
  static CUDASharedAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2680
 
2681
  // Constructors
2682
  CUDASharedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
2683
             );
2684
 
2685
  CUDASharedAttr *clone(ASTContext &C) const;
2686
  void printPretty(raw_ostream &OS,
2687
                   const PrintingPolicy &Policy) const;
2688
  const char *getSpelling() const;
2689
 
2690
 
2691
  static bool classof(const Attr *A) { return A->getKind() == attr::CUDAShared; }
2692
};
2693
 
2694
class CXX11NoReturnAttr : public InheritableAttr {
2695
public:
2696
  enum Spelling {
2697
    CXX11_noreturn = 0,
2698
    C2x_noreturn = 1,
2699
    C2x_Noreturn = 2,
2700
  SpellingNotCalculated = 15
2701
 
2702
  };
2703
 
2704
  // Factory methods
2705
  static CXX11NoReturnAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
2706
  static CXX11NoReturnAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
2707
  static CXX11NoReturnAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax, CXX11NoReturnAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
2708
  static CXX11NoReturnAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax, CXX11NoReturnAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
2709
 
2710
  // Constructors
2711
  CXX11NoReturnAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
2712
             );
2713
 
2714
  CXX11NoReturnAttr *clone(ASTContext &C) const;
2715
  void printPretty(raw_ostream &OS,
2716
                   const PrintingPolicy &Policy) const;
2717
  const char *getSpelling() const;
2718
  Spelling getSemanticSpelling() const;
2719
 
2720
 
2721
  static bool classof(const Attr *A) { return A->getKind() == attr::CXX11NoReturn; }
2722
};
2723
 
2724
class CallableWhenAttr : public InheritableAttr {
2725
public:
2726
  enum ConsumedState {
2727
    Unknown,
2728
    Consumed,
2729
    Unconsumed
2730
  };
2731
private:
2732
  unsigned callableStates_Size;
2733
  ConsumedState *callableStates_;
2734
 
2735
public:
2736
  enum Spelling {
2737
    GNU_callable_when = 0,
2738
    CXX11_clang_callable_when = 1,
2739
  SpellingNotCalculated = 15
2740
 
2741
  };
2742
 
2743
  // Factory methods
2744
  static CallableWhenAttr *CreateImplicit(ASTContext &Ctx, ConsumedState *CallableStates, unsigned CallableStatesSize, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
2745
  static CallableWhenAttr *Create(ASTContext &Ctx, ConsumedState *CallableStates, unsigned CallableStatesSize, const AttributeCommonInfo &CommonInfo);
2746
  static CallableWhenAttr *CreateImplicit(ASTContext &Ctx, ConsumedState *CallableStates, unsigned CallableStatesSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2747
  static CallableWhenAttr *Create(ASTContext &Ctx, ConsumedState *CallableStates, unsigned CallableStatesSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2748
 
2749
  // Constructors
2750
  CallableWhenAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
2751
              , ConsumedState *CallableStates, unsigned CallableStatesSize
2752
             );
2753
  CallableWhenAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
2754
             );
2755
 
2756
  CallableWhenAttr *clone(ASTContext &C) const;
2757
  void printPretty(raw_ostream &OS,
2758
                   const PrintingPolicy &Policy) const;
2759
  const char *getSpelling() const;
2760
  typedef ConsumedState* callableStates_iterator;
2761
  callableStates_iterator callableStates_begin() const { return callableStates_; }
2762
  callableStates_iterator callableStates_end() const { return callableStates_ + callableStates_Size; }
2763
  unsigned callableStates_size() const { return callableStates_Size; }
2764
  llvm::iterator_range<callableStates_iterator> callableStates() const { return llvm::make_range(callableStates_begin(), callableStates_end()); }
2765
 
2766
 
2767
  static bool ConvertStrToConsumedState(StringRef Val, ConsumedState &Out);
2768
  static const char *ConvertConsumedStateToStr(ConsumedState Val);
2769
 
2770
 
2771
  static bool classof(const Attr *A) { return A->getKind() == attr::CallableWhen; }
2772
};
2773
 
2774
class CallbackAttr : public InheritableAttr {
2775
  unsigned encoding_Size;
2776
  int *encoding_;
2777
 
2778
public:
2779
  enum Spelling {
2780
    GNU_callback = 0,
2781
    CXX11_clang_callback = 1,
2782
    C2x_clang_callback = 2,
2783
  SpellingNotCalculated = 15
2784
 
2785
  };
2786
 
2787
  // Factory methods
2788
  static CallbackAttr *CreateImplicit(ASTContext &Ctx, int *Encoding, unsigned EncodingSize, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
2789
  static CallbackAttr *Create(ASTContext &Ctx, int *Encoding, unsigned EncodingSize, const AttributeCommonInfo &CommonInfo);
2790
  static CallbackAttr *CreateImplicit(ASTContext &Ctx, int *Encoding, unsigned EncodingSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2791
  static CallbackAttr *Create(ASTContext &Ctx, int *Encoding, unsigned EncodingSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2792
 
2793
  // Constructors
2794
  CallbackAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
2795
              , int *Encoding, unsigned EncodingSize
2796
             );
2797
  CallbackAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
2798
             );
2799
 
2800
  CallbackAttr *clone(ASTContext &C) const;
2801
  void printPretty(raw_ostream &OS,
2802
                   const PrintingPolicy &Policy) const;
2803
  const char *getSpelling() const;
2804
  typedef int* encoding_iterator;
2805
  encoding_iterator encoding_begin() const { return encoding_; }
2806
  encoding_iterator encoding_end() const { return encoding_ + encoding_Size; }
2807
  unsigned encoding_size() const { return encoding_Size; }
2808
  llvm::iterator_range<encoding_iterator> encoding() const { return llvm::make_range(encoding_begin(), encoding_end()); }
2809
 
2810
 
2811
 
2812
 
2813
  static bool classof(const Attr *A) { return A->getKind() == attr::Callback; }
2814
};
2815
 
2816
class CalledOnceAttr : public Attr {
2817
public:
2818
  enum Spelling {
2819
    GNU_called_once = 0,
2820
    CXX11_clang_called_once = 1,
2821
    C2x_clang_called_once = 2,
2822
  SpellingNotCalculated = 15
2823
 
2824
  };
2825
 
2826
  // Factory methods
2827
  static CalledOnceAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
2828
  static CalledOnceAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
2829
  static CalledOnceAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2830
  static CalledOnceAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2831
 
2832
  // Constructors
2833
  CalledOnceAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
2834
             );
2835
 
2836
  CalledOnceAttr *clone(ASTContext &C) const;
2837
  void printPretty(raw_ostream &OS,
2838
                   const PrintingPolicy &Policy) const;
2839
  const char *getSpelling() const;
2840
 
2841
 
2842
  static bool classof(const Attr *A) { return A->getKind() == attr::CalledOnce; }
2843
};
2844
 
2845
class CapabilityAttr : public InheritableAttr {
2846
unsigned nameLength;
2847
char *name;
2848
 
2849
public:
2850
  enum Spelling {
2851
    GNU_capability = 0,
2852
    CXX11_clang_capability = 1,
2853
    GNU_shared_capability = 2,
2854
    CXX11_clang_shared_capability = 3,
2855
  SpellingNotCalculated = 15
2856
 
2857
  };
2858
 
2859
  // Factory methods
2860
  static CapabilityAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Name, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
2861
  static CapabilityAttr *Create(ASTContext &Ctx, llvm::StringRef Name, const AttributeCommonInfo &CommonInfo);
2862
  static CapabilityAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Name, SourceRange Range, AttributeCommonInfo::Syntax Syntax, CapabilityAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
2863
  static CapabilityAttr *Create(ASTContext &Ctx, llvm::StringRef Name, SourceRange Range, AttributeCommonInfo::Syntax Syntax, CapabilityAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
2864
 
2865
  // Constructors
2866
  CapabilityAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
2867
              , llvm::StringRef Name
2868
             );
2869
 
2870
  CapabilityAttr *clone(ASTContext &C) const;
2871
  void printPretty(raw_ostream &OS,
2872
                   const PrintingPolicy &Policy) const;
2873
  const char *getSpelling() const;
2874
  Spelling getSemanticSpelling() const;
2875
  bool isShared() const { return getAttributeSpellingListIndex() == 2 ||
2876
    getAttributeSpellingListIndex() == 3; }
2877
  llvm::StringRef getName() const {
2878
    return llvm::StringRef(name, nameLength);
2879
  }
2880
  unsigned getNameLength() const {
2881
    return nameLength;
2882
  }
2883
  void setName(ASTContext &C, llvm::StringRef S) {
2884
    nameLength = S.size();
2885
    this->name = new (C, 1) char [nameLength];
2886
    if (!S.empty())
2887
      std::memcpy(this->name, S.data(), nameLength);
2888
  }
2889
 
2890
 
2891
 
2892
  static bool classof(const Attr *A) { return A->getKind() == attr::Capability; }
2893
};
2894
 
2895
class CapturedRecordAttr : public InheritableAttr {
2896
public:
2897
  // Factory methods
2898
  static CapturedRecordAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
2899
  static CapturedRecordAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
2900
  static CapturedRecordAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2901
  static CapturedRecordAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2902
 
2903
  // Constructors
2904
  CapturedRecordAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
2905
             );
2906
 
2907
  CapturedRecordAttr *clone(ASTContext &C) const;
2908
  void printPretty(raw_ostream &OS,
2909
                   const PrintingPolicy &Policy) const;
2910
  const char *getSpelling() const;
2911
 
2912
 
2913
  static bool classof(const Attr *A) { return A->getKind() == attr::CapturedRecord; }
2914
};
2915
 
2916
class CarriesDependencyAttr : public InheritableParamAttr {
2917
public:
2918
  enum Spelling {
2919
    GNU_carries_dependency = 0,
2920
    CXX11_carries_dependency = 1,
2921
  SpellingNotCalculated = 15
2922
 
2923
  };
2924
 
2925
  // Factory methods
2926
  static CarriesDependencyAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
2927
  static CarriesDependencyAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
2928
  static CarriesDependencyAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2929
  static CarriesDependencyAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2930
 
2931
  // Constructors
2932
  CarriesDependencyAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
2933
             );
2934
 
2935
  CarriesDependencyAttr *clone(ASTContext &C) const;
2936
  void printPretty(raw_ostream &OS,
2937
                   const PrintingPolicy &Policy) const;
2938
  const char *getSpelling() const;
2939
 
2940
 
2941
  static bool classof(const Attr *A) { return A->getKind() == attr::CarriesDependency; }
2942
};
2943
 
2944
class CleanupAttr : public InheritableAttr {
2945
FunctionDecl * functionDecl;
2946
 
2947
public:
2948
  enum Spelling {
2949
    GNU_cleanup = 0,
2950
    CXX11_gnu_cleanup = 1,
2951
    C2x_gnu_cleanup = 2,
2952
  SpellingNotCalculated = 15
2953
 
2954
  };
2955
 
2956
  // Factory methods
2957
  static CleanupAttr *CreateImplicit(ASTContext &Ctx, FunctionDecl * FunctionDecl, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
2958
  static CleanupAttr *Create(ASTContext &Ctx, FunctionDecl * FunctionDecl, const AttributeCommonInfo &CommonInfo);
2959
  static CleanupAttr *CreateImplicit(ASTContext &Ctx, FunctionDecl * FunctionDecl, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2960
  static CleanupAttr *Create(ASTContext &Ctx, FunctionDecl * FunctionDecl, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2961
 
2962
  // Constructors
2963
  CleanupAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
2964
              , FunctionDecl * FunctionDecl
2965
             );
2966
 
2967
  CleanupAttr *clone(ASTContext &C) const;
2968
  void printPretty(raw_ostream &OS,
2969
                   const PrintingPolicy &Policy) const;
2970
  const char *getSpelling() const;
2971
  FunctionDecl * getFunctionDecl() const {
2972
    return functionDecl;
2973
  }
2974
 
2975
 
2976
 
2977
  static bool classof(const Attr *A) { return A->getKind() == attr::Cleanup; }
2978
};
2979
 
2980
class CmseNSCallAttr : public TypeAttr {
2981
public:
2982
  // Factory methods
2983
  static CmseNSCallAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
2984
  static CmseNSCallAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
2985
  static CmseNSCallAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2986
  static CmseNSCallAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
2987
 
2988
  // Constructors
2989
  CmseNSCallAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
2990
             );
2991
 
2992
  CmseNSCallAttr *clone(ASTContext &C) const;
2993
  void printPretty(raw_ostream &OS,
2994
                   const PrintingPolicy &Policy) const;
2995
  const char *getSpelling() const;
2996
 
2997
 
2998
  static bool classof(const Attr *A) { return A->getKind() == attr::CmseNSCall; }
2999
};
3000
 
3001
class CmseNSEntryAttr : public InheritableAttr {
3002
public:
3003
  // Factory methods
3004
  static CmseNSEntryAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
3005
  static CmseNSEntryAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
3006
  static CmseNSEntryAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3007
  static CmseNSEntryAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3008
 
3009
  // Constructors
3010
  CmseNSEntryAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
3011
             );
3012
 
3013
  CmseNSEntryAttr *clone(ASTContext &C) const;
3014
  void printPretty(raw_ostream &OS,
3015
                   const PrintingPolicy &Policy) const;
3016
  const char *getSpelling() const;
3017
 
3018
 
3019
  static bool classof(const Attr *A) { return A->getKind() == attr::CmseNSEntry; }
3020
};
3021
 
3022
class CodeSegAttr : public InheritableAttr {
3023
unsigned nameLength;
3024
char *name;
3025
 
3026
public:
3027
  // Factory methods
3028
  static CodeSegAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Name, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
3029
  static CodeSegAttr *Create(ASTContext &Ctx, llvm::StringRef Name, const AttributeCommonInfo &CommonInfo);
3030
  static CodeSegAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Name, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3031
  static CodeSegAttr *Create(ASTContext &Ctx, llvm::StringRef Name, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3032
 
3033
  // Constructors
3034
  CodeSegAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
3035
              , llvm::StringRef Name
3036
             );
3037
 
3038
  CodeSegAttr *clone(ASTContext &C) const;
3039
  void printPretty(raw_ostream &OS,
3040
                   const PrintingPolicy &Policy) const;
3041
  const char *getSpelling() const;
3042
  llvm::StringRef getName() const {
3043
    return llvm::StringRef(name, nameLength);
3044
  }
3045
  unsigned getNameLength() const {
3046
    return nameLength;
3047
  }
3048
  void setName(ASTContext &C, llvm::StringRef S) {
3049
    nameLength = S.size();
3050
    this->name = new (C, 1) char [nameLength];
3051
    if (!S.empty())
3052
      std::memcpy(this->name, S.data(), nameLength);
3053
  }
3054
 
3055
 
3056
 
3057
  static bool classof(const Attr *A) { return A->getKind() == attr::CodeSeg; }
3058
};
3059
 
3060
class ColdAttr : public InheritableAttr {
3061
public:
3062
  enum Spelling {
3063
    GNU_cold = 0,
3064
    CXX11_gnu_cold = 1,
3065
    C2x_gnu_cold = 2,
3066
  SpellingNotCalculated = 15
3067
 
3068
  };
3069
 
3070
  // Factory methods
3071
  static ColdAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
3072
  static ColdAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
3073
  static ColdAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3074
  static ColdAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3075
 
3076
  // Constructors
3077
  ColdAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
3078
             );
3079
 
3080
  ColdAttr *clone(ASTContext &C) const;
3081
  void printPretty(raw_ostream &OS,
3082
                   const PrintingPolicy &Policy) const;
3083
  const char *getSpelling() const;
3084
 
3085
 
3086
  static bool classof(const Attr *A) { return A->getKind() == attr::Cold; }
3087
};
3088
 
3089
class CommonAttr : public InheritableAttr {
3090
public:
3091
  enum Spelling {
3092
    GNU_common = 0,
3093
    CXX11_gnu_common = 1,
3094
    C2x_gnu_common = 2,
3095
  SpellingNotCalculated = 15
3096
 
3097
  };
3098
 
3099
  // Factory methods
3100
  static CommonAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
3101
  static CommonAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
3102
  static CommonAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3103
  static CommonAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3104
 
3105
  // Constructors
3106
  CommonAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
3107
             );
3108
 
3109
  CommonAttr *clone(ASTContext &C) const;
3110
  void printPretty(raw_ostream &OS,
3111
                   const PrintingPolicy &Policy) const;
3112
  const char *getSpelling() const;
3113
 
3114
 
3115
  static bool classof(const Attr *A) { return A->getKind() == attr::Common; }
3116
};
3117
 
3118
class ConstAttr : public InheritableAttr {
3119
public:
3120
  enum Spelling {
3121
    GNU_const = 0,
3122
    CXX11_gnu_const = 1,
3123
    C2x_gnu_const = 2,
3124
  SpellingNotCalculated = 15
3125
 
3126
  };
3127
 
3128
  // Factory methods
3129
  static ConstAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
3130
  static ConstAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
3131
  static ConstAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3132
  static ConstAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3133
 
3134
  // Constructors
3135
  ConstAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
3136
             );
3137
 
3138
  ConstAttr *clone(ASTContext &C) const;
3139
  void printPretty(raw_ostream &OS,
3140
                   const PrintingPolicy &Policy) const;
3141
  const char *getSpelling() const;
3142
 
3143
 
3144
  static bool classof(const Attr *A) { return A->getKind() == attr::Const; }
3145
};
3146
 
3147
class ConstInitAttr : public InheritableAttr {
3148
public:
3149
  enum Spelling {
3150
    Keyword_constinit = 0,
3151
    GNU_require_constant_initialization = 1,
3152
    CXX11_clang_require_constant_initialization = 2,
3153
  SpellingNotCalculated = 15
3154
 
3155
  };
3156
 
3157
  // Factory methods
3158
  static ConstInitAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
3159
  static ConstInitAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
3160
  static ConstInitAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax, ConstInitAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
3161
  static ConstInitAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax, ConstInitAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
3162
 
3163
  // Constructors
3164
  ConstInitAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
3165
             );
3166
 
3167
  ConstInitAttr *clone(ASTContext &C) const;
3168
  void printPretty(raw_ostream &OS,
3169
                   const PrintingPolicy &Policy) const;
3170
  const char *getSpelling() const;
3171
  Spelling getSemanticSpelling() const;
3172
  bool isConstinit() const { return getAttributeSpellingListIndex() == 0; }
3173
 
3174
 
3175
  static bool classof(const Attr *A) { return A->getKind() == attr::ConstInit; }
3176
};
3177
 
3178
class ConstructorAttr : public InheritableAttr {
3179
int priority;
3180
 
3181
public:
3182
  enum Spelling {
3183
    GNU_constructor = 0,
3184
    CXX11_gnu_constructor = 1,
3185
    C2x_gnu_constructor = 2,
3186
  SpellingNotCalculated = 15
3187
 
3188
  };
3189
 
3190
  // Factory methods
3191
  static ConstructorAttr *CreateImplicit(ASTContext &Ctx, int Priority, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
3192
  static ConstructorAttr *Create(ASTContext &Ctx, int Priority, const AttributeCommonInfo &CommonInfo);
3193
  static ConstructorAttr *CreateImplicit(ASTContext &Ctx, int Priority, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3194
  static ConstructorAttr *Create(ASTContext &Ctx, int Priority, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3195
 
3196
  // Constructors
3197
  ConstructorAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
3198
              , int Priority
3199
             );
3200
  ConstructorAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
3201
             );
3202
 
3203
  ConstructorAttr *clone(ASTContext &C) const;
3204
  void printPretty(raw_ostream &OS,
3205
                   const PrintingPolicy &Policy) const;
3206
  const char *getSpelling() const;
3207
  int getPriority() const {
3208
    return priority;
3209
  }
3210
 
3211
  static const int DefaultPriority = 65535;
3212
 
3213
 
3214
 
3215
  static bool classof(const Attr *A) { return A->getKind() == attr::Constructor; }
3216
};
3217
 
3218
class ConsumableAttr : public InheritableAttr {
3219
public:
3220
  enum ConsumedState {
3221
    Unknown,
3222
    Consumed,
3223
    Unconsumed
3224
  };
3225
private:
3226
  ConsumedState defaultState;
3227
 
3228
public:
3229
  enum Spelling {
3230
    GNU_consumable = 0,
3231
    CXX11_clang_consumable = 1,
3232
  SpellingNotCalculated = 15
3233
 
3234
  };
3235
 
3236
  // Factory methods
3237
  static ConsumableAttr *CreateImplicit(ASTContext &Ctx, ConsumedState DefaultState, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
3238
  static ConsumableAttr *Create(ASTContext &Ctx, ConsumedState DefaultState, const AttributeCommonInfo &CommonInfo);
3239
  static ConsumableAttr *CreateImplicit(ASTContext &Ctx, ConsumedState DefaultState, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3240
  static ConsumableAttr *Create(ASTContext &Ctx, ConsumedState DefaultState, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3241
 
3242
  // Constructors
3243
  ConsumableAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
3244
              , ConsumedState DefaultState
3245
             );
3246
 
3247
  ConsumableAttr *clone(ASTContext &C) const;
3248
  void printPretty(raw_ostream &OS,
3249
                   const PrintingPolicy &Policy) const;
3250
  const char *getSpelling() const;
3251
  ConsumedState getDefaultState() const {
3252
    return defaultState;
3253
  }
3254
 
3255
  static bool ConvertStrToConsumedState(StringRef Val, ConsumedState &Out);
3256
  static const char *ConvertConsumedStateToStr(ConsumedState Val);
3257
 
3258
 
3259
  static bool classof(const Attr *A) { return A->getKind() == attr::Consumable; }
3260
};
3261
 
3262
class ConsumableAutoCastAttr : public InheritableAttr {
3263
public:
3264
  enum Spelling {
3265
    GNU_consumable_auto_cast_state = 0,
3266
    CXX11_clang_consumable_auto_cast_state = 1,
3267
  SpellingNotCalculated = 15
3268
 
3269
  };
3270
 
3271
  // Factory methods
3272
  static ConsumableAutoCastAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
3273
  static ConsumableAutoCastAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
3274
  static ConsumableAutoCastAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3275
  static ConsumableAutoCastAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3276
 
3277
  // Constructors
3278
  ConsumableAutoCastAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
3279
             );
3280
 
3281
  ConsumableAutoCastAttr *clone(ASTContext &C) const;
3282
  void printPretty(raw_ostream &OS,
3283
                   const PrintingPolicy &Policy) const;
3284
  const char *getSpelling() const;
3285
 
3286
 
3287
  static bool classof(const Attr *A) { return A->getKind() == attr::ConsumableAutoCast; }
3288
};
3289
 
3290
class ConsumableSetOnReadAttr : public InheritableAttr {
3291
public:
3292
  enum Spelling {
3293
    GNU_consumable_set_state_on_read = 0,
3294
    CXX11_clang_consumable_set_state_on_read = 1,
3295
  SpellingNotCalculated = 15
3296
 
3297
  };
3298
 
3299
  // Factory methods
3300
  static ConsumableSetOnReadAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
3301
  static ConsumableSetOnReadAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
3302
  static ConsumableSetOnReadAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3303
  static ConsumableSetOnReadAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3304
 
3305
  // Constructors
3306
  ConsumableSetOnReadAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
3307
             );
3308
 
3309
  ConsumableSetOnReadAttr *clone(ASTContext &C) const;
3310
  void printPretty(raw_ostream &OS,
3311
                   const PrintingPolicy &Policy) const;
3312
  const char *getSpelling() const;
3313
 
3314
 
3315
  static bool classof(const Attr *A) { return A->getKind() == attr::ConsumableSetOnRead; }
3316
};
3317
 
3318
class ConvergentAttr : public InheritableAttr {
3319
public:
3320
  enum Spelling {
3321
    GNU_convergent = 0,
3322
    CXX11_clang_convergent = 1,
3323
    C2x_clang_convergent = 2,
3324
  SpellingNotCalculated = 15
3325
 
3326
  };
3327
 
3328
  // Factory methods
3329
  static ConvergentAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
3330
  static ConvergentAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
3331
  static ConvergentAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3332
  static ConvergentAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3333
 
3334
  // Constructors
3335
  ConvergentAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
3336
             );
3337
 
3338
  ConvergentAttr *clone(ASTContext &C) const;
3339
  void printPretty(raw_ostream &OS,
3340
                   const PrintingPolicy &Policy) const;
3341
  const char *getSpelling() const;
3342
 
3343
 
3344
  static bool classof(const Attr *A) { return A->getKind() == attr::Convergent; }
3345
};
3346
 
3347
class DLLExportAttr : public InheritableAttr {
3348
public:
3349
  enum Spelling {
3350
    Declspec_dllexport = 0,
3351
    GNU_dllexport = 1,
3352
    CXX11_gnu_dllexport = 2,
3353
    C2x_gnu_dllexport = 3,
3354
  SpellingNotCalculated = 15
3355
 
3356
  };
3357
 
3358
  // Factory methods
3359
  static DLLExportAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
3360
  static DLLExportAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
3361
  static DLLExportAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3362
  static DLLExportAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3363
 
3364
  // Constructors
3365
  DLLExportAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
3366
             );
3367
 
3368
  DLLExportAttr *clone(ASTContext &C) const;
3369
  void printPretty(raw_ostream &OS,
3370
                   const PrintingPolicy &Policy) const;
3371
  const char *getSpelling() const;
3372
 
3373
 
3374
  static bool classof(const Attr *A) { return A->getKind() == attr::DLLExport; }
3375
};
3376
 
3377
class DLLExportStaticLocalAttr : public InheritableAttr {
3378
public:
3379
  // Factory methods
3380
  static DLLExportStaticLocalAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
3381
  static DLLExportStaticLocalAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
3382
  static DLLExportStaticLocalAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3383
  static DLLExportStaticLocalAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3384
 
3385
  // Constructors
3386
  DLLExportStaticLocalAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
3387
             );
3388
 
3389
  DLLExportStaticLocalAttr *clone(ASTContext &C) const;
3390
  void printPretty(raw_ostream &OS,
3391
                   const PrintingPolicy &Policy) const;
3392
  const char *getSpelling() const;
3393
 
3394
 
3395
  static bool classof(const Attr *A) { return A->getKind() == attr::DLLExportStaticLocal; }
3396
};
3397
 
3398
class DLLImportAttr : public InheritableAttr {
3399
public:
3400
  enum Spelling {
3401
    Declspec_dllimport = 0,
3402
    GNU_dllimport = 1,
3403
    CXX11_gnu_dllimport = 2,
3404
    C2x_gnu_dllimport = 3,
3405
  SpellingNotCalculated = 15
3406
 
3407
  };
3408
 
3409
  // Factory methods
3410
  static DLLImportAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
3411
  static DLLImportAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
3412
  static DLLImportAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3413
  static DLLImportAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3414
 
3415
  // Constructors
3416
  DLLImportAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
3417
             );
3418
 
3419
  DLLImportAttr *clone(ASTContext &C) const;
3420
  void printPretty(raw_ostream &OS,
3421
                   const PrintingPolicy &Policy) const;
3422
  const char *getSpelling() const;
3423
 
3424
private:
3425
  bool PropagatedToBaseTemplate = false;
3426
 
3427
public:
3428
  void setPropagatedToBaseTemplate() { PropagatedToBaseTemplate = true; }
3429
  bool wasPropagatedToBaseTemplate() { return PropagatedToBaseTemplate; }
3430
 
3431
 
3432
  static bool classof(const Attr *A) { return A->getKind() == attr::DLLImport; }
3433
};
3434
 
3435
class DLLImportStaticLocalAttr : public InheritableAttr {
3436
public:
3437
  // Factory methods
3438
  static DLLImportStaticLocalAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
3439
  static DLLImportStaticLocalAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
3440
  static DLLImportStaticLocalAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3441
  static DLLImportStaticLocalAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3442
 
3443
  // Constructors
3444
  DLLImportStaticLocalAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
3445
             );
3446
 
3447
  DLLImportStaticLocalAttr *clone(ASTContext &C) const;
3448
  void printPretty(raw_ostream &OS,
3449
                   const PrintingPolicy &Policy) const;
3450
  const char *getSpelling() const;
3451
 
3452
 
3453
  static bool classof(const Attr *A) { return A->getKind() == attr::DLLImportStaticLocal; }
3454
};
3455
 
3456
class DeprecatedAttr : public InheritableAttr {
3457
unsigned messageLength;
3458
char *message;
3459
 
3460
unsigned replacementLength;
3461
char *replacement;
3462
 
3463
public:
3464
  enum Spelling {
3465
    GNU_deprecated = 0,
3466
    CXX11_gnu_deprecated = 1,
3467
    C2x_gnu_deprecated = 2,
3468
    Declspec_deprecated = 3,
3469
    CXX11_deprecated = 4,
3470
    C2x_deprecated = 5,
3471
  SpellingNotCalculated = 15
3472
 
3473
  };
3474
 
3475
  // Factory methods
3476
  static DeprecatedAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Message, llvm::StringRef Replacement, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
3477
  static DeprecatedAttr *Create(ASTContext &Ctx, llvm::StringRef Message, llvm::StringRef Replacement, const AttributeCommonInfo &CommonInfo);
3478
  static DeprecatedAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Message, llvm::StringRef Replacement, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3479
  static DeprecatedAttr *Create(ASTContext &Ctx, llvm::StringRef Message, llvm::StringRef Replacement, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3480
 
3481
  // Constructors
3482
  DeprecatedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
3483
              , llvm::StringRef Message
3484
              , llvm::StringRef Replacement
3485
             );
3486
  DeprecatedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
3487
             );
3488
 
3489
  DeprecatedAttr *clone(ASTContext &C) const;
3490
  void printPretty(raw_ostream &OS,
3491
                   const PrintingPolicy &Policy) const;
3492
  const char *getSpelling() const;
3493
  llvm::StringRef getMessage() const {
3494
    return llvm::StringRef(message, messageLength);
3495
  }
3496
  unsigned getMessageLength() const {
3497
    return messageLength;
3498
  }
3499
  void setMessage(ASTContext &C, llvm::StringRef S) {
3500
    messageLength = S.size();
3501
    this->message = new (C, 1) char [messageLength];
3502
    if (!S.empty())
3503
      std::memcpy(this->message, S.data(), messageLength);
3504
  }
3505
 
3506
  llvm::StringRef getReplacement() const {
3507
    return llvm::StringRef(replacement, replacementLength);
3508
  }
3509
  unsigned getReplacementLength() const {
3510
    return replacementLength;
3511
  }
3512
  void setReplacement(ASTContext &C, llvm::StringRef S) {
3513
    replacementLength = S.size();
3514
    this->replacement = new (C, 1) char [replacementLength];
3515
    if (!S.empty())
3516
      std::memcpy(this->replacement, S.data(), replacementLength);
3517
  }
3518
 
3519
 
3520
 
3521
  static bool classof(const Attr *A) { return A->getKind() == attr::Deprecated; }
3522
};
3523
 
3524
class DestructorAttr : public InheritableAttr {
3525
int priority;
3526
 
3527
public:
3528
  enum Spelling {
3529
    GNU_destructor = 0,
3530
    CXX11_gnu_destructor = 1,
3531
    C2x_gnu_destructor = 2,
3532
  SpellingNotCalculated = 15
3533
 
3534
  };
3535
 
3536
  // Factory methods
3537
  static DestructorAttr *CreateImplicit(ASTContext &Ctx, int Priority, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
3538
  static DestructorAttr *Create(ASTContext &Ctx, int Priority, const AttributeCommonInfo &CommonInfo);
3539
  static DestructorAttr *CreateImplicit(ASTContext &Ctx, int Priority, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3540
  static DestructorAttr *Create(ASTContext &Ctx, int Priority, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3541
 
3542
  // Constructors
3543
  DestructorAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
3544
              , int Priority
3545
             );
3546
  DestructorAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
3547
             );
3548
 
3549
  DestructorAttr *clone(ASTContext &C) const;
3550
  void printPretty(raw_ostream &OS,
3551
                   const PrintingPolicy &Policy) const;
3552
  const char *getSpelling() const;
3553
  int getPriority() const {
3554
    return priority;
3555
  }
3556
 
3557
  static const int DefaultPriority = 65535;
3558
 
3559
 
3560
 
3561
  static bool classof(const Attr *A) { return A->getKind() == attr::Destructor; }
3562
};
3563
 
3564
class DiagnoseAsBuiltinAttr : public InheritableAttr {
3565
FunctionDecl * function;
3566
 
3567
  unsigned argIndices_Size;
3568
  unsigned *argIndices_;
3569
 
3570
public:
3571
  enum Spelling {
3572
    GNU_diagnose_as_builtin = 0,
3573
    CXX11_clang_diagnose_as_builtin = 1,
3574
    C2x_clang_diagnose_as_builtin = 2,
3575
  SpellingNotCalculated = 15
3576
 
3577
  };
3578
 
3579
  // Factory methods
3580
  static DiagnoseAsBuiltinAttr *CreateImplicit(ASTContext &Ctx, FunctionDecl * Function, unsigned *ArgIndices, unsigned ArgIndicesSize, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
3581
  static DiagnoseAsBuiltinAttr *Create(ASTContext &Ctx, FunctionDecl * Function, unsigned *ArgIndices, unsigned ArgIndicesSize, const AttributeCommonInfo &CommonInfo);
3582
  static DiagnoseAsBuiltinAttr *CreateImplicit(ASTContext &Ctx, FunctionDecl * Function, unsigned *ArgIndices, unsigned ArgIndicesSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3583
  static DiagnoseAsBuiltinAttr *Create(ASTContext &Ctx, FunctionDecl * Function, unsigned *ArgIndices, unsigned ArgIndicesSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3584
 
3585
  // Constructors
3586
  DiagnoseAsBuiltinAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
3587
              , FunctionDecl * Function
3588
              , unsigned *ArgIndices, unsigned ArgIndicesSize
3589
             );
3590
  DiagnoseAsBuiltinAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
3591
              , FunctionDecl * Function
3592
             );
3593
 
3594
  DiagnoseAsBuiltinAttr *clone(ASTContext &C) const;
3595
  void printPretty(raw_ostream &OS,
3596
                   const PrintingPolicy &Policy) const;
3597
  const char *getSpelling() const;
3598
  FunctionDecl * getFunction() const {
3599
    return function;
3600
  }
3601
 
3602
  typedef unsigned* argIndices_iterator;
3603
  argIndices_iterator argIndices_begin() const { return argIndices_; }
3604
  argIndices_iterator argIndices_end() const { return argIndices_ + argIndices_Size; }
3605
  unsigned argIndices_size() const { return argIndices_Size; }
3606
  llvm::iterator_range<argIndices_iterator> argIndices() const { return llvm::make_range(argIndices_begin(), argIndices_end()); }
3607
 
3608
 
3609
 
3610
 
3611
  static bool classof(const Attr *A) { return A->getKind() == attr::DiagnoseAsBuiltin; }
3612
};
3613
 
3614
class DiagnoseIfAttr : public InheritableAttr {
3615
Expr * cond;
3616
 
3617
unsigned messageLength;
3618
char *message;
3619
 
3620
public:
3621
  enum DiagnosticType {
3622
    DT_Error,
3623
    DT_Warning
3624
  };
3625
private:
3626
  DiagnosticType diagnosticType;
3627
 
3628
bool argDependent;
3629
 
3630
NamedDecl * parent;
3631
 
3632
public:
3633
  // Factory methods
3634
  static DiagnoseIfAttr *CreateImplicit(ASTContext &Ctx, Expr * Cond, llvm::StringRef Message, DiagnosticType DiagnosticType, bool ArgDependent, NamedDecl * Parent, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
3635
  static DiagnoseIfAttr *Create(ASTContext &Ctx, Expr * Cond, llvm::StringRef Message, DiagnosticType DiagnosticType, bool ArgDependent, NamedDecl * Parent, const AttributeCommonInfo &CommonInfo);
3636
  static DiagnoseIfAttr *CreateImplicit(ASTContext &Ctx, Expr * Cond, llvm::StringRef Message, DiagnosticType DiagnosticType, bool ArgDependent, NamedDecl * Parent, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3637
  static DiagnoseIfAttr *Create(ASTContext &Ctx, Expr * Cond, llvm::StringRef Message, DiagnosticType DiagnosticType, bool ArgDependent, NamedDecl * Parent, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3638
  static DiagnoseIfAttr *CreateImplicit(ASTContext &Ctx, Expr * Cond, llvm::StringRef Message, DiagnosticType DiagnosticType, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
3639
  static DiagnoseIfAttr *Create(ASTContext &Ctx, Expr * Cond, llvm::StringRef Message, DiagnosticType DiagnosticType, const AttributeCommonInfo &CommonInfo);
3640
  static DiagnoseIfAttr *CreateImplicit(ASTContext &Ctx, Expr * Cond, llvm::StringRef Message, DiagnosticType DiagnosticType, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3641
  static DiagnoseIfAttr *Create(ASTContext &Ctx, Expr * Cond, llvm::StringRef Message, DiagnosticType DiagnosticType, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3642
 
3643
  // Constructors
3644
  DiagnoseIfAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
3645
              , Expr * Cond
3646
              , llvm::StringRef Message
3647
              , DiagnosticType DiagnosticType
3648
              , bool ArgDependent
3649
              , NamedDecl * Parent
3650
             );
3651
  DiagnoseIfAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
3652
              , Expr * Cond
3653
              , llvm::StringRef Message
3654
              , DiagnosticType DiagnosticType
3655
             );
3656
 
3657
  DiagnoseIfAttr *clone(ASTContext &C) const;
3658
  void printPretty(raw_ostream &OS,
3659
                   const PrintingPolicy &Policy) const;
3660
  const char *getSpelling() const;
3661
  Expr * getCond() const {
3662
    return cond;
3663
  }
3664
 
3665
  llvm::StringRef getMessage() const {
3666
    return llvm::StringRef(message, messageLength);
3667
  }
3668
  unsigned getMessageLength() const {
3669
    return messageLength;
3670
  }
3671
  void setMessage(ASTContext &C, llvm::StringRef S) {
3672
    messageLength = S.size();
3673
    this->message = new (C, 1) char [messageLength];
3674
    if (!S.empty())
3675
      std::memcpy(this->message, S.data(), messageLength);
3676
  }
3677
 
3678
  DiagnosticType getDiagnosticType() const {
3679
    return diagnosticType;
3680
  }
3681
 
3682
  static bool ConvertStrToDiagnosticType(StringRef Val, DiagnosticType &Out);
3683
  static const char *ConvertDiagnosticTypeToStr(DiagnosticType Val);
3684
  bool getArgDependent() const {
3685
    return argDependent;
3686
  }
3687
 
3688
  NamedDecl * getParent() const {
3689
    return parent;
3690
  }
3691
 
3692
 
3693
    bool isError() const { return diagnosticType == DT_Error; }
3694
    bool isWarning() const { return diagnosticType == DT_Warning; }
3695
 
3696
 
3697
  static bool classof(const Attr *A) { return A->getKind() == attr::DiagnoseIf; }
3698
};
3699
 
3700
class DisableSanitizerInstrumentationAttr : public InheritableAttr {
3701
public:
3702
  enum Spelling {
3703
    GNU_disable_sanitizer_instrumentation = 0,
3704
    CXX11_clang_disable_sanitizer_instrumentation = 1,
3705
    C2x_clang_disable_sanitizer_instrumentation = 2,
3706
  SpellingNotCalculated = 15
3707
 
3708
  };
3709
 
3710
  // Factory methods
3711
  static DisableSanitizerInstrumentationAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
3712
  static DisableSanitizerInstrumentationAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
3713
  static DisableSanitizerInstrumentationAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3714
  static DisableSanitizerInstrumentationAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3715
 
3716
  // Constructors
3717
  DisableSanitizerInstrumentationAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
3718
             );
3719
 
3720
  DisableSanitizerInstrumentationAttr *clone(ASTContext &C) const;
3721
  void printPretty(raw_ostream &OS,
3722
                   const PrintingPolicy &Policy) const;
3723
  const char *getSpelling() const;
3724
 
3725
 
3726
  static bool classof(const Attr *A) { return A->getKind() == attr::DisableSanitizerInstrumentation; }
3727
};
3728
 
3729
class DisableTailCallsAttr : public InheritableAttr {
3730
public:
3731
  enum Spelling {
3732
    GNU_disable_tail_calls = 0,
3733
    CXX11_clang_disable_tail_calls = 1,
3734
    C2x_clang_disable_tail_calls = 2,
3735
  SpellingNotCalculated = 15
3736
 
3737
  };
3738
 
3739
  // Factory methods
3740
  static DisableTailCallsAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
3741
  static DisableTailCallsAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
3742
  static DisableTailCallsAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3743
  static DisableTailCallsAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3744
 
3745
  // Constructors
3746
  DisableTailCallsAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
3747
             );
3748
 
3749
  DisableTailCallsAttr *clone(ASTContext &C) const;
3750
  void printPretty(raw_ostream &OS,
3751
                   const PrintingPolicy &Policy) const;
3752
  const char *getSpelling() const;
3753
 
3754
 
3755
  static bool classof(const Attr *A) { return A->getKind() == attr::DisableTailCalls; }
3756
};
3757
 
3758
class EmptyBasesAttr : public InheritableAttr {
3759
public:
3760
  // Factory methods
3761
  static EmptyBasesAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
3762
  static EmptyBasesAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
3763
  static EmptyBasesAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3764
  static EmptyBasesAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3765
 
3766
  // Constructors
3767
  EmptyBasesAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
3768
             );
3769
 
3770
  EmptyBasesAttr *clone(ASTContext &C) const;
3771
  void printPretty(raw_ostream &OS,
3772
                   const PrintingPolicy &Policy) const;
3773
  const char *getSpelling() const;
3774
 
3775
 
3776
  static bool classof(const Attr *A) { return A->getKind() == attr::EmptyBases; }
3777
};
3778
 
3779
class EnableIfAttr : public InheritableAttr {
3780
Expr * cond;
3781
 
3782
unsigned messageLength;
3783
char *message;
3784
 
3785
public:
3786
  // Factory methods
3787
  static EnableIfAttr *CreateImplicit(ASTContext &Ctx, Expr * Cond, llvm::StringRef Message, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
3788
  static EnableIfAttr *Create(ASTContext &Ctx, Expr * Cond, llvm::StringRef Message, const AttributeCommonInfo &CommonInfo);
3789
  static EnableIfAttr *CreateImplicit(ASTContext &Ctx, Expr * Cond, llvm::StringRef Message, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3790
  static EnableIfAttr *Create(ASTContext &Ctx, Expr * Cond, llvm::StringRef Message, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3791
 
3792
  // Constructors
3793
  EnableIfAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
3794
              , Expr * Cond
3795
              , llvm::StringRef Message
3796
             );
3797
 
3798
  EnableIfAttr *clone(ASTContext &C) const;
3799
  void printPretty(raw_ostream &OS,
3800
                   const PrintingPolicy &Policy) const;
3801
  const char *getSpelling() const;
3802
  Expr * getCond() const {
3803
    return cond;
3804
  }
3805
 
3806
  llvm::StringRef getMessage() const {
3807
    return llvm::StringRef(message, messageLength);
3808
  }
3809
  unsigned getMessageLength() const {
3810
    return messageLength;
3811
  }
3812
  void setMessage(ASTContext &C, llvm::StringRef S) {
3813
    messageLength = S.size();
3814
    this->message = new (C, 1) char [messageLength];
3815
    if (!S.empty())
3816
      std::memcpy(this->message, S.data(), messageLength);
3817
  }
3818
 
3819
 
3820
 
3821
  static bool classof(const Attr *A) { return A->getKind() == attr::EnableIf; }
3822
};
3823
 
3824
class EnforceTCBAttr : public InheritableAttr {
3825
unsigned tCBNameLength;
3826
char *tCBName;
3827
 
3828
public:
3829
  enum Spelling {
3830
    GNU_enforce_tcb = 0,
3831
    CXX11_clang_enforce_tcb = 1,
3832
    C2x_clang_enforce_tcb = 2,
3833
  SpellingNotCalculated = 15
3834
 
3835
  };
3836
 
3837
  // Factory methods
3838
  static EnforceTCBAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef TCBName, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
3839
  static EnforceTCBAttr *Create(ASTContext &Ctx, llvm::StringRef TCBName, const AttributeCommonInfo &CommonInfo);
3840
  static EnforceTCBAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef TCBName, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3841
  static EnforceTCBAttr *Create(ASTContext &Ctx, llvm::StringRef TCBName, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3842
 
3843
  // Constructors
3844
  EnforceTCBAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
3845
              , llvm::StringRef TCBName
3846
             );
3847
 
3848
  EnforceTCBAttr *clone(ASTContext &C) const;
3849
  void printPretty(raw_ostream &OS,
3850
                   const PrintingPolicy &Policy) const;
3851
  const char *getSpelling() const;
3852
  llvm::StringRef getTCBName() const {
3853
    return llvm::StringRef(tCBName, tCBNameLength);
3854
  }
3855
  unsigned getTCBNameLength() const {
3856
    return tCBNameLength;
3857
  }
3858
  void setTCBName(ASTContext &C, llvm::StringRef S) {
3859
    tCBNameLength = S.size();
3860
    this->tCBName = new (C, 1) char [tCBNameLength];
3861
    if (!S.empty())
3862
      std::memcpy(this->tCBName, S.data(), tCBNameLength);
3863
  }
3864
 
3865
 
3866
 
3867
  static bool classof(const Attr *A) { return A->getKind() == attr::EnforceTCB; }
3868
};
3869
 
3870
class EnforceTCBLeafAttr : public InheritableAttr {
3871
unsigned tCBNameLength;
3872
char *tCBName;
3873
 
3874
public:
3875
  enum Spelling {
3876
    GNU_enforce_tcb_leaf = 0,
3877
    CXX11_clang_enforce_tcb_leaf = 1,
3878
    C2x_clang_enforce_tcb_leaf = 2,
3879
  SpellingNotCalculated = 15
3880
 
3881
  };
3882
 
3883
  // Factory methods
3884
  static EnforceTCBLeafAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef TCBName, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
3885
  static EnforceTCBLeafAttr *Create(ASTContext &Ctx, llvm::StringRef TCBName, const AttributeCommonInfo &CommonInfo);
3886
  static EnforceTCBLeafAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef TCBName, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3887
  static EnforceTCBLeafAttr *Create(ASTContext &Ctx, llvm::StringRef TCBName, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3888
 
3889
  // Constructors
3890
  EnforceTCBLeafAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
3891
              , llvm::StringRef TCBName
3892
             );
3893
 
3894
  EnforceTCBLeafAttr *clone(ASTContext &C) const;
3895
  void printPretty(raw_ostream &OS,
3896
                   const PrintingPolicy &Policy) const;
3897
  const char *getSpelling() const;
3898
  llvm::StringRef getTCBName() const {
3899
    return llvm::StringRef(tCBName, tCBNameLength);
3900
  }
3901
  unsigned getTCBNameLength() const {
3902
    return tCBNameLength;
3903
  }
3904
  void setTCBName(ASTContext &C, llvm::StringRef S) {
3905
    tCBNameLength = S.size();
3906
    this->tCBName = new (C, 1) char [tCBNameLength];
3907
    if (!S.empty())
3908
      std::memcpy(this->tCBName, S.data(), tCBNameLength);
3909
  }
3910
 
3911
 
3912
 
3913
  static bool classof(const Attr *A) { return A->getKind() == attr::EnforceTCBLeaf; }
3914
};
3915
 
3916
class EnumExtensibilityAttr : public InheritableAttr {
3917
public:
3918
  enum Kind {
3919
    Closed,
3920
    Open
3921
  };
3922
private:
3923
  Kind extensibility;
3924
 
3925
public:
3926
  enum Spelling {
3927
    GNU_enum_extensibility = 0,
3928
    CXX11_clang_enum_extensibility = 1,
3929
    C2x_clang_enum_extensibility = 2,
3930
  SpellingNotCalculated = 15
3931
 
3932
  };
3933
 
3934
  // Factory methods
3935
  static EnumExtensibilityAttr *CreateImplicit(ASTContext &Ctx, Kind Extensibility, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
3936
  static EnumExtensibilityAttr *Create(ASTContext &Ctx, Kind Extensibility, const AttributeCommonInfo &CommonInfo);
3937
  static EnumExtensibilityAttr *CreateImplicit(ASTContext &Ctx, Kind Extensibility, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3938
  static EnumExtensibilityAttr *Create(ASTContext &Ctx, Kind Extensibility, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
3939
 
3940
  // Constructors
3941
  EnumExtensibilityAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
3942
              , Kind Extensibility
3943
             );
3944
 
3945
  EnumExtensibilityAttr *clone(ASTContext &C) const;
3946
  void printPretty(raw_ostream &OS,
3947
                   const PrintingPolicy &Policy) const;
3948
  const char *getSpelling() const;
3949
  Kind getExtensibility() const {
3950
    return extensibility;
3951
  }
3952
 
3953
  static bool ConvertStrToKind(StringRef Val, Kind &Out);
3954
  static const char *ConvertKindToStr(Kind Val);
3955
 
3956
 
3957
  static bool classof(const Attr *A) { return A->getKind() == attr::EnumExtensibility; }
3958
};
3959
 
3960
class ErrorAttr : public InheritableAttr {
3961
unsigned userDiagnosticLength;
3962
char *userDiagnostic;
3963
 
3964
public:
3965
  enum Spelling {
3966
    GNU_error = 0,
3967
    CXX11_gnu_error = 1,
3968
    C2x_gnu_error = 2,
3969
    GNU_warning = 3,
3970
    CXX11_gnu_warning = 4,
3971
    C2x_gnu_warning = 5,
3972
  SpellingNotCalculated = 15
3973
 
3974
  };
3975
 
3976
  // Factory methods
3977
  static ErrorAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef UserDiagnostic, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
3978
  static ErrorAttr *Create(ASTContext &Ctx, llvm::StringRef UserDiagnostic, const AttributeCommonInfo &CommonInfo);
3979
  static ErrorAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef UserDiagnostic, SourceRange Range, AttributeCommonInfo::Syntax Syntax, ErrorAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
3980
  static ErrorAttr *Create(ASTContext &Ctx, llvm::StringRef UserDiagnostic, SourceRange Range, AttributeCommonInfo::Syntax Syntax, ErrorAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
3981
 
3982
  // Constructors
3983
  ErrorAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
3984
              , llvm::StringRef UserDiagnostic
3985
             );
3986
 
3987
  ErrorAttr *clone(ASTContext &C) const;
3988
  void printPretty(raw_ostream &OS,
3989
                   const PrintingPolicy &Policy) const;
3990
  const char *getSpelling() const;
3991
  Spelling getSemanticSpelling() const;
3992
  bool isError() const { return getAttributeSpellingListIndex() == 0 ||
3993
    getAttributeSpellingListIndex() == 1 ||
3994
    getAttributeSpellingListIndex() == 2; }
3995
  bool isWarning() const { return getAttributeSpellingListIndex() == 3 ||
3996
    getAttributeSpellingListIndex() == 4 ||
3997
    getAttributeSpellingListIndex() == 5; }
3998
  llvm::StringRef getUserDiagnostic() const {
3999
    return llvm::StringRef(userDiagnostic, userDiagnosticLength);
4000
  }
4001
  unsigned getUserDiagnosticLength() const {
4002
    return userDiagnosticLength;
4003
  }
4004
  void setUserDiagnostic(ASTContext &C, llvm::StringRef S) {
4005
    userDiagnosticLength = S.size();
4006
    this->userDiagnostic = new (C, 1) char [userDiagnosticLength];
4007
    if (!S.empty())
4008
      std::memcpy(this->userDiagnostic, S.data(), userDiagnosticLength);
4009
  }
4010
 
4011
 
4012
 
4013
  static bool classof(const Attr *A) { return A->getKind() == attr::Error; }
4014
};
4015
 
4016
class ExcludeFromExplicitInstantiationAttr : public InheritableAttr {
4017
public:
4018
  enum Spelling {
4019
    GNU_exclude_from_explicit_instantiation = 0,
4020
    CXX11_clang_exclude_from_explicit_instantiation = 1,
4021
    C2x_clang_exclude_from_explicit_instantiation = 2,
4022
  SpellingNotCalculated = 15
4023
 
4024
  };
4025
 
4026
  // Factory methods
4027
  static ExcludeFromExplicitInstantiationAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
4028
  static ExcludeFromExplicitInstantiationAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
4029
  static ExcludeFromExplicitInstantiationAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4030
  static ExcludeFromExplicitInstantiationAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4031
 
4032
  // Constructors
4033
  ExcludeFromExplicitInstantiationAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
4034
             );
4035
 
4036
  ExcludeFromExplicitInstantiationAttr *clone(ASTContext &C) const;
4037
  void printPretty(raw_ostream &OS,
4038
                   const PrintingPolicy &Policy) const;
4039
  const char *getSpelling() const;
4040
 
4041
 
4042
  static bool classof(const Attr *A) { return A->getKind() == attr::ExcludeFromExplicitInstantiation; }
4043
};
4044
 
4045
class ExclusiveTrylockFunctionAttr : public InheritableAttr {
4046
Expr * successValue;
4047
 
4048
  unsigned args_Size;
4049
  Expr * *args_;
4050
 
4051
public:
4052
  // Factory methods
4053
  static ExclusiveTrylockFunctionAttr *CreateImplicit(ASTContext &Ctx, Expr * SuccessValue, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
4054
  static ExclusiveTrylockFunctionAttr *Create(ASTContext &Ctx, Expr * SuccessValue, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo);
4055
  static ExclusiveTrylockFunctionAttr *CreateImplicit(ASTContext &Ctx, Expr * SuccessValue, Expr * *Args, unsigned ArgsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4056
  static ExclusiveTrylockFunctionAttr *Create(ASTContext &Ctx, Expr * SuccessValue, Expr * *Args, unsigned ArgsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4057
 
4058
  // Constructors
4059
  ExclusiveTrylockFunctionAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
4060
              , Expr * SuccessValue
4061
              , Expr * *Args, unsigned ArgsSize
4062
             );
4063
  ExclusiveTrylockFunctionAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
4064
              , Expr * SuccessValue
4065
             );
4066
 
4067
  ExclusiveTrylockFunctionAttr *clone(ASTContext &C) const;
4068
  void printPretty(raw_ostream &OS,
4069
                   const PrintingPolicy &Policy) const;
4070
  const char *getSpelling() const;
4071
  Expr * getSuccessValue() const {
4072
    return successValue;
4073
  }
4074
 
4075
  typedef Expr ** args_iterator;
4076
  args_iterator args_begin() const { return args_; }
4077
  args_iterator args_end() const { return args_ + args_Size; }
4078
  unsigned args_size() const { return args_Size; }
4079
  llvm::iterator_range<args_iterator> args() const { return llvm::make_range(args_begin(), args_end()); }
4080
 
4081
 
4082
 
4083
 
4084
  static bool classof(const Attr *A) { return A->getKind() == attr::ExclusiveTrylockFunction; }
4085
};
4086
 
4087
class ExternalSourceSymbolAttr : public InheritableAttr {
4088
unsigned languageLength;
4089
char *language;
4090
 
4091
unsigned definedInLength;
4092
char *definedIn;
4093
 
4094
bool generatedDeclaration;
4095
 
4096
public:
4097
  enum Spelling {
4098
    GNU_external_source_symbol = 0,
4099
    CXX11_clang_external_source_symbol = 1,
4100
    C2x_clang_external_source_symbol = 2,
4101
  SpellingNotCalculated = 15
4102
 
4103
  };
4104
 
4105
  // Factory methods
4106
  static ExternalSourceSymbolAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Language, llvm::StringRef DefinedIn, bool GeneratedDeclaration, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
4107
  static ExternalSourceSymbolAttr *Create(ASTContext &Ctx, llvm::StringRef Language, llvm::StringRef DefinedIn, bool GeneratedDeclaration, const AttributeCommonInfo &CommonInfo);
4108
  static ExternalSourceSymbolAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Language, llvm::StringRef DefinedIn, bool GeneratedDeclaration, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4109
  static ExternalSourceSymbolAttr *Create(ASTContext &Ctx, llvm::StringRef Language, llvm::StringRef DefinedIn, bool GeneratedDeclaration, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4110
 
4111
  // Constructors
4112
  ExternalSourceSymbolAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
4113
              , llvm::StringRef Language
4114
              , llvm::StringRef DefinedIn
4115
              , bool GeneratedDeclaration
4116
             );
4117
  ExternalSourceSymbolAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
4118
             );
4119
 
4120
  ExternalSourceSymbolAttr *clone(ASTContext &C) const;
4121
  void printPretty(raw_ostream &OS,
4122
                   const PrintingPolicy &Policy) const;
4123
  const char *getSpelling() const;
4124
  llvm::StringRef getLanguage() const {
4125
    return llvm::StringRef(language, languageLength);
4126
  }
4127
  unsigned getLanguageLength() const {
4128
    return languageLength;
4129
  }
4130
  void setLanguage(ASTContext &C, llvm::StringRef S) {
4131
    languageLength = S.size();
4132
    this->language = new (C, 1) char [languageLength];
4133
    if (!S.empty())
4134
      std::memcpy(this->language, S.data(), languageLength);
4135
  }
4136
 
4137
  llvm::StringRef getDefinedIn() const {
4138
    return llvm::StringRef(definedIn, definedInLength);
4139
  }
4140
  unsigned getDefinedInLength() const {
4141
    return definedInLength;
4142
  }
4143
  void setDefinedIn(ASTContext &C, llvm::StringRef S) {
4144
    definedInLength = S.size();
4145
    this->definedIn = new (C, 1) char [definedInLength];
4146
    if (!S.empty())
4147
      std::memcpy(this->definedIn, S.data(), definedInLength);
4148
  }
4149
 
4150
  bool getGeneratedDeclaration() const {
4151
    return generatedDeclaration;
4152
  }
4153
 
4154
 
4155
 
4156
  static bool classof(const Attr *A) { return A->getKind() == attr::ExternalSourceSymbol; }
4157
};
4158
 
4159
class FallThroughAttr : public StmtAttr {
4160
public:
4161
  enum Spelling {
4162
    CXX11_fallthrough = 0,
4163
    C2x_fallthrough = 1,
4164
    CXX11_clang_fallthrough = 2,
4165
    GNU_fallthrough = 3,
4166
    CXX11_gnu_fallthrough = 4,
4167
    C2x_gnu_fallthrough = 5,
4168
  SpellingNotCalculated = 15
4169
 
4170
  };
4171
 
4172
  // Factory methods
4173
  static FallThroughAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
4174
  static FallThroughAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
4175
  static FallThroughAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4176
  static FallThroughAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4177
 
4178
  // Constructors
4179
  FallThroughAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
4180
             );
4181
 
4182
  FallThroughAttr *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::FallThrough; }
4189
};
4190
 
4191
class FastCallAttr : public InheritableAttr {
4192
public:
4193
  enum Spelling {
4194
    GNU_fastcall = 0,
4195
    CXX11_gnu_fastcall = 1,
4196
    C2x_gnu_fastcall = 2,
4197
    Keyword_fastcall = 3,
4198
  SpellingNotCalculated = 15
4199
 
4200
  };
4201
 
4202
  // Factory methods
4203
  static FastCallAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
4204
  static FastCallAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
4205
  static FastCallAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4206
  static FastCallAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4207
 
4208
  // Constructors
4209
  FastCallAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
4210
             );
4211
 
4212
  FastCallAttr *clone(ASTContext &C) const;
4213
  void printPretty(raw_ostream &OS,
4214
                   const PrintingPolicy &Policy) const;
4215
  const char *getSpelling() const;
4216
 
4217
 
4218
  static bool classof(const Attr *A) { return A->getKind() == attr::FastCall; }
4219
};
4220
 
4221
class FinalAttr : public InheritableAttr {
4222
public:
4223
  enum Spelling {
4224
    Keyword_final = 0,
4225
    Keyword_sealed = 1,
4226
  SpellingNotCalculated = 15
4227
 
4228
  };
4229
 
4230
  // Factory methods
4231
  static FinalAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
4232
  static FinalAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
4233
  static FinalAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax, FinalAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
4234
  static FinalAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax, FinalAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
4235
 
4236
  // Constructors
4237
  FinalAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
4238
             );
4239
 
4240
  FinalAttr *clone(ASTContext &C) const;
4241
  void printPretty(raw_ostream &OS,
4242
                   const PrintingPolicy &Policy) const;
4243
  const char *getSpelling() const;
4244
  Spelling getSemanticSpelling() const;
4245
  bool isSpelledAsSealed() const { return getAttributeSpellingListIndex() == 1; }
4246
 
4247
 
4248
  static bool classof(const Attr *A) { return A->getKind() == attr::Final; }
4249
};
4250
 
4251
class FlagEnumAttr : public InheritableAttr {
4252
public:
4253
  enum Spelling {
4254
    GNU_flag_enum = 0,
4255
    CXX11_clang_flag_enum = 1,
4256
    C2x_clang_flag_enum = 2,
4257
  SpellingNotCalculated = 15
4258
 
4259
  };
4260
 
4261
  // Factory methods
4262
  static FlagEnumAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
4263
  static FlagEnumAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
4264
  static FlagEnumAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4265
  static FlagEnumAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4266
 
4267
  // Constructors
4268
  FlagEnumAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
4269
             );
4270
 
4271
  FlagEnumAttr *clone(ASTContext &C) const;
4272
  void printPretty(raw_ostream &OS,
4273
                   const PrintingPolicy &Policy) const;
4274
  const char *getSpelling() const;
4275
 
4276
 
4277
  static bool classof(const Attr *A) { return A->getKind() == attr::FlagEnum; }
4278
};
4279
 
4280
class FlattenAttr : public InheritableAttr {
4281
public:
4282
  enum Spelling {
4283
    GNU_flatten = 0,
4284
    CXX11_gnu_flatten = 1,
4285
    C2x_gnu_flatten = 2,
4286
  SpellingNotCalculated = 15
4287
 
4288
  };
4289
 
4290
  // Factory methods
4291
  static FlattenAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
4292
  static FlattenAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
4293
  static FlattenAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4294
  static FlattenAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4295
 
4296
  // Constructors
4297
  FlattenAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
4298
             );
4299
 
4300
  FlattenAttr *clone(ASTContext &C) const;
4301
  void printPretty(raw_ostream &OS,
4302
                   const PrintingPolicy &Policy) const;
4303
  const char *getSpelling() const;
4304
 
4305
 
4306
  static bool classof(const Attr *A) { return A->getKind() == attr::Flatten; }
4307
};
4308
 
4309
class FormatAttr : public InheritableAttr {
4310
IdentifierInfo * type;
4311
 
4312
int formatIdx;
4313
 
4314
int firstArg;
4315
 
4316
public:
4317
  enum Spelling {
4318
    GNU_format = 0,
4319
    CXX11_gnu_format = 1,
4320
    C2x_gnu_format = 2,
4321
  SpellingNotCalculated = 15
4322
 
4323
  };
4324
 
4325
  // Factory methods
4326
  static FormatAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * Type, int FormatIdx, int FirstArg, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
4327
  static FormatAttr *Create(ASTContext &Ctx, IdentifierInfo * Type, int FormatIdx, int FirstArg, const AttributeCommonInfo &CommonInfo);
4328
  static FormatAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * Type, int FormatIdx, int FirstArg, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4329
  static FormatAttr *Create(ASTContext &Ctx, IdentifierInfo * Type, int FormatIdx, int FirstArg, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4330
 
4331
  // Constructors
4332
  FormatAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
4333
              , IdentifierInfo * Type
4334
              , int FormatIdx
4335
              , int FirstArg
4336
             );
4337
 
4338
  FormatAttr *clone(ASTContext &C) const;
4339
  void printPretty(raw_ostream &OS,
4340
                   const PrintingPolicy &Policy) const;
4341
  const char *getSpelling() const;
4342
  IdentifierInfo * getType() const {
4343
    return type;
4344
  }
4345
 
4346
  int getFormatIdx() const {
4347
    return formatIdx;
4348
  }
4349
 
4350
  int getFirstArg() const {
4351
    return firstArg;
4352
  }
4353
 
4354
 
4355
 
4356
  static bool classof(const Attr *A) { return A->getKind() == attr::Format; }
4357
};
4358
 
4359
class FormatArgAttr : public InheritableAttr {
4360
ParamIdx formatIdx;
4361
 
4362
public:
4363
  enum Spelling {
4364
    GNU_format_arg = 0,
4365
    CXX11_gnu_format_arg = 1,
4366
    C2x_gnu_format_arg = 2,
4367
  SpellingNotCalculated = 15
4368
 
4369
  };
4370
 
4371
  // Factory methods
4372
  static FormatArgAttr *CreateImplicit(ASTContext &Ctx, ParamIdx FormatIdx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
4373
  static FormatArgAttr *Create(ASTContext &Ctx, ParamIdx FormatIdx, const AttributeCommonInfo &CommonInfo);
4374
  static FormatArgAttr *CreateImplicit(ASTContext &Ctx, ParamIdx FormatIdx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4375
  static FormatArgAttr *Create(ASTContext &Ctx, ParamIdx FormatIdx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4376
 
4377
  // Constructors
4378
  FormatArgAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
4379
              , ParamIdx FormatIdx
4380
             );
4381
 
4382
  FormatArgAttr *clone(ASTContext &C) const;
4383
  void printPretty(raw_ostream &OS,
4384
                   const PrintingPolicy &Policy) const;
4385
  const char *getSpelling() const;
4386
  ParamIdx getFormatIdx() const {
4387
    return formatIdx;
4388
  }
4389
 
4390
 
4391
 
4392
  static bool classof(const Attr *A) { return A->getKind() == attr::FormatArg; }
4393
};
4394
 
4395
class FunctionReturnThunksAttr : public InheritableAttr {
4396
public:
4397
  enum Kind {
4398
    Keep,
4399
    Extern
4400
  };
4401
private:
4402
  Kind thunkType;
4403
 
4404
public:
4405
  enum Spelling {
4406
    GNU_function_return = 0,
4407
    CXX11_gnu_function_return = 1,
4408
    C2x_gnu_function_return = 2,
4409
  SpellingNotCalculated = 15
4410
 
4411
  };
4412
 
4413
  // Factory methods
4414
  static FunctionReturnThunksAttr *CreateImplicit(ASTContext &Ctx, Kind ThunkType, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
4415
  static FunctionReturnThunksAttr *Create(ASTContext &Ctx, Kind ThunkType, const AttributeCommonInfo &CommonInfo);
4416
  static FunctionReturnThunksAttr *CreateImplicit(ASTContext &Ctx, Kind ThunkType, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4417
  static FunctionReturnThunksAttr *Create(ASTContext &Ctx, Kind ThunkType, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4418
 
4419
  // Constructors
4420
  FunctionReturnThunksAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
4421
              , Kind ThunkType
4422
             );
4423
 
4424
  FunctionReturnThunksAttr *clone(ASTContext &C) const;
4425
  void printPretty(raw_ostream &OS,
4426
                   const PrintingPolicy &Policy) const;
4427
  const char *getSpelling() const;
4428
  Kind getThunkType() const {
4429
    return thunkType;
4430
  }
4431
 
4432
  static bool ConvertStrToKind(StringRef Val, Kind &Out);
4433
  static const char *ConvertKindToStr(Kind Val);
4434
 
4435
 
4436
  static bool classof(const Attr *A) { return A->getKind() == attr::FunctionReturnThunks; }
4437
};
4438
 
4439
class GNUInlineAttr : public InheritableAttr {
4440
public:
4441
  enum Spelling {
4442
    GNU_gnu_inline = 0,
4443
    CXX11_gnu_gnu_inline = 1,
4444
    C2x_gnu_gnu_inline = 2,
4445
  SpellingNotCalculated = 15
4446
 
4447
  };
4448
 
4449
  // Factory methods
4450
  static GNUInlineAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
4451
  static GNUInlineAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
4452
  static GNUInlineAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4453
  static GNUInlineAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4454
 
4455
  // Constructors
4456
  GNUInlineAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
4457
             );
4458
 
4459
  GNUInlineAttr *clone(ASTContext &C) const;
4460
  void printPretty(raw_ostream &OS,
4461
                   const PrintingPolicy &Policy) const;
4462
  const char *getSpelling() const;
4463
 
4464
 
4465
  static bool classof(const Attr *A) { return A->getKind() == attr::GNUInline; }
4466
};
4467
 
4468
class GuardedByAttr : public InheritableAttr {
4469
Expr * arg;
4470
 
4471
public:
4472
  // Factory methods
4473
  static GuardedByAttr *CreateImplicit(ASTContext &Ctx, Expr * Arg, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
4474
  static GuardedByAttr *Create(ASTContext &Ctx, Expr * Arg, const AttributeCommonInfo &CommonInfo);
4475
  static GuardedByAttr *CreateImplicit(ASTContext &Ctx, Expr * Arg, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4476
  static GuardedByAttr *Create(ASTContext &Ctx, Expr * Arg, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4477
 
4478
  // Constructors
4479
  GuardedByAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
4480
              , Expr * Arg
4481
             );
4482
 
4483
  GuardedByAttr *clone(ASTContext &C) const;
4484
  void printPretty(raw_ostream &OS,
4485
                   const PrintingPolicy &Policy) const;
4486
  const char *getSpelling() const;
4487
  Expr * getArg() const {
4488
    return arg;
4489
  }
4490
 
4491
 
4492
 
4493
  static bool classof(const Attr *A) { return A->getKind() == attr::GuardedBy; }
4494
};
4495
 
4496
class GuardedVarAttr : public InheritableAttr {
4497
public:
4498
  enum Spelling {
4499
    GNU_guarded_var = 0,
4500
    CXX11_clang_guarded_var = 1,
4501
  SpellingNotCalculated = 15
4502
 
4503
  };
4504
 
4505
  // Factory methods
4506
  static GuardedVarAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
4507
  static GuardedVarAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
4508
  static GuardedVarAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4509
  static GuardedVarAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4510
 
4511
  // Constructors
4512
  GuardedVarAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
4513
             );
4514
 
4515
  GuardedVarAttr *clone(ASTContext &C) const;
4516
  void printPretty(raw_ostream &OS,
4517
                   const PrintingPolicy &Policy) const;
4518
  const char *getSpelling() const;
4519
 
4520
 
4521
  static bool classof(const Attr *A) { return A->getKind() == attr::GuardedVar; }
4522
};
4523
 
4524
class HIPManagedAttr : public InheritableAttr {
4525
public:
4526
  enum Spelling {
4527
    GNU_managed = 0,
4528
    Declspec_managed = 1,
4529
  SpellingNotCalculated = 15
4530
 
4531
  };
4532
 
4533
  // Factory methods
4534
  static HIPManagedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
4535
  static HIPManagedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
4536
  static HIPManagedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4537
  static HIPManagedAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4538
 
4539
  // Constructors
4540
  HIPManagedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
4541
             );
4542
 
4543
  HIPManagedAttr *clone(ASTContext &C) const;
4544
  void printPretty(raw_ostream &OS,
4545
                   const PrintingPolicy &Policy) const;
4546
  const char *getSpelling() const;
4547
 
4548
 
4549
  static bool classof(const Attr *A) { return A->getKind() == attr::HIPManaged; }
4550
};
4551
 
4552
class HLSLGroupSharedAddressSpaceAttr : public TypeAttr {
4553
public:
4554
  // Factory methods
4555
  static HLSLGroupSharedAddressSpaceAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
4556
  static HLSLGroupSharedAddressSpaceAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
4557
  static HLSLGroupSharedAddressSpaceAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4558
  static HLSLGroupSharedAddressSpaceAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4559
 
4560
  // Constructors
4561
  HLSLGroupSharedAddressSpaceAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
4562
             );
4563
 
4564
  HLSLGroupSharedAddressSpaceAttr *clone(ASTContext &C) const;
4565
  void printPretty(raw_ostream &OS,
4566
                   const PrintingPolicy &Policy) const;
4567
  const char *getSpelling() const;
4568
 
4569
 
4570
  static bool classof(const Attr *A) { return A->getKind() == attr::HLSLGroupSharedAddressSpace; }
4571
};
4572
 
4573
class HLSLNumThreadsAttr : public InheritableAttr {
4574
int x;
4575
 
4576
int y;
4577
 
4578
int z;
4579
 
4580
public:
4581
  // Factory methods
4582
  static HLSLNumThreadsAttr *CreateImplicit(ASTContext &Ctx, int X, int Y, int Z, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
4583
  static HLSLNumThreadsAttr *Create(ASTContext &Ctx, int X, int Y, int Z, const AttributeCommonInfo &CommonInfo);
4584
  static HLSLNumThreadsAttr *CreateImplicit(ASTContext &Ctx, int X, int Y, int Z, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4585
  static HLSLNumThreadsAttr *Create(ASTContext &Ctx, int X, int Y, int Z, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4586
 
4587
  // Constructors
4588
  HLSLNumThreadsAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
4589
              , int X
4590
              , int Y
4591
              , int Z
4592
             );
4593
 
4594
  HLSLNumThreadsAttr *clone(ASTContext &C) const;
4595
  void printPretty(raw_ostream &OS,
4596
                   const PrintingPolicy &Policy) const;
4597
  const char *getSpelling() const;
4598
  int getX() const {
4599
    return x;
4600
  }
4601
 
4602
  int getY() const {
4603
    return y;
4604
  }
4605
 
4606
  int getZ() const {
4607
    return z;
4608
  }
4609
 
4610
 
4611
 
4612
  static bool classof(const Attr *A) { return A->getKind() == attr::HLSLNumThreads; }
4613
};
4614
 
4615
class HLSLResourceAttr : public InheritableAttr {
4616
public:
4617
  enum ResourceClass {
4618
    SRV,
4619
    UAV,
4620
    CBuffer,
4621
    Sampler
4622
  };
4623
private:
4624
  ResourceClass resourceType;
4625
 
4626
public:
4627
  enum ResourceKind {
4628
    Texture1D,
4629
    Texture2D,
4630
    Texture2DMS,
4631
    Texture3D,
4632
    TextureCube,
4633
    Texture1DArray,
4634
    Texture2DArray,
4635
    Texture2DMSArray,
4636
    TextureCubeArray,
4637
    TypedBuffer,
4638
    RawBuffer,
4639
    StructuredBuffer,
4640
    CBufferKind,
4641
    SamplerKind,
4642
    TBuffer,
4643
    RTAccelerationStructure,
4644
    FeedbackTexture2D,
4645
    FeedbackTexture2DArray
4646
  };
4647
private:
4648
  ResourceKind resourceShape;
4649
 
4650
public:
4651
  // Factory methods
4652
  static HLSLResourceAttr *CreateImplicit(ASTContext &Ctx, ResourceClass ResourceType, ResourceKind ResourceShape, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
4653
  static HLSLResourceAttr *Create(ASTContext &Ctx, ResourceClass ResourceType, ResourceKind ResourceShape, const AttributeCommonInfo &CommonInfo);
4654
  static HLSLResourceAttr *CreateImplicit(ASTContext &Ctx, ResourceClass ResourceType, ResourceKind ResourceShape, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4655
  static HLSLResourceAttr *Create(ASTContext &Ctx, ResourceClass ResourceType, ResourceKind ResourceShape, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4656
 
4657
  // Constructors
4658
  HLSLResourceAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
4659
              , ResourceClass ResourceType
4660
              , ResourceKind ResourceShape
4661
             );
4662
 
4663
  HLSLResourceAttr *clone(ASTContext &C) const;
4664
  void printPretty(raw_ostream &OS,
4665
                   const PrintingPolicy &Policy) const;
4666
  const char *getSpelling() const;
4667
  ResourceClass getResourceType() const {
4668
    return resourceType;
4669
  }
4670
 
4671
  static bool ConvertStrToResourceClass(StringRef Val, ResourceClass &Out);
4672
  static const char *ConvertResourceClassToStr(ResourceClass Val);
4673
  ResourceKind getResourceShape() const {
4674
    return resourceShape;
4675
  }
4676
 
4677
  static bool ConvertStrToResourceKind(StringRef Val, ResourceKind &Out);
4678
  static const char *ConvertResourceKindToStr(ResourceKind Val);
4679
 
4680
 
4681
  static bool classof(const Attr *A) { return A->getKind() == attr::HLSLResource; }
4682
};
4683
 
4684
class HLSLResourceBindingAttr : public InheritableAttr {
4685
unsigned slotLength;
4686
char *slot;
4687
 
4688
unsigned spaceLength;
4689
char *space;
4690
 
4691
public:
4692
  // Factory methods
4693
  static HLSLResourceBindingAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Slot, llvm::StringRef Space, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
4694
  static HLSLResourceBindingAttr *Create(ASTContext &Ctx, llvm::StringRef Slot, llvm::StringRef Space, const AttributeCommonInfo &CommonInfo);
4695
  static HLSLResourceBindingAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Slot, llvm::StringRef Space, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4696
  static HLSLResourceBindingAttr *Create(ASTContext &Ctx, llvm::StringRef Slot, llvm::StringRef Space, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4697
 
4698
  // Constructors
4699
  HLSLResourceBindingAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
4700
              , llvm::StringRef Slot
4701
              , llvm::StringRef Space
4702
             );
4703
  HLSLResourceBindingAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
4704
              , llvm::StringRef Slot
4705
             );
4706
 
4707
  HLSLResourceBindingAttr *clone(ASTContext &C) const;
4708
  void printPretty(raw_ostream &OS,
4709
                   const PrintingPolicy &Policy) const;
4710
  const char *getSpelling() const;
4711
  llvm::StringRef getSlot() const {
4712
    return llvm::StringRef(slot, slotLength);
4713
  }
4714
  unsigned getSlotLength() const {
4715
    return slotLength;
4716
  }
4717
  void setSlot(ASTContext &C, llvm::StringRef S) {
4718
    slotLength = S.size();
4719
    this->slot = new (C, 1) char [slotLength];
4720
    if (!S.empty())
4721
      std::memcpy(this->slot, S.data(), slotLength);
4722
  }
4723
 
4724
  llvm::StringRef getSpace() const {
4725
    return llvm::StringRef(space, spaceLength);
4726
  }
4727
  unsigned getSpaceLength() const {
4728
    return spaceLength;
4729
  }
4730
  void setSpace(ASTContext &C, llvm::StringRef S) {
4731
    spaceLength = S.size();
4732
    this->space = new (C, 1) char [spaceLength];
4733
    if (!S.empty())
4734
      std::memcpy(this->space, S.data(), spaceLength);
4735
  }
4736
 
4737
 
4738
 
4739
  static bool classof(const Attr *A) { return A->getKind() == attr::HLSLResourceBinding; }
4740
};
4741
 
4742
class HLSLSV_DispatchThreadIDAttr : public HLSLAnnotationAttr {
4743
public:
4744
  // Factory methods
4745
  static HLSLSV_DispatchThreadIDAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
4746
  static HLSLSV_DispatchThreadIDAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
4747
  static HLSLSV_DispatchThreadIDAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4748
  static HLSLSV_DispatchThreadIDAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4749
 
4750
  // Constructors
4751
  HLSLSV_DispatchThreadIDAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
4752
             );
4753
 
4754
  HLSLSV_DispatchThreadIDAttr *clone(ASTContext &C) const;
4755
  void printPretty(raw_ostream &OS,
4756
                   const PrintingPolicy &Policy) const;
4757
  const char *getSpelling() const;
4758
 
4759
 
4760
  static bool classof(const Attr *A) { return A->getKind() == attr::HLSLSV_DispatchThreadID; }
4761
};
4762
 
4763
class HLSLSV_GroupIndexAttr : public HLSLAnnotationAttr {
4764
public:
4765
  // Factory methods
4766
  static HLSLSV_GroupIndexAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
4767
  static HLSLSV_GroupIndexAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
4768
  static HLSLSV_GroupIndexAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4769
  static HLSLSV_GroupIndexAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4770
 
4771
  // Constructors
4772
  HLSLSV_GroupIndexAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
4773
             );
4774
 
4775
  HLSLSV_GroupIndexAttr *clone(ASTContext &C) const;
4776
  void printPretty(raw_ostream &OS,
4777
                   const PrintingPolicy &Policy) const;
4778
  const char *getSpelling() const;
4779
 
4780
 
4781
  static bool classof(const Attr *A) { return A->getKind() == attr::HLSLSV_GroupIndex; }
4782
};
4783
 
4784
class HLSLShaderAttr : public InheritableAttr {
4785
public:
4786
  enum ShaderType {
4787
    Pixel,
4788
    Vertex,
4789
    Geometry,
4790
    Hull,
4791
    Domain,
4792
    Compute,
4793
    Library,
4794
    RayGeneration,
4795
    Intersection,
4796
    AnyHit,
4797
    ClosestHit,
4798
    Miss,
4799
    Callable,
4800
    Mesh,
4801
    Amplification
4802
  };
4803
private:
4804
  ShaderType type;
4805
 
4806
public:
4807
  // Factory methods
4808
  static HLSLShaderAttr *CreateImplicit(ASTContext &Ctx, ShaderType Type, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
4809
  static HLSLShaderAttr *Create(ASTContext &Ctx, ShaderType Type, const AttributeCommonInfo &CommonInfo);
4810
  static HLSLShaderAttr *CreateImplicit(ASTContext &Ctx, ShaderType Type, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4811
  static HLSLShaderAttr *Create(ASTContext &Ctx, ShaderType Type, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4812
 
4813
  // Constructors
4814
  HLSLShaderAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
4815
              , ShaderType Type
4816
             );
4817
 
4818
  HLSLShaderAttr *clone(ASTContext &C) const;
4819
  void printPretty(raw_ostream &OS,
4820
                   const PrintingPolicy &Policy) const;
4821
  const char *getSpelling() const;
4822
  ShaderType getType() const {
4823
    return type;
4824
  }
4825
 
4826
  static bool ConvertStrToShaderType(StringRef Val, ShaderType &Out);
4827
  static const char *ConvertShaderTypeToStr(ShaderType Val);
4828
 
4829
 
4830
  static bool classof(const Attr *A) { return A->getKind() == attr::HLSLShader; }
4831
};
4832
 
4833
class HotAttr : public InheritableAttr {
4834
public:
4835
  enum Spelling {
4836
    GNU_hot = 0,
4837
    CXX11_gnu_hot = 1,
4838
    C2x_gnu_hot = 2,
4839
  SpellingNotCalculated = 15
4840
 
4841
  };
4842
 
4843
  // Factory methods
4844
  static HotAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
4845
  static HotAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
4846
  static HotAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4847
  static HotAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4848
 
4849
  // Constructors
4850
  HotAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
4851
             );
4852
 
4853
  HotAttr *clone(ASTContext &C) const;
4854
  void printPretty(raw_ostream &OS,
4855
                   const PrintingPolicy &Policy) const;
4856
  const char *getSpelling() const;
4857
 
4858
 
4859
  static bool classof(const Attr *A) { return A->getKind() == attr::Hot; }
4860
};
4861
 
4862
class IBActionAttr : public InheritableAttr {
4863
public:
4864
  enum Spelling {
4865
    GNU_ibaction = 0,
4866
    CXX11_clang_ibaction = 1,
4867
    C2x_clang_ibaction = 2,
4868
  SpellingNotCalculated = 15
4869
 
4870
  };
4871
 
4872
  // Factory methods
4873
  static IBActionAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
4874
  static IBActionAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
4875
  static IBActionAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4876
  static IBActionAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4877
 
4878
  // Constructors
4879
  IBActionAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
4880
             );
4881
 
4882
  IBActionAttr *clone(ASTContext &C) const;
4883
  void printPretty(raw_ostream &OS,
4884
                   const PrintingPolicy &Policy) const;
4885
  const char *getSpelling() const;
4886
 
4887
 
4888
  static bool classof(const Attr *A) { return A->getKind() == attr::IBAction; }
4889
};
4890
 
4891
class IBOutletAttr : public InheritableAttr {
4892
public:
4893
  enum Spelling {
4894
    GNU_iboutlet = 0,
4895
    CXX11_clang_iboutlet = 1,
4896
    C2x_clang_iboutlet = 2,
4897
  SpellingNotCalculated = 15
4898
 
4899
  };
4900
 
4901
  // Factory methods
4902
  static IBOutletAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
4903
  static IBOutletAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
4904
  static IBOutletAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4905
  static IBOutletAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4906
 
4907
  // Constructors
4908
  IBOutletAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
4909
             );
4910
 
4911
  IBOutletAttr *clone(ASTContext &C) const;
4912
  void printPretty(raw_ostream &OS,
4913
                   const PrintingPolicy &Policy) const;
4914
  const char *getSpelling() const;
4915
 
4916
 
4917
  static bool classof(const Attr *A) { return A->getKind() == attr::IBOutlet; }
4918
};
4919
 
4920
class IBOutletCollectionAttr : public InheritableAttr {
4921
TypeSourceInfo * interface_;
4922
 
4923
public:
4924
  enum Spelling {
4925
    GNU_iboutletcollection = 0,
4926
    CXX11_clang_iboutletcollection = 1,
4927
    C2x_clang_iboutletcollection = 2,
4928
  SpellingNotCalculated = 15
4929
 
4930
  };
4931
 
4932
  // Factory methods
4933
  static IBOutletCollectionAttr *CreateImplicit(ASTContext &Ctx, TypeSourceInfo * Interface, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
4934
  static IBOutletCollectionAttr *Create(ASTContext &Ctx, TypeSourceInfo * Interface, const AttributeCommonInfo &CommonInfo);
4935
  static IBOutletCollectionAttr *CreateImplicit(ASTContext &Ctx, TypeSourceInfo * Interface, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4936
  static IBOutletCollectionAttr *Create(ASTContext &Ctx, TypeSourceInfo * Interface, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4937
 
4938
  // Constructors
4939
  IBOutletCollectionAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
4940
              , TypeSourceInfo * Interface
4941
             );
4942
  IBOutletCollectionAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
4943
             );
4944
 
4945
  IBOutletCollectionAttr *clone(ASTContext &C) const;
4946
  void printPretty(raw_ostream &OS,
4947
                   const PrintingPolicy &Policy) const;
4948
  const char *getSpelling() const;
4949
  QualType getInterface() const {
4950
    return interface_->getType();
4951
  }  TypeSourceInfo * getInterfaceLoc() const {
4952
    return interface_;
4953
  }
4954
 
4955
 
4956
 
4957
  static bool classof(const Attr *A) { return A->getKind() == attr::IBOutletCollection; }
4958
};
4959
 
4960
class IFuncAttr : public Attr {
4961
unsigned resolverLength;
4962
char *resolver;
4963
 
4964
public:
4965
  enum Spelling {
4966
    GNU_ifunc = 0,
4967
    CXX11_gnu_ifunc = 1,
4968
    C2x_gnu_ifunc = 2,
4969
  SpellingNotCalculated = 15
4970
 
4971
  };
4972
 
4973
  // Factory methods
4974
  static IFuncAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Resolver, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
4975
  static IFuncAttr *Create(ASTContext &Ctx, llvm::StringRef Resolver, const AttributeCommonInfo &CommonInfo);
4976
  static IFuncAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Resolver, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4977
  static IFuncAttr *Create(ASTContext &Ctx, llvm::StringRef Resolver, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
4978
 
4979
  // Constructors
4980
  IFuncAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
4981
              , llvm::StringRef Resolver
4982
             );
4983
 
4984
  IFuncAttr *clone(ASTContext &C) const;
4985
  void printPretty(raw_ostream &OS,
4986
                   const PrintingPolicy &Policy) const;
4987
  const char *getSpelling() const;
4988
  llvm::StringRef getResolver() const {
4989
    return llvm::StringRef(resolver, resolverLength);
4990
  }
4991
  unsigned getResolverLength() const {
4992
    return resolverLength;
4993
  }
4994
  void setResolver(ASTContext &C, llvm::StringRef S) {
4995
    resolverLength = S.size();
4996
    this->resolver = new (C, 1) char [resolverLength];
4997
    if (!S.empty())
4998
      std::memcpy(this->resolver, S.data(), resolverLength);
4999
  }
5000
 
5001
 
5002
 
5003
  static bool classof(const Attr *A) { return A->getKind() == attr::IFunc; }
5004
};
5005
 
5006
class InitPriorityAttr : public InheritableAttr {
5007
unsigned priority;
5008
 
5009
public:
5010
  enum Spelling {
5011
    GNU_init_priority = 0,
5012
    CXX11_gnu_init_priority = 1,
5013
  SpellingNotCalculated = 15
5014
 
5015
  };
5016
 
5017
  // Factory methods
5018
  static InitPriorityAttr *CreateImplicit(ASTContext &Ctx, unsigned Priority, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
5019
  static InitPriorityAttr *Create(ASTContext &Ctx, unsigned Priority, const AttributeCommonInfo &CommonInfo);
5020
  static InitPriorityAttr *CreateImplicit(ASTContext &Ctx, unsigned Priority, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5021
  static InitPriorityAttr *Create(ASTContext &Ctx, unsigned Priority, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5022
 
5023
  // Constructors
5024
  InitPriorityAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
5025
              , unsigned Priority
5026
             );
5027
 
5028
  InitPriorityAttr *clone(ASTContext &C) const;
5029
  void printPretty(raw_ostream &OS,
5030
                   const PrintingPolicy &Policy) const;
5031
  const char *getSpelling() const;
5032
  unsigned getPriority() const {
5033
    return priority;
5034
  }
5035
 
5036
 
5037
 
5038
  static bool classof(const Attr *A) { return A->getKind() == attr::InitPriority; }
5039
};
5040
 
5041
class InitSegAttr : public Attr {
5042
unsigned sectionLength;
5043
char *section;
5044
 
5045
public:
5046
  // Factory methods
5047
  static InitSegAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Section, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
5048
  static InitSegAttr *Create(ASTContext &Ctx, llvm::StringRef Section, const AttributeCommonInfo &CommonInfo);
5049
  static InitSegAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Section, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5050
  static InitSegAttr *Create(ASTContext &Ctx, llvm::StringRef Section, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5051
 
5052
  // Constructors
5053
  InitSegAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
5054
              , llvm::StringRef Section
5055
             );
5056
 
5057
  InitSegAttr *clone(ASTContext &C) const;
5058
  void printPretty(raw_ostream &OS,
5059
                   const PrintingPolicy &Policy) const;
5060
  const char *getSpelling() const;
5061
  llvm::StringRef getSection() const {
5062
    return llvm::StringRef(section, sectionLength);
5063
  }
5064
  unsigned getSectionLength() const {
5065
    return sectionLength;
5066
  }
5067
  void setSection(ASTContext &C, llvm::StringRef S) {
5068
    sectionLength = S.size();
5069
    this->section = new (C, 1) char [sectionLength];
5070
    if (!S.empty())
5071
      std::memcpy(this->section, S.data(), sectionLength);
5072
  }
5073
 
5074
 
5075
  void printPrettyPragma(raw_ostream &OS, const PrintingPolicy &Policy) const {
5076
    OS << " (" << getSection() << ')';
5077
  }
5078
 
5079
 
5080
  static bool classof(const Attr *A) { return A->getKind() == attr::InitSeg; }
5081
};
5082
 
5083
class IntelOclBiccAttr : public InheritableAttr {
5084
public:
5085
  enum Spelling {
5086
    GNU_intel_ocl_bicc = 0,
5087
    CXX11_clang_intel_ocl_bicc = 1,
5088
  SpellingNotCalculated = 15
5089
 
5090
  };
5091
 
5092
  // Factory methods
5093
  static IntelOclBiccAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
5094
  static IntelOclBiccAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
5095
  static IntelOclBiccAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5096
  static IntelOclBiccAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5097
 
5098
  // Constructors
5099
  IntelOclBiccAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
5100
             );
5101
 
5102
  IntelOclBiccAttr *clone(ASTContext &C) const;
5103
  void printPretty(raw_ostream &OS,
5104
                   const PrintingPolicy &Policy) const;
5105
  const char *getSpelling() const;
5106
 
5107
 
5108
  static bool classof(const Attr *A) { return A->getKind() == attr::IntelOclBicc; }
5109
};
5110
 
5111
class InternalLinkageAttr : public InheritableAttr {
5112
public:
5113
  enum Spelling {
5114
    GNU_internal_linkage = 0,
5115
    CXX11_clang_internal_linkage = 1,
5116
    C2x_clang_internal_linkage = 2,
5117
  SpellingNotCalculated = 15
5118
 
5119
  };
5120
 
5121
  // Factory methods
5122
  static InternalLinkageAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
5123
  static InternalLinkageAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
5124
  static InternalLinkageAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5125
  static InternalLinkageAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5126
 
5127
  // Constructors
5128
  InternalLinkageAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
5129
             );
5130
 
5131
  InternalLinkageAttr *clone(ASTContext &C) const;
5132
  void printPretty(raw_ostream &OS,
5133
                   const PrintingPolicy &Policy) const;
5134
  const char *getSpelling() const;
5135
 
5136
 
5137
  static bool classof(const Attr *A) { return A->getKind() == attr::InternalLinkage; }
5138
};
5139
 
5140
class LTOVisibilityPublicAttr : public InheritableAttr {
5141
public:
5142
  enum Spelling {
5143
    GNU_lto_visibility_public = 0,
5144
    CXX11_clang_lto_visibility_public = 1,
5145
    C2x_clang_lto_visibility_public = 2,
5146
  SpellingNotCalculated = 15
5147
 
5148
  };
5149
 
5150
  // Factory methods
5151
  static LTOVisibilityPublicAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
5152
  static LTOVisibilityPublicAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
5153
  static LTOVisibilityPublicAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5154
  static LTOVisibilityPublicAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5155
 
5156
  // Constructors
5157
  LTOVisibilityPublicAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
5158
             );
5159
 
5160
  LTOVisibilityPublicAttr *clone(ASTContext &C) const;
5161
  void printPretty(raw_ostream &OS,
5162
                   const PrintingPolicy &Policy) const;
5163
  const char *getSpelling() const;
5164
 
5165
 
5166
  static bool classof(const Attr *A) { return A->getKind() == attr::LTOVisibilityPublic; }
5167
};
5168
 
5169
class LayoutVersionAttr : public InheritableAttr {
5170
unsigned version;
5171
 
5172
public:
5173
  // Factory methods
5174
  static LayoutVersionAttr *CreateImplicit(ASTContext &Ctx, unsigned Version, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
5175
  static LayoutVersionAttr *Create(ASTContext &Ctx, unsigned Version, const AttributeCommonInfo &CommonInfo);
5176
  static LayoutVersionAttr *CreateImplicit(ASTContext &Ctx, unsigned Version, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5177
  static LayoutVersionAttr *Create(ASTContext &Ctx, unsigned Version, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5178
 
5179
  // Constructors
5180
  LayoutVersionAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
5181
              , unsigned Version
5182
             );
5183
 
5184
  LayoutVersionAttr *clone(ASTContext &C) const;
5185
  void printPretty(raw_ostream &OS,
5186
                   const PrintingPolicy &Policy) const;
5187
  const char *getSpelling() const;
5188
  unsigned getVersion() const {
5189
    return version;
5190
  }
5191
 
5192
 
5193
 
5194
  static bool classof(const Attr *A) { return A->getKind() == attr::LayoutVersion; }
5195
};
5196
 
5197
class LeafAttr : public InheritableAttr {
5198
public:
5199
  enum Spelling {
5200
    GNU_leaf = 0,
5201
    CXX11_gnu_leaf = 1,
5202
    C2x_gnu_leaf = 2,
5203
  SpellingNotCalculated = 15
5204
 
5205
  };
5206
 
5207
  // Factory methods
5208
  static LeafAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
5209
  static LeafAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
5210
  static LeafAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5211
  static LeafAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5212
 
5213
  // Constructors
5214
  LeafAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
5215
             );
5216
 
5217
  LeafAttr *clone(ASTContext &C) const;
5218
  void printPretty(raw_ostream &OS,
5219
                   const PrintingPolicy &Policy) const;
5220
  const char *getSpelling() const;
5221
 
5222
 
5223
  static bool classof(const Attr *A) { return A->getKind() == attr::Leaf; }
5224
};
5225
 
5226
class LifetimeBoundAttr : public InheritableAttr {
5227
public:
5228
  enum Spelling {
5229
    GNU_lifetimebound = 0,
5230
    CXX11_clang_lifetimebound = 1,
5231
  SpellingNotCalculated = 15
5232
 
5233
  };
5234
 
5235
  // Factory methods
5236
  static LifetimeBoundAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
5237
  static LifetimeBoundAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
5238
  static LifetimeBoundAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5239
  static LifetimeBoundAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5240
 
5241
  // Constructors
5242
  LifetimeBoundAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
5243
             );
5244
 
5245
  LifetimeBoundAttr *clone(ASTContext &C) const;
5246
  void printPretty(raw_ostream &OS,
5247
                   const PrintingPolicy &Policy) const;
5248
  const char *getSpelling() const;
5249
 
5250
 
5251
  static bool classof(const Attr *A) { return A->getKind() == attr::LifetimeBound; }
5252
};
5253
 
5254
class LikelyAttr : public StmtAttr {
5255
public:
5256
  enum Spelling {
5257
    CXX11_likely = 0,
5258
    C2x_clang_likely = 1,
5259
  SpellingNotCalculated = 15
5260
 
5261
  };
5262
 
5263
  // Factory methods
5264
  static LikelyAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
5265
  static LikelyAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
5266
  static LikelyAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5267
  static LikelyAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5268
 
5269
  // Constructors
5270
  LikelyAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
5271
             );
5272
 
5273
  LikelyAttr *clone(ASTContext &C) const;
5274
  void printPretty(raw_ostream &OS,
5275
                   const PrintingPolicy &Policy) const;
5276
  const char *getSpelling() const;
5277
 
5278
 
5279
  static bool classof(const Attr *A) { return A->getKind() == attr::Likely; }
5280
};
5281
 
5282
class LoaderUninitializedAttr : public Attr {
5283
public:
5284
  enum Spelling {
5285
    GNU_loader_uninitialized = 0,
5286
    CXX11_clang_loader_uninitialized = 1,
5287
    C2x_clang_loader_uninitialized = 2,
5288
  SpellingNotCalculated = 15
5289
 
5290
  };
5291
 
5292
  // Factory methods
5293
  static LoaderUninitializedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
5294
  static LoaderUninitializedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
5295
  static LoaderUninitializedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5296
  static LoaderUninitializedAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5297
 
5298
  // Constructors
5299
  LoaderUninitializedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
5300
             );
5301
 
5302
  LoaderUninitializedAttr *clone(ASTContext &C) const;
5303
  void printPretty(raw_ostream &OS,
5304
                   const PrintingPolicy &Policy) const;
5305
  const char *getSpelling() const;
5306
 
5307
 
5308
  static bool classof(const Attr *A) { return A->getKind() == attr::LoaderUninitialized; }
5309
};
5310
 
5311
class LockReturnedAttr : public InheritableAttr {
5312
Expr * arg;
5313
 
5314
public:
5315
  // Factory methods
5316
  static LockReturnedAttr *CreateImplicit(ASTContext &Ctx, Expr * Arg, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
5317
  static LockReturnedAttr *Create(ASTContext &Ctx, Expr * Arg, const AttributeCommonInfo &CommonInfo);
5318
  static LockReturnedAttr *CreateImplicit(ASTContext &Ctx, Expr * Arg, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5319
  static LockReturnedAttr *Create(ASTContext &Ctx, Expr * Arg, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5320
 
5321
  // Constructors
5322
  LockReturnedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
5323
              , Expr * Arg
5324
             );
5325
 
5326
  LockReturnedAttr *clone(ASTContext &C) const;
5327
  void printPretty(raw_ostream &OS,
5328
                   const PrintingPolicy &Policy) const;
5329
  const char *getSpelling() const;
5330
  Expr * getArg() const {
5331
    return arg;
5332
  }
5333
 
5334
 
5335
 
5336
  static bool classof(const Attr *A) { return A->getKind() == attr::LockReturned; }
5337
};
5338
 
5339
class LocksExcludedAttr : public InheritableAttr {
5340
  unsigned args_Size;
5341
  Expr * *args_;
5342
 
5343
public:
5344
  // Factory methods
5345
  static LocksExcludedAttr *CreateImplicit(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
5346
  static LocksExcludedAttr *Create(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo);
5347
  static LocksExcludedAttr *CreateImplicit(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5348
  static LocksExcludedAttr *Create(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5349
 
5350
  // Constructors
5351
  LocksExcludedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
5352
              , Expr * *Args, unsigned ArgsSize
5353
             );
5354
  LocksExcludedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
5355
             );
5356
 
5357
  LocksExcludedAttr *clone(ASTContext &C) const;
5358
  void printPretty(raw_ostream &OS,
5359
                   const PrintingPolicy &Policy) const;
5360
  const char *getSpelling() const;
5361
  typedef Expr ** args_iterator;
5362
  args_iterator args_begin() const { return args_; }
5363
  args_iterator args_end() const { return args_ + args_Size; }
5364
  unsigned args_size() const { return args_Size; }
5365
  llvm::iterator_range<args_iterator> args() const { return llvm::make_range(args_begin(), args_end()); }
5366
 
5367
 
5368
 
5369
 
5370
  static bool classof(const Attr *A) { return A->getKind() == attr::LocksExcluded; }
5371
};
5372
 
5373
class LoopHintAttr : public Attr {
5374
public:
5375
  enum OptionType {
5376
    Vectorize,
5377
    VectorizeWidth,
5378
    Interleave,
5379
    InterleaveCount,
5380
    Unroll,
5381
    UnrollCount,
5382
    UnrollAndJam,
5383
    UnrollAndJamCount,
5384
    PipelineDisabled,
5385
    PipelineInitiationInterval,
5386
    Distribute,
5387
    VectorizePredicate
5388
  };
5389
private:
5390
  OptionType option;
5391
 
5392
public:
5393
  enum LoopHintState {
5394
    Enable,
5395
    Disable,
5396
    Numeric,
5397
    FixedWidth,
5398
    ScalableWidth,
5399
    AssumeSafety,
5400
    Full
5401
  };
5402
private:
5403
  LoopHintState state;
5404
 
5405
Expr * value;
5406
 
5407
public:
5408
  enum Spelling {
5409
    Pragma_clang_loop = 0,
5410
    Pragma_unroll = 1,
5411
    Pragma_nounroll = 2,
5412
    Pragma_unroll_and_jam = 3,
5413
    Pragma_nounroll_and_jam = 4,
5414
  SpellingNotCalculated = 15
5415
 
5416
  };
5417
 
5418
  // Factory methods
5419
  static LoopHintAttr *CreateImplicit(ASTContext &Ctx, OptionType Option, LoopHintState State, Expr * Value, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
5420
  static LoopHintAttr *Create(ASTContext &Ctx, OptionType Option, LoopHintState State, Expr * Value, const AttributeCommonInfo &CommonInfo);
5421
  static LoopHintAttr *CreateImplicit(ASTContext &Ctx, OptionType Option, LoopHintState State, Expr * Value, SourceRange Range, AttributeCommonInfo::Syntax Syntax, LoopHintAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
5422
  static LoopHintAttr *Create(ASTContext &Ctx, OptionType Option, LoopHintState State, Expr * Value, SourceRange Range, AttributeCommonInfo::Syntax Syntax, LoopHintAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
5423
 
5424
  // Constructors
5425
  LoopHintAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
5426
              , OptionType Option
5427
              , LoopHintState State
5428
              , Expr * Value
5429
             );
5430
 
5431
  LoopHintAttr *clone(ASTContext &C) const;
5432
  void printPretty(raw_ostream &OS,
5433
                   const PrintingPolicy &Policy) const;
5434
  const char *getSpelling() const;
5435
  Spelling getSemanticSpelling() const;
5436
  OptionType getOption() const {
5437
    return option;
5438
  }
5439
 
5440
  static bool ConvertStrToOptionType(StringRef Val, OptionType &Out);
5441
  static const char *ConvertOptionTypeToStr(OptionType Val);
5442
  LoopHintState getState() const {
5443
    return state;
5444
  }
5445
 
5446
  static bool ConvertStrToLoopHintState(StringRef Val, LoopHintState &Out);
5447
  static const char *ConvertLoopHintStateToStr(LoopHintState Val);
5448
  Expr * getValue() const {
5449
    return value;
5450
  }
5451
 
5452
 
5453
  static const char *getOptionName(int Option) {
5454
    switch(Option) {
5455
    case Vectorize: return "vectorize";
5456
    case VectorizeWidth: return "vectorize_width";
5457
    case Interleave: return "interleave";
5458
    case InterleaveCount: return "interleave_count";
5459
    case Unroll: return "unroll";
5460
    case UnrollCount: return "unroll_count";
5461
    case UnrollAndJam: return "unroll_and_jam";
5462
    case UnrollAndJamCount: return "unroll_and_jam_count";
5463
    case PipelineDisabled: return "pipeline";
5464
    case PipelineInitiationInterval: return "pipeline_initiation_interval";
5465
    case Distribute: return "distribute";
5466
    case VectorizePredicate: return "vectorize_predicate";
5467
    }
5468
    llvm_unreachable("Unhandled LoopHint option.");
5469
  }
5470
 
5471
  void printPrettyPragma(raw_ostream &OS, const PrintingPolicy &Policy) const;
5472
 
5473
  // Return a string containing the loop hint argument including the
5474
  // enclosing parentheses.
5475
  std::string getValueString(const PrintingPolicy &Policy) const;
5476
 
5477
  // Return a string suitable for identifying this attribute in diagnostics.
5478
  std::string getDiagnosticName(const PrintingPolicy &Policy) const;
5479
 
5480
 
5481
  static bool classof(const Attr *A) { return A->getKind() == attr::LoopHint; }
5482
};
5483
 
5484
class M68kInterruptAttr : public InheritableAttr {
5485
unsigned number;
5486
 
5487
public:
5488
  // Factory methods
5489
  static M68kInterruptAttr *CreateImplicit(ASTContext &Ctx, unsigned Number, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
5490
  static M68kInterruptAttr *Create(ASTContext &Ctx, unsigned Number, const AttributeCommonInfo &CommonInfo);
5491
  static M68kInterruptAttr *CreateImplicit(ASTContext &Ctx, unsigned Number, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5492
  static M68kInterruptAttr *Create(ASTContext &Ctx, unsigned Number, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5493
 
5494
  // Constructors
5495
  M68kInterruptAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
5496
              , unsigned Number
5497
             );
5498
 
5499
  M68kInterruptAttr *clone(ASTContext &C) const;
5500
  void printPretty(raw_ostream &OS,
5501
                   const PrintingPolicy &Policy) const;
5502
  const char *getSpelling() const;
5503
  unsigned getNumber() const {
5504
    return number;
5505
  }
5506
 
5507
 
5508
 
5509
  static bool classof(const Attr *A) { return A->getKind() == attr::M68kInterrupt; }
5510
};
5511
 
5512
class MIGServerRoutineAttr : public InheritableAttr {
5513
public:
5514
  enum Spelling {
5515
    GNU_mig_server_routine = 0,
5516
    CXX11_clang_mig_server_routine = 1,
5517
    C2x_clang_mig_server_routine = 2,
5518
  SpellingNotCalculated = 15
5519
 
5520
  };
5521
 
5522
  // Factory methods
5523
  static MIGServerRoutineAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
5524
  static MIGServerRoutineAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
5525
  static MIGServerRoutineAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5526
  static MIGServerRoutineAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5527
 
5528
  // Constructors
5529
  MIGServerRoutineAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
5530
             );
5531
 
5532
  MIGServerRoutineAttr *clone(ASTContext &C) const;
5533
  void printPretty(raw_ostream &OS,
5534
                   const PrintingPolicy &Policy) const;
5535
  const char *getSpelling() const;
5536
 
5537
 
5538
  static bool classof(const Attr *A) { return A->getKind() == attr::MIGServerRoutine; }
5539
};
5540
 
5541
class MSABIAttr : public InheritableAttr {
5542
public:
5543
  enum Spelling {
5544
    GNU_ms_abi = 0,
5545
    CXX11_gnu_ms_abi = 1,
5546
    C2x_gnu_ms_abi = 2,
5547
  SpellingNotCalculated = 15
5548
 
5549
  };
5550
 
5551
  // Factory methods
5552
  static MSABIAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
5553
  static MSABIAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
5554
  static MSABIAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5555
  static MSABIAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5556
 
5557
  // Constructors
5558
  MSABIAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
5559
             );
5560
 
5561
  MSABIAttr *clone(ASTContext &C) const;
5562
  void printPretty(raw_ostream &OS,
5563
                   const PrintingPolicy &Policy) const;
5564
  const char *getSpelling() const;
5565
 
5566
 
5567
  static bool classof(const Attr *A) { return A->getKind() == attr::MSABI; }
5568
};
5569
 
5570
class MSAllocatorAttr : public InheritableAttr {
5571
public:
5572
  // Factory methods
5573
  static MSAllocatorAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
5574
  static MSAllocatorAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
5575
  static MSAllocatorAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5576
  static MSAllocatorAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5577
 
5578
  // Constructors
5579
  MSAllocatorAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
5580
             );
5581
 
5582
  MSAllocatorAttr *clone(ASTContext &C) const;
5583
  void printPretty(raw_ostream &OS,
5584
                   const PrintingPolicy &Policy) const;
5585
  const char *getSpelling() const;
5586
 
5587
 
5588
  static bool classof(const Attr *A) { return A->getKind() == attr::MSAllocator; }
5589
};
5590
 
5591
class MSInheritanceAttr : public InheritableAttr {
5592
bool bestCase;
5593
 
5594
public:
5595
  enum Spelling {
5596
    Keyword_single_inheritance = 0,
5597
    Keyword_multiple_inheritance = 1,
5598
    Keyword_virtual_inheritance = 2,
5599
    Keyword_unspecified_inheritance = 3,
5600
  SpellingNotCalculated = 15
5601
 
5602
  };
5603
 
5604
  // Factory methods
5605
  static MSInheritanceAttr *CreateImplicit(ASTContext &Ctx, bool BestCase, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
5606
  static MSInheritanceAttr *Create(ASTContext &Ctx, bool BestCase, const AttributeCommonInfo &CommonInfo);
5607
  static MSInheritanceAttr *CreateImplicit(ASTContext &Ctx, bool BestCase, SourceRange Range, AttributeCommonInfo::Syntax Syntax, MSInheritanceAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
5608
  static MSInheritanceAttr *Create(ASTContext &Ctx, bool BestCase, SourceRange Range, AttributeCommonInfo::Syntax Syntax, MSInheritanceAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
5609
  static MSInheritanceAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
5610
  static MSInheritanceAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
5611
  static MSInheritanceAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax, MSInheritanceAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
5612
  static MSInheritanceAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax, MSInheritanceAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
5613
 
5614
  // Constructors
5615
  MSInheritanceAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
5616
              , bool BestCase
5617
             );
5618
  MSInheritanceAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
5619
             );
5620
 
5621
  MSInheritanceAttr *clone(ASTContext &C) const;
5622
  void printPretty(raw_ostream &OS,
5623
                   const PrintingPolicy &Policy) const;
5624
  const char *getSpelling() const;
5625
  Spelling getSemanticSpelling() const;
5626
  bool getBestCase() const {
5627
    return bestCase;
5628
  }
5629
 
5630
  static const bool DefaultBestCase = true;
5631
 
5632
 
5633
  MSInheritanceModel getInheritanceModel() const {
5634
    // The spelling enum should agree with MSInheritanceModel.
5635
    return MSInheritanceModel(getSemanticSpelling());
5636
  }
5637
 
5638
 
5639
  static bool classof(const Attr *A) { return A->getKind() == attr::MSInheritance; }
5640
};
5641
 
5642
class MSNoVTableAttr : public InheritableAttr {
5643
public:
5644
  // Factory methods
5645
  static MSNoVTableAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
5646
  static MSNoVTableAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
5647
  static MSNoVTableAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5648
  static MSNoVTableAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5649
 
5650
  // Constructors
5651
  MSNoVTableAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
5652
             );
5653
 
5654
  MSNoVTableAttr *clone(ASTContext &C) const;
5655
  void printPretty(raw_ostream &OS,
5656
                   const PrintingPolicy &Policy) const;
5657
  const char *getSpelling() const;
5658
 
5659
 
5660
  static bool classof(const Attr *A) { return A->getKind() == attr::MSNoVTable; }
5661
};
5662
 
5663
class MSP430InterruptAttr : public InheritableAttr {
5664
unsigned number;
5665
 
5666
public:
5667
  enum Spelling {
5668
    GNU_interrupt = 0,
5669
    CXX11_gnu_interrupt = 1,
5670
    C2x_gnu_interrupt = 2,
5671
  SpellingNotCalculated = 15
5672
 
5673
  };
5674
 
5675
  // Factory methods
5676
  static MSP430InterruptAttr *CreateImplicit(ASTContext &Ctx, unsigned Number, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
5677
  static MSP430InterruptAttr *Create(ASTContext &Ctx, unsigned Number, const AttributeCommonInfo &CommonInfo);
5678
  static MSP430InterruptAttr *CreateImplicit(ASTContext &Ctx, unsigned Number, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5679
  static MSP430InterruptAttr *Create(ASTContext &Ctx, unsigned Number, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5680
 
5681
  // Constructors
5682
  MSP430InterruptAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
5683
              , unsigned Number
5684
             );
5685
 
5686
  MSP430InterruptAttr *clone(ASTContext &C) const;
5687
  void printPretty(raw_ostream &OS,
5688
                   const PrintingPolicy &Policy) const;
5689
  const char *getSpelling() const;
5690
  unsigned getNumber() const {
5691
    return number;
5692
  }
5693
 
5694
 
5695
 
5696
  static bool classof(const Attr *A) { return A->getKind() == attr::MSP430Interrupt; }
5697
};
5698
 
5699
class MSStructAttr : public InheritableAttr {
5700
public:
5701
  enum Spelling {
5702
    GNU_ms_struct = 0,
5703
    CXX11_gnu_ms_struct = 1,
5704
    C2x_gnu_ms_struct = 2,
5705
  SpellingNotCalculated = 15
5706
 
5707
  };
5708
 
5709
  // Factory methods
5710
  static MSStructAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
5711
  static MSStructAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
5712
  static MSStructAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5713
  static MSStructAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5714
 
5715
  // Constructors
5716
  MSStructAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
5717
             );
5718
 
5719
  MSStructAttr *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::MSStruct; }
5726
};
5727
 
5728
class MSVtorDispAttr : public InheritableAttr {
5729
unsigned vdm;
5730
 
5731
public:
5732
  // Factory methods
5733
  static MSVtorDispAttr *CreateImplicit(ASTContext &Ctx, unsigned Vdm, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
5734
  static MSVtorDispAttr *Create(ASTContext &Ctx, unsigned Vdm, const AttributeCommonInfo &CommonInfo);
5735
  static MSVtorDispAttr *CreateImplicit(ASTContext &Ctx, unsigned Vdm, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5736
  static MSVtorDispAttr *Create(ASTContext &Ctx, unsigned Vdm, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5737
 
5738
  // Constructors
5739
  MSVtorDispAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
5740
              , unsigned Vdm
5741
             );
5742
 
5743
  MSVtorDispAttr *clone(ASTContext &C) const;
5744
  void printPretty(raw_ostream &OS,
5745
                   const PrintingPolicy &Policy) const;
5746
  const char *getSpelling() const;
5747
  unsigned getVdm() const {
5748
    return vdm;
5749
  }
5750
 
5751
 
5752
  MSVtorDispMode getVtorDispMode() const { return MSVtorDispMode(vdm); }
5753
 
5754
 
5755
  static bool classof(const Attr *A) { return A->getKind() == attr::MSVtorDisp; }
5756
};
5757
 
5758
class MaxFieldAlignmentAttr : public InheritableAttr {
5759
unsigned alignment;
5760
 
5761
public:
5762
  // Factory methods
5763
  static MaxFieldAlignmentAttr *CreateImplicit(ASTContext &Ctx, unsigned Alignment, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
5764
  static MaxFieldAlignmentAttr *Create(ASTContext &Ctx, unsigned Alignment, const AttributeCommonInfo &CommonInfo);
5765
  static MaxFieldAlignmentAttr *CreateImplicit(ASTContext &Ctx, unsigned Alignment, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5766
  static MaxFieldAlignmentAttr *Create(ASTContext &Ctx, unsigned Alignment, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5767
 
5768
  // Constructors
5769
  MaxFieldAlignmentAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
5770
              , unsigned Alignment
5771
             );
5772
 
5773
  MaxFieldAlignmentAttr *clone(ASTContext &C) const;
5774
  void printPretty(raw_ostream &OS,
5775
                   const PrintingPolicy &Policy) const;
5776
  const char *getSpelling() const;
5777
  unsigned getAlignment() const {
5778
    return alignment;
5779
  }
5780
 
5781
 
5782
 
5783
  static bool classof(const Attr *A) { return A->getKind() == attr::MaxFieldAlignment; }
5784
};
5785
 
5786
class MayAliasAttr : public InheritableAttr {
5787
public:
5788
  enum Spelling {
5789
    GNU_may_alias = 0,
5790
    CXX11_gnu_may_alias = 1,
5791
    C2x_gnu_may_alias = 2,
5792
  SpellingNotCalculated = 15
5793
 
5794
  };
5795
 
5796
  // Factory methods
5797
  static MayAliasAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
5798
  static MayAliasAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
5799
  static MayAliasAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5800
  static MayAliasAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5801
 
5802
  // Constructors
5803
  MayAliasAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
5804
             );
5805
 
5806
  MayAliasAttr *clone(ASTContext &C) const;
5807
  void printPretty(raw_ostream &OS,
5808
                   const PrintingPolicy &Policy) const;
5809
  const char *getSpelling() const;
5810
 
5811
 
5812
  static bool classof(const Attr *A) { return A->getKind() == attr::MayAlias; }
5813
};
5814
 
5815
class MaybeUndefAttr : public InheritableAttr {
5816
public:
5817
  enum Spelling {
5818
    GNU_maybe_undef = 0,
5819
    CXX11_clang_maybe_undef = 1,
5820
    C2x_clang_maybe_undef = 2,
5821
  SpellingNotCalculated = 15
5822
 
5823
  };
5824
 
5825
  // Factory methods
5826
  static MaybeUndefAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
5827
  static MaybeUndefAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
5828
  static MaybeUndefAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5829
  static MaybeUndefAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5830
 
5831
  // Constructors
5832
  MaybeUndefAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
5833
             );
5834
 
5835
  MaybeUndefAttr *clone(ASTContext &C) const;
5836
  void printPretty(raw_ostream &OS,
5837
                   const PrintingPolicy &Policy) const;
5838
  const char *getSpelling() const;
5839
 
5840
 
5841
  static bool classof(const Attr *A) { return A->getKind() == attr::MaybeUndef; }
5842
};
5843
 
5844
class MicroMipsAttr : public InheritableAttr {
5845
public:
5846
  enum Spelling {
5847
    GNU_micromips = 0,
5848
    CXX11_gnu_micromips = 1,
5849
    C2x_gnu_micromips = 2,
5850
  SpellingNotCalculated = 15
5851
 
5852
  };
5853
 
5854
  // Factory methods
5855
  static MicroMipsAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
5856
  static MicroMipsAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
5857
  static MicroMipsAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5858
  static MicroMipsAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5859
 
5860
  // Constructors
5861
  MicroMipsAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
5862
             );
5863
 
5864
  MicroMipsAttr *clone(ASTContext &C) const;
5865
  void printPretty(raw_ostream &OS,
5866
                   const PrintingPolicy &Policy) const;
5867
  const char *getSpelling() const;
5868
 
5869
 
5870
  static bool classof(const Attr *A) { return A->getKind() == attr::MicroMips; }
5871
};
5872
 
5873
class MinSizeAttr : public InheritableAttr {
5874
public:
5875
  enum Spelling {
5876
    GNU_minsize = 0,
5877
    CXX11_clang_minsize = 1,
5878
    C2x_clang_minsize = 2,
5879
  SpellingNotCalculated = 15
5880
 
5881
  };
5882
 
5883
  // Factory methods
5884
  static MinSizeAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
5885
  static MinSizeAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
5886
  static MinSizeAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5887
  static MinSizeAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5888
 
5889
  // Constructors
5890
  MinSizeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
5891
             );
5892
 
5893
  MinSizeAttr *clone(ASTContext &C) const;
5894
  void printPretty(raw_ostream &OS,
5895
                   const PrintingPolicy &Policy) const;
5896
  const char *getSpelling() const;
5897
 
5898
 
5899
  static bool classof(const Attr *A) { return A->getKind() == attr::MinSize; }
5900
};
5901
 
5902
class MinVectorWidthAttr : public InheritableAttr {
5903
unsigned vectorWidth;
5904
 
5905
public:
5906
  enum Spelling {
5907
    GNU_min_vector_width = 0,
5908
    CXX11_clang_min_vector_width = 1,
5909
    C2x_clang_min_vector_width = 2,
5910
  SpellingNotCalculated = 15
5911
 
5912
  };
5913
 
5914
  // Factory methods
5915
  static MinVectorWidthAttr *CreateImplicit(ASTContext &Ctx, unsigned VectorWidth, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
5916
  static MinVectorWidthAttr *Create(ASTContext &Ctx, unsigned VectorWidth, const AttributeCommonInfo &CommonInfo);
5917
  static MinVectorWidthAttr *CreateImplicit(ASTContext &Ctx, unsigned VectorWidth, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5918
  static MinVectorWidthAttr *Create(ASTContext &Ctx, unsigned VectorWidth, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5919
 
5920
  // Constructors
5921
  MinVectorWidthAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
5922
              , unsigned VectorWidth
5923
             );
5924
 
5925
  MinVectorWidthAttr *clone(ASTContext &C) const;
5926
  void printPretty(raw_ostream &OS,
5927
                   const PrintingPolicy &Policy) const;
5928
  const char *getSpelling() const;
5929
  unsigned getVectorWidth() const {
5930
    return vectorWidth;
5931
  }
5932
 
5933
 
5934
 
5935
  static bool classof(const Attr *A) { return A->getKind() == attr::MinVectorWidth; }
5936
};
5937
 
5938
class Mips16Attr : public InheritableAttr {
5939
public:
5940
  enum Spelling {
5941
    GNU_mips16 = 0,
5942
    CXX11_gnu_mips16 = 1,
5943
    C2x_gnu_mips16 = 2,
5944
  SpellingNotCalculated = 15
5945
 
5946
  };
5947
 
5948
  // Factory methods
5949
  static Mips16Attr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
5950
  static Mips16Attr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
5951
  static Mips16Attr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5952
  static Mips16Attr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5953
 
5954
  // Constructors
5955
  Mips16Attr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
5956
             );
5957
 
5958
  Mips16Attr *clone(ASTContext &C) const;
5959
  void printPretty(raw_ostream &OS,
5960
                   const PrintingPolicy &Policy) const;
5961
  const char *getSpelling() const;
5962
 
5963
 
5964
  static bool classof(const Attr *A) { return A->getKind() == attr::Mips16; }
5965
};
5966
 
5967
class MipsInterruptAttr : public InheritableAttr {
5968
public:
5969
  enum InterruptType {
5970
    sw0,
5971
    sw1,
5972
    hw0,
5973
    hw1,
5974
    hw2,
5975
    hw3,
5976
    hw4,
5977
    hw5,
5978
    eic
5979
  };
5980
private:
5981
  InterruptType interrupt;
5982
 
5983
public:
5984
  enum Spelling {
5985
    GNU_interrupt = 0,
5986
    CXX11_gnu_interrupt = 1,
5987
    C2x_gnu_interrupt = 2,
5988
  SpellingNotCalculated = 15
5989
 
5990
  };
5991
 
5992
  // Factory methods
5993
  static MipsInterruptAttr *CreateImplicit(ASTContext &Ctx, InterruptType Interrupt, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
5994
  static MipsInterruptAttr *Create(ASTContext &Ctx, InterruptType Interrupt, const AttributeCommonInfo &CommonInfo);
5995
  static MipsInterruptAttr *CreateImplicit(ASTContext &Ctx, InterruptType Interrupt, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5996
  static MipsInterruptAttr *Create(ASTContext &Ctx, InterruptType Interrupt, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
5997
 
5998
  // Constructors
5999
  MipsInterruptAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
6000
              , InterruptType Interrupt
6001
             );
6002
 
6003
  MipsInterruptAttr *clone(ASTContext &C) const;
6004
  void printPretty(raw_ostream &OS,
6005
                   const PrintingPolicy &Policy) const;
6006
  const char *getSpelling() const;
6007
  InterruptType getInterrupt() const {
6008
    return interrupt;
6009
  }
6010
 
6011
  static bool ConvertStrToInterruptType(StringRef Val, InterruptType &Out);
6012
  static const char *ConvertInterruptTypeToStr(InterruptType Val);
6013
 
6014
 
6015
  static bool classof(const Attr *A) { return A->getKind() == attr::MipsInterrupt; }
6016
};
6017
 
6018
class MipsLongCallAttr : public InheritableAttr {
6019
public:
6020
  enum Spelling {
6021
    GNU_long_call = 0,
6022
    CXX11_gnu_long_call = 1,
6023
    C2x_gnu_long_call = 2,
6024
    GNU_far = 3,
6025
    CXX11_gnu_far = 4,
6026
    C2x_gnu_far = 5,
6027
  SpellingNotCalculated = 15
6028
 
6029
  };
6030
 
6031
  // Factory methods
6032
  static MipsLongCallAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
6033
  static MipsLongCallAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
6034
  static MipsLongCallAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax, MipsLongCallAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
6035
  static MipsLongCallAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax, MipsLongCallAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
6036
 
6037
  // Constructors
6038
  MipsLongCallAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
6039
             );
6040
 
6041
  MipsLongCallAttr *clone(ASTContext &C) const;
6042
  void printPretty(raw_ostream &OS,
6043
                   const PrintingPolicy &Policy) const;
6044
  const char *getSpelling() const;
6045
  Spelling getSemanticSpelling() const;
6046
 
6047
 
6048
  static bool classof(const Attr *A) { return A->getKind() == attr::MipsLongCall; }
6049
};
6050
 
6051
class MipsShortCallAttr : public InheritableAttr {
6052
public:
6053
  enum Spelling {
6054
    GNU_short_call = 0,
6055
    CXX11_gnu_short_call = 1,
6056
    C2x_gnu_short_call = 2,
6057
    GNU_near = 3,
6058
    CXX11_gnu_near = 4,
6059
    C2x_gnu_near = 5,
6060
  SpellingNotCalculated = 15
6061
 
6062
  };
6063
 
6064
  // Factory methods
6065
  static MipsShortCallAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
6066
  static MipsShortCallAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
6067
  static MipsShortCallAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax, MipsShortCallAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
6068
  static MipsShortCallAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax, MipsShortCallAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
6069
 
6070
  // Constructors
6071
  MipsShortCallAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
6072
             );
6073
 
6074
  MipsShortCallAttr *clone(ASTContext &C) const;
6075
  void printPretty(raw_ostream &OS,
6076
                   const PrintingPolicy &Policy) const;
6077
  const char *getSpelling() const;
6078
  Spelling getSemanticSpelling() const;
6079
 
6080
 
6081
  static bool classof(const Attr *A) { return A->getKind() == attr::MipsShortCall; }
6082
};
6083
 
6084
class ModeAttr : public Attr {
6085
IdentifierInfo * mode;
6086
 
6087
public:
6088
  enum Spelling {
6089
    GNU_mode = 0,
6090
    CXX11_gnu_mode = 1,
6091
    C2x_gnu_mode = 2,
6092
  SpellingNotCalculated = 15
6093
 
6094
  };
6095
 
6096
  // Factory methods
6097
  static ModeAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * Mode, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
6098
  static ModeAttr *Create(ASTContext &Ctx, IdentifierInfo * Mode, const AttributeCommonInfo &CommonInfo);
6099
  static ModeAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * Mode, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6100
  static ModeAttr *Create(ASTContext &Ctx, IdentifierInfo * Mode, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6101
 
6102
  // Constructors
6103
  ModeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
6104
              , IdentifierInfo * Mode
6105
             );
6106
 
6107
  ModeAttr *clone(ASTContext &C) const;
6108
  void printPretty(raw_ostream &OS,
6109
                   const PrintingPolicy &Policy) const;
6110
  const char *getSpelling() const;
6111
  IdentifierInfo * getMode() const {
6112
    return mode;
6113
  }
6114
 
6115
 
6116
 
6117
  static bool classof(const Attr *A) { return A->getKind() == attr::Mode; }
6118
};
6119
 
6120
class MustTailAttr : public StmtAttr {
6121
public:
6122
  enum Spelling {
6123
    GNU_musttail = 0,
6124
    CXX11_clang_musttail = 1,
6125
    C2x_clang_musttail = 2,
6126
  SpellingNotCalculated = 15
6127
 
6128
  };
6129
 
6130
  // Factory methods
6131
  static MustTailAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
6132
  static MustTailAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
6133
  static MustTailAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6134
  static MustTailAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6135
 
6136
  // Constructors
6137
  MustTailAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
6138
             );
6139
 
6140
  MustTailAttr *clone(ASTContext &C) const;
6141
  void printPretty(raw_ostream &OS,
6142
                   const PrintingPolicy &Policy) const;
6143
  const char *getSpelling() const;
6144
 
6145
 
6146
  static bool classof(const Attr *A) { return A->getKind() == attr::MustTail; }
6147
};
6148
 
6149
class NSConsumedAttr : public InheritableParamAttr {
6150
public:
6151
  enum Spelling {
6152
    GNU_ns_consumed = 0,
6153
    CXX11_clang_ns_consumed = 1,
6154
    C2x_clang_ns_consumed = 2,
6155
  SpellingNotCalculated = 15
6156
 
6157
  };
6158
 
6159
  // Factory methods
6160
  static NSConsumedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
6161
  static NSConsumedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
6162
  static NSConsumedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6163
  static NSConsumedAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6164
 
6165
  // Constructors
6166
  NSConsumedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
6167
             );
6168
 
6169
  NSConsumedAttr *clone(ASTContext &C) const;
6170
  void printPretty(raw_ostream &OS,
6171
                   const PrintingPolicy &Policy) const;
6172
  const char *getSpelling() const;
6173
 
6174
 
6175
  static bool classof(const Attr *A) { return A->getKind() == attr::NSConsumed; }
6176
};
6177
 
6178
class NSConsumesSelfAttr : public InheritableAttr {
6179
public:
6180
  enum Spelling {
6181
    GNU_ns_consumes_self = 0,
6182
    CXX11_clang_ns_consumes_self = 1,
6183
    C2x_clang_ns_consumes_self = 2,
6184
  SpellingNotCalculated = 15
6185
 
6186
  };
6187
 
6188
  // Factory methods
6189
  static NSConsumesSelfAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
6190
  static NSConsumesSelfAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
6191
  static NSConsumesSelfAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6192
  static NSConsumesSelfAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6193
 
6194
  // Constructors
6195
  NSConsumesSelfAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
6196
             );
6197
 
6198
  NSConsumesSelfAttr *clone(ASTContext &C) const;
6199
  void printPretty(raw_ostream &OS,
6200
                   const PrintingPolicy &Policy) const;
6201
  const char *getSpelling() const;
6202
 
6203
 
6204
  static bool classof(const Attr *A) { return A->getKind() == attr::NSConsumesSelf; }
6205
};
6206
 
6207
class NSErrorDomainAttr : public InheritableAttr {
6208
VarDecl * errorDomain;
6209
 
6210
public:
6211
  // Factory methods
6212
  static NSErrorDomainAttr *CreateImplicit(ASTContext &Ctx, VarDecl * ErrorDomain, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
6213
  static NSErrorDomainAttr *Create(ASTContext &Ctx, VarDecl * ErrorDomain, const AttributeCommonInfo &CommonInfo);
6214
  static NSErrorDomainAttr *CreateImplicit(ASTContext &Ctx, VarDecl * ErrorDomain, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6215
  static NSErrorDomainAttr *Create(ASTContext &Ctx, VarDecl * ErrorDomain, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6216
 
6217
  // Constructors
6218
  NSErrorDomainAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
6219
              , VarDecl * ErrorDomain
6220
             );
6221
 
6222
  NSErrorDomainAttr *clone(ASTContext &C) const;
6223
  void printPretty(raw_ostream &OS,
6224
                   const PrintingPolicy &Policy) const;
6225
  const char *getSpelling() const;
6226
  VarDecl * getErrorDomain() const {
6227
    return errorDomain;
6228
  }
6229
 
6230
 
6231
 
6232
  static bool classof(const Attr *A) { return A->getKind() == attr::NSErrorDomain; }
6233
};
6234
 
6235
class NSReturnsAutoreleasedAttr : public InheritableAttr {
6236
public:
6237
  enum Spelling {
6238
    GNU_ns_returns_autoreleased = 0,
6239
    CXX11_clang_ns_returns_autoreleased = 1,
6240
    C2x_clang_ns_returns_autoreleased = 2,
6241
  SpellingNotCalculated = 15
6242
 
6243
  };
6244
 
6245
  // Factory methods
6246
  static NSReturnsAutoreleasedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
6247
  static NSReturnsAutoreleasedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
6248
  static NSReturnsAutoreleasedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6249
  static NSReturnsAutoreleasedAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6250
 
6251
  // Constructors
6252
  NSReturnsAutoreleasedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
6253
             );
6254
 
6255
  NSReturnsAutoreleasedAttr *clone(ASTContext &C) const;
6256
  void printPretty(raw_ostream &OS,
6257
                   const PrintingPolicy &Policy) const;
6258
  const char *getSpelling() const;
6259
 
6260
 
6261
  static bool classof(const Attr *A) { return A->getKind() == attr::NSReturnsAutoreleased; }
6262
};
6263
 
6264
class NSReturnsNotRetainedAttr : public InheritableAttr {
6265
public:
6266
  enum Spelling {
6267
    GNU_ns_returns_not_retained = 0,
6268
    CXX11_clang_ns_returns_not_retained = 1,
6269
    C2x_clang_ns_returns_not_retained = 2,
6270
  SpellingNotCalculated = 15
6271
 
6272
  };
6273
 
6274
  // Factory methods
6275
  static NSReturnsNotRetainedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
6276
  static NSReturnsNotRetainedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
6277
  static NSReturnsNotRetainedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6278
  static NSReturnsNotRetainedAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6279
 
6280
  // Constructors
6281
  NSReturnsNotRetainedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
6282
             );
6283
 
6284
  NSReturnsNotRetainedAttr *clone(ASTContext &C) const;
6285
  void printPretty(raw_ostream &OS,
6286
                   const PrintingPolicy &Policy) const;
6287
  const char *getSpelling() const;
6288
 
6289
 
6290
  static bool classof(const Attr *A) { return A->getKind() == attr::NSReturnsNotRetained; }
6291
};
6292
 
6293
class NSReturnsRetainedAttr : public InheritableAttr {
6294
public:
6295
  enum Spelling {
6296
    GNU_ns_returns_retained = 0,
6297
    CXX11_clang_ns_returns_retained = 1,
6298
    C2x_clang_ns_returns_retained = 2,
6299
  SpellingNotCalculated = 15
6300
 
6301
  };
6302
 
6303
  // Factory methods
6304
  static NSReturnsRetainedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
6305
  static NSReturnsRetainedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
6306
  static NSReturnsRetainedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6307
  static NSReturnsRetainedAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6308
 
6309
  // Constructors
6310
  NSReturnsRetainedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
6311
             );
6312
 
6313
  NSReturnsRetainedAttr *clone(ASTContext &C) const;
6314
  void printPretty(raw_ostream &OS,
6315
                   const PrintingPolicy &Policy) const;
6316
  const char *getSpelling() const;
6317
 
6318
 
6319
  static bool classof(const Attr *A) { return A->getKind() == attr::NSReturnsRetained; }
6320
};
6321
 
6322
class NakedAttr : public InheritableAttr {
6323
public:
6324
  enum Spelling {
6325
    GNU_naked = 0,
6326
    CXX11_gnu_naked = 1,
6327
    C2x_gnu_naked = 2,
6328
    Declspec_naked = 3,
6329
  SpellingNotCalculated = 15
6330
 
6331
  };
6332
 
6333
  // Factory methods
6334
  static NakedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
6335
  static NakedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
6336
  static NakedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6337
  static NakedAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6338
 
6339
  // Constructors
6340
  NakedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
6341
             );
6342
 
6343
  NakedAttr *clone(ASTContext &C) const;
6344
  void printPretty(raw_ostream &OS,
6345
                   const PrintingPolicy &Policy) const;
6346
  const char *getSpelling() const;
6347
 
6348
 
6349
  static bool classof(const Attr *A) { return A->getKind() == attr::Naked; }
6350
};
6351
 
6352
class NoAliasAttr : public InheritableAttr {
6353
public:
6354
  // Factory methods
6355
  static NoAliasAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
6356
  static NoAliasAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
6357
  static NoAliasAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6358
  static NoAliasAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6359
 
6360
  // Constructors
6361
  NoAliasAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
6362
             );
6363
 
6364
  NoAliasAttr *clone(ASTContext &C) const;
6365
  void printPretty(raw_ostream &OS,
6366
                   const PrintingPolicy &Policy) const;
6367
  const char *getSpelling() const;
6368
 
6369
 
6370
  static bool classof(const Attr *A) { return A->getKind() == attr::NoAlias; }
6371
};
6372
 
6373
class NoBuiltinAttr : public Attr {
6374
  unsigned builtinNames_Size;
6375
  StringRef *builtinNames_;
6376
 
6377
public:
6378
  enum Spelling {
6379
    GNU_no_builtin = 0,
6380
    CXX11_clang_no_builtin = 1,
6381
    C2x_clang_no_builtin = 2,
6382
  SpellingNotCalculated = 15
6383
 
6384
  };
6385
 
6386
  // Factory methods
6387
  static NoBuiltinAttr *CreateImplicit(ASTContext &Ctx, StringRef *BuiltinNames, unsigned BuiltinNamesSize, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
6388
  static NoBuiltinAttr *Create(ASTContext &Ctx, StringRef *BuiltinNames, unsigned BuiltinNamesSize, const AttributeCommonInfo &CommonInfo);
6389
  static NoBuiltinAttr *CreateImplicit(ASTContext &Ctx, StringRef *BuiltinNames, unsigned BuiltinNamesSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6390
  static NoBuiltinAttr *Create(ASTContext &Ctx, StringRef *BuiltinNames, unsigned BuiltinNamesSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6391
 
6392
  // Constructors
6393
  NoBuiltinAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
6394
              , StringRef *BuiltinNames, unsigned BuiltinNamesSize
6395
             );
6396
  NoBuiltinAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
6397
             );
6398
 
6399
  NoBuiltinAttr *clone(ASTContext &C) const;
6400
  void printPretty(raw_ostream &OS,
6401
                   const PrintingPolicy &Policy) const;
6402
  const char *getSpelling() const;
6403
  typedef StringRef* builtinNames_iterator;
6404
  builtinNames_iterator builtinNames_begin() const { return builtinNames_; }
6405
  builtinNames_iterator builtinNames_end() const { return builtinNames_ + builtinNames_Size; }
6406
  unsigned builtinNames_size() const { return builtinNames_Size; }
6407
  llvm::iterator_range<builtinNames_iterator> builtinNames() const { return llvm::make_range(builtinNames_begin(), builtinNames_end()); }
6408
 
6409
 
6410
 
6411
 
6412
  static bool classof(const Attr *A) { return A->getKind() == attr::NoBuiltin; }
6413
};
6414
 
6415
class NoCommonAttr : public InheritableAttr {
6416
public:
6417
  enum Spelling {
6418
    GNU_nocommon = 0,
6419
    CXX11_gnu_nocommon = 1,
6420
    C2x_gnu_nocommon = 2,
6421
  SpellingNotCalculated = 15
6422
 
6423
  };
6424
 
6425
  // Factory methods
6426
  static NoCommonAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
6427
  static NoCommonAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
6428
  static NoCommonAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6429
  static NoCommonAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6430
 
6431
  // Constructors
6432
  NoCommonAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
6433
             );
6434
 
6435
  NoCommonAttr *clone(ASTContext &C) const;
6436
  void printPretty(raw_ostream &OS,
6437
                   const PrintingPolicy &Policy) const;
6438
  const char *getSpelling() const;
6439
 
6440
 
6441
  static bool classof(const Attr *A) { return A->getKind() == attr::NoCommon; }
6442
};
6443
 
6444
class NoDebugAttr : public InheritableAttr {
6445
public:
6446
  enum Spelling {
6447
    GNU_nodebug = 0,
6448
    CXX11_gnu_nodebug = 1,
6449
    C2x_gnu_nodebug = 2,
6450
  SpellingNotCalculated = 15
6451
 
6452
  };
6453
 
6454
  // Factory methods
6455
  static NoDebugAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
6456
  static NoDebugAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
6457
  static NoDebugAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6458
  static NoDebugAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6459
 
6460
  // Constructors
6461
  NoDebugAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
6462
             );
6463
 
6464
  NoDebugAttr *clone(ASTContext &C) const;
6465
  void printPretty(raw_ostream &OS,
6466
                   const PrintingPolicy &Policy) const;
6467
  const char *getSpelling() const;
6468
 
6469
 
6470
  static bool classof(const Attr *A) { return A->getKind() == attr::NoDebug; }
6471
};
6472
 
6473
class NoDerefAttr : public TypeAttr {
6474
public:
6475
  enum Spelling {
6476
    GNU_noderef = 0,
6477
    CXX11_clang_noderef = 1,
6478
    C2x_clang_noderef = 2,
6479
  SpellingNotCalculated = 15
6480
 
6481
  };
6482
 
6483
  // Factory methods
6484
  static NoDerefAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
6485
  static NoDerefAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
6486
  static NoDerefAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6487
  static NoDerefAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6488
 
6489
  // Constructors
6490
  NoDerefAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
6491
             );
6492
 
6493
  NoDerefAttr *clone(ASTContext &C) const;
6494
  void printPretty(raw_ostream &OS,
6495
                   const PrintingPolicy &Policy) const;
6496
  const char *getSpelling() const;
6497
 
6498
 
6499
  static bool classof(const Attr *A) { return A->getKind() == attr::NoDeref; }
6500
};
6501
 
6502
class NoDestroyAttr : public InheritableAttr {
6503
public:
6504
  enum Spelling {
6505
    GNU_no_destroy = 0,
6506
    CXX11_clang_no_destroy = 1,
6507
  SpellingNotCalculated = 15
6508
 
6509
  };
6510
 
6511
  // Factory methods
6512
  static NoDestroyAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
6513
  static NoDestroyAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
6514
  static NoDestroyAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6515
  static NoDestroyAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6516
 
6517
  // Constructors
6518
  NoDestroyAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
6519
             );
6520
 
6521
  NoDestroyAttr *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::NoDestroy; }
6528
};
6529
 
6530
class NoDuplicateAttr : public InheritableAttr {
6531
public:
6532
  enum Spelling {
6533
    GNU_noduplicate = 0,
6534
    CXX11_clang_noduplicate = 1,
6535
    C2x_clang_noduplicate = 2,
6536
  SpellingNotCalculated = 15
6537
 
6538
  };
6539
 
6540
  // Factory methods
6541
  static NoDuplicateAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
6542
  static NoDuplicateAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
6543
  static NoDuplicateAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6544
  static NoDuplicateAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6545
 
6546
  // Constructors
6547
  NoDuplicateAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
6548
             );
6549
 
6550
  NoDuplicateAttr *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::NoDuplicate; }
6557
};
6558
 
6559
class NoEscapeAttr : public Attr {
6560
public:
6561
  enum Spelling {
6562
    GNU_noescape = 0,
6563
    CXX11_clang_noescape = 1,
6564
    C2x_clang_noescape = 2,
6565
  SpellingNotCalculated = 15
6566
 
6567
  };
6568
 
6569
  // Factory methods
6570
  static NoEscapeAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
6571
  static NoEscapeAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
6572
  static NoEscapeAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6573
  static NoEscapeAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6574
 
6575
  // Constructors
6576
  NoEscapeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
6577
             );
6578
 
6579
  NoEscapeAttr *clone(ASTContext &C) const;
6580
  void printPretty(raw_ostream &OS,
6581
                   const PrintingPolicy &Policy) const;
6582
  const char *getSpelling() const;
6583
 
6584
 
6585
  static bool classof(const Attr *A) { return A->getKind() == attr::NoEscape; }
6586
};
6587
 
6588
class NoInlineAttr : public DeclOrStmtAttr {
6589
public:
6590
  enum Spelling {
6591
    Keyword_noinline = 0,
6592
    GNU_noinline = 1,
6593
    CXX11_gnu_noinline = 2,
6594
    C2x_gnu_noinline = 3,
6595
    CXX11_clang_noinline = 4,
6596
    C2x_clang_noinline = 5,
6597
    Declspec_noinline = 6,
6598
  SpellingNotCalculated = 15
6599
 
6600
  };
6601
 
6602
  // Factory methods
6603
  static NoInlineAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
6604
  static NoInlineAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
6605
  static NoInlineAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6606
  static NoInlineAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6607
 
6608
  // Constructors
6609
  NoInlineAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
6610
             );
6611
 
6612
  NoInlineAttr *clone(ASTContext &C) const;
6613
  void printPretty(raw_ostream &OS,
6614
                   const PrintingPolicy &Policy) const;
6615
  const char *getSpelling() const;
6616
  bool isClangNoInline() const { return getAttributeSpellingListIndex() == 4 ||
6617
    getAttributeSpellingListIndex() == 5; }
6618
 
6619
 
6620
  static bool classof(const Attr *A) { return A->getKind() == attr::NoInline; }
6621
};
6622
 
6623
class NoInstrumentFunctionAttr : public InheritableAttr {
6624
public:
6625
  enum Spelling {
6626
    GNU_no_instrument_function = 0,
6627
    CXX11_gnu_no_instrument_function = 1,
6628
    C2x_gnu_no_instrument_function = 2,
6629
  SpellingNotCalculated = 15
6630
 
6631
  };
6632
 
6633
  // Factory methods
6634
  static NoInstrumentFunctionAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
6635
  static NoInstrumentFunctionAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
6636
  static NoInstrumentFunctionAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6637
  static NoInstrumentFunctionAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6638
 
6639
  // Constructors
6640
  NoInstrumentFunctionAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
6641
             );
6642
 
6643
  NoInstrumentFunctionAttr *clone(ASTContext &C) const;
6644
  void printPretty(raw_ostream &OS,
6645
                   const PrintingPolicy &Policy) const;
6646
  const char *getSpelling() const;
6647
 
6648
 
6649
  static bool classof(const Attr *A) { return A->getKind() == attr::NoInstrumentFunction; }
6650
};
6651
 
6652
class NoMergeAttr : public DeclOrStmtAttr {
6653
public:
6654
  enum Spelling {
6655
    GNU_nomerge = 0,
6656
    CXX11_clang_nomerge = 1,
6657
    C2x_clang_nomerge = 2,
6658
  SpellingNotCalculated = 15
6659
 
6660
  };
6661
 
6662
  // Factory methods
6663
  static NoMergeAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
6664
  static NoMergeAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
6665
  static NoMergeAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6666
  static NoMergeAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6667
 
6668
  // Constructors
6669
  NoMergeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
6670
             );
6671
 
6672
  NoMergeAttr *clone(ASTContext &C) const;
6673
  void printPretty(raw_ostream &OS,
6674
                   const PrintingPolicy &Policy) const;
6675
  const char *getSpelling() const;
6676
 
6677
 
6678
  static bool classof(const Attr *A) { return A->getKind() == attr::NoMerge; }
6679
};
6680
 
6681
class NoMicroMipsAttr : public InheritableAttr {
6682
public:
6683
  enum Spelling {
6684
    GNU_nomicromips = 0,
6685
    CXX11_gnu_nomicromips = 1,
6686
    C2x_gnu_nomicromips = 2,
6687
  SpellingNotCalculated = 15
6688
 
6689
  };
6690
 
6691
  // Factory methods
6692
  static NoMicroMipsAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
6693
  static NoMicroMipsAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
6694
  static NoMicroMipsAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6695
  static NoMicroMipsAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6696
 
6697
  // Constructors
6698
  NoMicroMipsAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
6699
             );
6700
 
6701
  NoMicroMipsAttr *clone(ASTContext &C) const;
6702
  void printPretty(raw_ostream &OS,
6703
                   const PrintingPolicy &Policy) const;
6704
  const char *getSpelling() const;
6705
 
6706
 
6707
  static bool classof(const Attr *A) { return A->getKind() == attr::NoMicroMips; }
6708
};
6709
 
6710
class NoMips16Attr : public InheritableAttr {
6711
public:
6712
  enum Spelling {
6713
    GNU_nomips16 = 0,
6714
    CXX11_gnu_nomips16 = 1,
6715
    C2x_gnu_nomips16 = 2,
6716
  SpellingNotCalculated = 15
6717
 
6718
  };
6719
 
6720
  // Factory methods
6721
  static NoMips16Attr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
6722
  static NoMips16Attr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
6723
  static NoMips16Attr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6724
  static NoMips16Attr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6725
 
6726
  // Constructors
6727
  NoMips16Attr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
6728
             );
6729
 
6730
  NoMips16Attr *clone(ASTContext &C) const;
6731
  void printPretty(raw_ostream &OS,
6732
                   const PrintingPolicy &Policy) const;
6733
  const char *getSpelling() const;
6734
 
6735
 
6736
  static bool classof(const Attr *A) { return A->getKind() == attr::NoMips16; }
6737
};
6738
 
6739
class NoProfileFunctionAttr : public InheritableAttr {
6740
public:
6741
  enum Spelling {
6742
    GNU_no_profile_instrument_function = 0,
6743
    CXX11_gnu_no_profile_instrument_function = 1,
6744
    C2x_gnu_no_profile_instrument_function = 2,
6745
  SpellingNotCalculated = 15
6746
 
6747
  };
6748
 
6749
  // Factory methods
6750
  static NoProfileFunctionAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
6751
  static NoProfileFunctionAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
6752
  static NoProfileFunctionAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6753
  static NoProfileFunctionAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6754
 
6755
  // Constructors
6756
  NoProfileFunctionAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
6757
             );
6758
 
6759
  NoProfileFunctionAttr *clone(ASTContext &C) const;
6760
  void printPretty(raw_ostream &OS,
6761
                   const PrintingPolicy &Policy) const;
6762
  const char *getSpelling() const;
6763
 
6764
 
6765
  static bool classof(const Attr *A) { return A->getKind() == attr::NoProfileFunction; }
6766
};
6767
 
6768
class NoRandomizeLayoutAttr : public InheritableAttr {
6769
public:
6770
  enum Spelling {
6771
    GNU_no_randomize_layout = 0,
6772
    CXX11_gnu_no_randomize_layout = 1,
6773
    C2x_gnu_no_randomize_layout = 2,
6774
  SpellingNotCalculated = 15
6775
 
6776
  };
6777
 
6778
  // Factory methods
6779
  static NoRandomizeLayoutAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
6780
  static NoRandomizeLayoutAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
6781
  static NoRandomizeLayoutAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6782
  static NoRandomizeLayoutAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6783
 
6784
  // Constructors
6785
  NoRandomizeLayoutAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
6786
             );
6787
 
6788
  NoRandomizeLayoutAttr *clone(ASTContext &C) const;
6789
  void printPretty(raw_ostream &OS,
6790
                   const PrintingPolicy &Policy) const;
6791
  const char *getSpelling() const;
6792
 
6793
 
6794
  static bool classof(const Attr *A) { return A->getKind() == attr::NoRandomizeLayout; }
6795
};
6796
 
6797
class NoReturnAttr : public InheritableAttr {
6798
public:
6799
  enum Spelling {
6800
    GNU_noreturn = 0,
6801
    CXX11_gnu_noreturn = 1,
6802
    C2x_gnu_noreturn = 2,
6803
    Declspec_noreturn = 3,
6804
  SpellingNotCalculated = 15
6805
 
6806
  };
6807
 
6808
  // Factory methods
6809
  static NoReturnAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
6810
  static NoReturnAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
6811
  static NoReturnAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6812
  static NoReturnAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6813
 
6814
  // Constructors
6815
  NoReturnAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
6816
             );
6817
 
6818
  NoReturnAttr *clone(ASTContext &C) const;
6819
  void printPretty(raw_ostream &OS,
6820
                   const PrintingPolicy &Policy) const;
6821
  const char *getSpelling() const;
6822
 
6823
 
6824
  static bool classof(const Attr *A) { return A->getKind() == attr::NoReturn; }
6825
};
6826
 
6827
class NoSanitizeAttr : public InheritableAttr {
6828
  unsigned sanitizers_Size;
6829
  StringRef *sanitizers_;
6830
 
6831
public:
6832
  enum Spelling {
6833
    GNU_no_sanitize = 0,
6834
    CXX11_clang_no_sanitize = 1,
6835
    C2x_clang_no_sanitize = 2,
6836
  SpellingNotCalculated = 15
6837
 
6838
  };
6839
 
6840
  // Factory methods
6841
  static NoSanitizeAttr *CreateImplicit(ASTContext &Ctx, StringRef *Sanitizers, unsigned SanitizersSize, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
6842
  static NoSanitizeAttr *Create(ASTContext &Ctx, StringRef *Sanitizers, unsigned SanitizersSize, const AttributeCommonInfo &CommonInfo);
6843
  static NoSanitizeAttr *CreateImplicit(ASTContext &Ctx, StringRef *Sanitizers, unsigned SanitizersSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6844
  static NoSanitizeAttr *Create(ASTContext &Ctx, StringRef *Sanitizers, unsigned SanitizersSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6845
 
6846
  // Constructors
6847
  NoSanitizeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
6848
              , StringRef *Sanitizers, unsigned SanitizersSize
6849
             );
6850
  NoSanitizeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
6851
             );
6852
 
6853
  NoSanitizeAttr *clone(ASTContext &C) const;
6854
  void printPretty(raw_ostream &OS,
6855
                   const PrintingPolicy &Policy) const;
6856
  const char *getSpelling() const;
6857
  typedef StringRef* sanitizers_iterator;
6858
  sanitizers_iterator sanitizers_begin() const { return sanitizers_; }
6859
  sanitizers_iterator sanitizers_end() const { return sanitizers_ + sanitizers_Size; }
6860
  unsigned sanitizers_size() const { return sanitizers_Size; }
6861
  llvm::iterator_range<sanitizers_iterator> sanitizers() const { return llvm::make_range(sanitizers_begin(), sanitizers_end()); }
6862
 
6863
 
6864
 
6865
    SanitizerMask getMask() const {
6866
      SanitizerMask Mask;
6867
      for (auto SanitizerName : sanitizers()) {
6868
        SanitizerMask ParsedMask =
6869
            parseSanitizerValue(SanitizerName, /*AllowGroups=*/true);
6870
        Mask |= expandSanitizerGroups(ParsedMask);
6871
      }
6872
      return Mask;
6873
    }
6874
 
6875
    bool hasCoverage() const {
6876
      return llvm::is_contained(sanitizers(), "coverage");
6877
    }
6878
 
6879
 
6880
  static bool classof(const Attr *A) { return A->getKind() == attr::NoSanitize; }
6881
};
6882
 
6883
class NoSpeculativeLoadHardeningAttr : public InheritableAttr {
6884
public:
6885
  enum Spelling {
6886
    GNU_no_speculative_load_hardening = 0,
6887
    CXX11_clang_no_speculative_load_hardening = 1,
6888
    C2x_clang_no_speculative_load_hardening = 2,
6889
  SpellingNotCalculated = 15
6890
 
6891
  };
6892
 
6893
  // Factory methods
6894
  static NoSpeculativeLoadHardeningAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
6895
  static NoSpeculativeLoadHardeningAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
6896
  static NoSpeculativeLoadHardeningAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6897
  static NoSpeculativeLoadHardeningAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6898
 
6899
  // Constructors
6900
  NoSpeculativeLoadHardeningAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
6901
             );
6902
 
6903
  NoSpeculativeLoadHardeningAttr *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::NoSpeculativeLoadHardening; }
6910
};
6911
 
6912
class NoSplitStackAttr : public InheritableAttr {
6913
public:
6914
  enum Spelling {
6915
    GNU_no_split_stack = 0,
6916
    CXX11_gnu_no_split_stack = 1,
6917
    C2x_gnu_no_split_stack = 2,
6918
  SpellingNotCalculated = 15
6919
 
6920
  };
6921
 
6922
  // Factory methods
6923
  static NoSplitStackAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
6924
  static NoSplitStackAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
6925
  static NoSplitStackAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6926
  static NoSplitStackAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6927
 
6928
  // Constructors
6929
  NoSplitStackAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
6930
             );
6931
 
6932
  NoSplitStackAttr *clone(ASTContext &C) const;
6933
  void printPretty(raw_ostream &OS,
6934
                   const PrintingPolicy &Policy) const;
6935
  const char *getSpelling() const;
6936
 
6937
 
6938
  static bool classof(const Attr *A) { return A->getKind() == attr::NoSplitStack; }
6939
};
6940
 
6941
class NoStackProtectorAttr : public InheritableAttr {
6942
public:
6943
  enum Spelling {
6944
    GNU_no_stack_protector = 0,
6945
    CXX11_clang_no_stack_protector = 1,
6946
    C2x_clang_no_stack_protector = 2,
6947
    Declspec_safebuffers = 3,
6948
  SpellingNotCalculated = 15
6949
 
6950
  };
6951
 
6952
  // Factory methods
6953
  static NoStackProtectorAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
6954
  static NoStackProtectorAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
6955
  static NoStackProtectorAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax, NoStackProtectorAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
6956
  static NoStackProtectorAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax, NoStackProtectorAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
6957
 
6958
  // Constructors
6959
  NoStackProtectorAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
6960
             );
6961
 
6962
  NoStackProtectorAttr *clone(ASTContext &C) const;
6963
  void printPretty(raw_ostream &OS,
6964
                   const PrintingPolicy &Policy) const;
6965
  const char *getSpelling() const;
6966
  Spelling getSemanticSpelling() const;
6967
 
6968
 
6969
  static bool classof(const Attr *A) { return A->getKind() == attr::NoStackProtector; }
6970
};
6971
 
6972
class NoThreadSafetyAnalysisAttr : public InheritableAttr {
6973
public:
6974
  enum Spelling {
6975
    GNU_no_thread_safety_analysis = 0,
6976
    CXX11_clang_no_thread_safety_analysis = 1,
6977
    C2x_clang_no_thread_safety_analysis = 2,
6978
  SpellingNotCalculated = 15
6979
 
6980
  };
6981
 
6982
  // Factory methods
6983
  static NoThreadSafetyAnalysisAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
6984
  static NoThreadSafetyAnalysisAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
6985
  static NoThreadSafetyAnalysisAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6986
  static NoThreadSafetyAnalysisAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
6987
 
6988
  // Constructors
6989
  NoThreadSafetyAnalysisAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
6990
             );
6991
 
6992
  NoThreadSafetyAnalysisAttr *clone(ASTContext &C) const;
6993
  void printPretty(raw_ostream &OS,
6994
                   const PrintingPolicy &Policy) const;
6995
  const char *getSpelling() const;
6996
 
6997
 
6998
  static bool classof(const Attr *A) { return A->getKind() == attr::NoThreadSafetyAnalysis; }
6999
};
7000
 
7001
class NoThrowAttr : public InheritableAttr {
7002
public:
7003
  enum Spelling {
7004
    GNU_nothrow = 0,
7005
    CXX11_gnu_nothrow = 1,
7006
    C2x_gnu_nothrow = 2,
7007
    Declspec_nothrow = 3,
7008
  SpellingNotCalculated = 15
7009
 
7010
  };
7011
 
7012
  // Factory methods
7013
  static NoThrowAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
7014
  static NoThrowAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
7015
  static NoThrowAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7016
  static NoThrowAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7017
 
7018
  // Constructors
7019
  NoThrowAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
7020
             );
7021
 
7022
  NoThrowAttr *clone(ASTContext &C) const;
7023
  void printPretty(raw_ostream &OS,
7024
                   const PrintingPolicy &Policy) const;
7025
  const char *getSpelling() const;
7026
 
7027
 
7028
  static bool classof(const Attr *A) { return A->getKind() == attr::NoThrow; }
7029
};
7030
 
7031
class NoUniqueAddressAttr : public InheritableAttr {
7032
public:
7033
  // Factory methods
7034
  static NoUniqueAddressAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
7035
  static NoUniqueAddressAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
7036
  static NoUniqueAddressAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7037
  static NoUniqueAddressAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7038
 
7039
  // Constructors
7040
  NoUniqueAddressAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
7041
             );
7042
 
7043
  NoUniqueAddressAttr *clone(ASTContext &C) const;
7044
  void printPretty(raw_ostream &OS,
7045
                   const PrintingPolicy &Policy) const;
7046
  const char *getSpelling() const;
7047
 
7048
 
7049
  static bool classof(const Attr *A) { return A->getKind() == attr::NoUniqueAddress; }
7050
};
7051
 
7052
class NoUwtableAttr : public InheritableAttr {
7053
public:
7054
  enum Spelling {
7055
    GNU_nouwtable = 0,
7056
    CXX11_clang_nouwtable = 1,
7057
    C2x_clang_nouwtable = 2,
7058
  SpellingNotCalculated = 15
7059
 
7060
  };
7061
 
7062
  // Factory methods
7063
  static NoUwtableAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
7064
  static NoUwtableAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
7065
  static NoUwtableAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7066
  static NoUwtableAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7067
 
7068
  // Constructors
7069
  NoUwtableAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
7070
             );
7071
 
7072
  NoUwtableAttr *clone(ASTContext &C) const;
7073
  void printPretty(raw_ostream &OS,
7074
                   const PrintingPolicy &Policy) const;
7075
  const char *getSpelling() const;
7076
 
7077
 
7078
  static bool classof(const Attr *A) { return A->getKind() == attr::NoUwtable; }
7079
};
7080
 
7081
class NonNullAttr : public InheritableParamAttr {
7082
  unsigned args_Size;
7083
  ParamIdx *args_;
7084
 
7085
public:
7086
  enum Spelling {
7087
    GNU_nonnull = 0,
7088
    CXX11_gnu_nonnull = 1,
7089
    C2x_gnu_nonnull = 2,
7090
  SpellingNotCalculated = 15
7091
 
7092
  };
7093
 
7094
  // Factory methods
7095
  static NonNullAttr *CreateImplicit(ASTContext &Ctx, ParamIdx *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
7096
  static NonNullAttr *Create(ASTContext &Ctx, ParamIdx *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo);
7097
  static NonNullAttr *CreateImplicit(ASTContext &Ctx, ParamIdx *Args, unsigned ArgsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7098
  static NonNullAttr *Create(ASTContext &Ctx, ParamIdx *Args, unsigned ArgsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7099
 
7100
  // Constructors
7101
  NonNullAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
7102
              , ParamIdx *Args, unsigned ArgsSize
7103
             );
7104
  NonNullAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
7105
             );
7106
 
7107
  NonNullAttr *clone(ASTContext &C) const;
7108
  void printPretty(raw_ostream &OS,
7109
                   const PrintingPolicy &Policy) const;
7110
  const char *getSpelling() const;
7111
  typedef ParamIdx* args_iterator;
7112
  args_iterator args_begin() const { return args_; }
7113
  args_iterator args_end() const { return args_ + args_Size; }
7114
  unsigned args_size() const { return args_Size; }
7115
  llvm::iterator_range<args_iterator> args() const { return llvm::make_range(args_begin(), args_end()); }
7116
 
7117
 
7118
 
7119
    bool isNonNull(unsigned IdxAST) const {
7120
      if (!args_size())
7121
        return true;
7122
      return llvm::any_of(args(), [=](const ParamIdx &Idx) {
7123
        return Idx.getASTIndex() == IdxAST;
7124
      });
7125
    }
7126
 
7127
 
7128
  static bool classof(const Attr *A) { return A->getKind() == attr::NonNull; }
7129
};
7130
 
7131
class NotTailCalledAttr : public InheritableAttr {
7132
public:
7133
  enum Spelling {
7134
    GNU_not_tail_called = 0,
7135
    CXX11_clang_not_tail_called = 1,
7136
    C2x_clang_not_tail_called = 2,
7137
  SpellingNotCalculated = 15
7138
 
7139
  };
7140
 
7141
  // Factory methods
7142
  static NotTailCalledAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
7143
  static NotTailCalledAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
7144
  static NotTailCalledAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7145
  static NotTailCalledAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7146
 
7147
  // Constructors
7148
  NotTailCalledAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
7149
             );
7150
 
7151
  NotTailCalledAttr *clone(ASTContext &C) const;
7152
  void printPretty(raw_ostream &OS,
7153
                   const PrintingPolicy &Policy) const;
7154
  const char *getSpelling() const;
7155
 
7156
 
7157
  static bool classof(const Attr *A) { return A->getKind() == attr::NotTailCalled; }
7158
};
7159
 
7160
class OMPAllocateDeclAttr : public InheritableAttr {
7161
public:
7162
  enum AllocatorTypeTy {
7163
    OMPNullMemAlloc,
7164
    OMPDefaultMemAlloc,
7165
    OMPLargeCapMemAlloc,
7166
    OMPConstMemAlloc,
7167
    OMPHighBWMemAlloc,
7168
    OMPLowLatMemAlloc,
7169
    OMPCGroupMemAlloc,
7170
    OMPPTeamMemAlloc,
7171
    OMPThreadMemAlloc,
7172
    OMPUserDefinedMemAlloc
7173
  };
7174
private:
7175
  AllocatorTypeTy allocatorType;
7176
 
7177
Expr * allocator;
7178
 
7179
Expr * alignment;
7180
 
7181
public:
7182
  // Factory methods
7183
  static OMPAllocateDeclAttr *CreateImplicit(ASTContext &Ctx, AllocatorTypeTy AllocatorType, Expr * Allocator, Expr * Alignment, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
7184
  static OMPAllocateDeclAttr *Create(ASTContext &Ctx, AllocatorTypeTy AllocatorType, Expr * Allocator, Expr * Alignment, const AttributeCommonInfo &CommonInfo);
7185
  static OMPAllocateDeclAttr *CreateImplicit(ASTContext &Ctx, AllocatorTypeTy AllocatorType, Expr * Allocator, Expr * Alignment, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7186
  static OMPAllocateDeclAttr *Create(ASTContext &Ctx, AllocatorTypeTy AllocatorType, Expr * Allocator, Expr * Alignment, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7187
 
7188
  // Constructors
7189
  OMPAllocateDeclAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
7190
              , AllocatorTypeTy AllocatorType
7191
              , Expr * Allocator
7192
              , Expr * Alignment
7193
             );
7194
 
7195
  OMPAllocateDeclAttr *clone(ASTContext &C) const;
7196
  void printPretty(raw_ostream &OS,
7197
                   const PrintingPolicy &Policy) const;
7198
  const char *getSpelling() const;
7199
  AllocatorTypeTy getAllocatorType() const {
7200
    return allocatorType;
7201
  }
7202
 
7203
  static bool ConvertStrToAllocatorTypeTy(StringRef Val, AllocatorTypeTy &Out);
7204
  static const char *ConvertAllocatorTypeTyToStr(AllocatorTypeTy Val);
7205
  Expr * getAllocator() const {
7206
    return allocator;
7207
  }
7208
 
7209
  Expr * getAlignment() const {
7210
    return alignment;
7211
  }
7212
 
7213
 
7214
 
7215
  static bool classof(const Attr *A) { return A->getKind() == attr::OMPAllocateDecl; }
7216
};
7217
 
7218
class OMPCaptureKindAttr : public Attr {
7219
unsigned captureKindVal;
7220
 
7221
public:
7222
  // Factory methods
7223
  static OMPCaptureKindAttr *CreateImplicit(ASTContext &Ctx, unsigned CaptureKindVal, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
7224
  static OMPCaptureKindAttr *Create(ASTContext &Ctx, unsigned CaptureKindVal, const AttributeCommonInfo &CommonInfo);
7225
  static OMPCaptureKindAttr *CreateImplicit(ASTContext &Ctx, unsigned CaptureKindVal, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7226
  static OMPCaptureKindAttr *Create(ASTContext &Ctx, unsigned CaptureKindVal, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7227
 
7228
  // Constructors
7229
  OMPCaptureKindAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
7230
              , unsigned CaptureKindVal
7231
             );
7232
 
7233
  OMPCaptureKindAttr *clone(ASTContext &C) const;
7234
  void printPretty(raw_ostream &OS,
7235
                   const PrintingPolicy &Policy) const;
7236
  const char *getSpelling() const;
7237
  unsigned getCaptureKindVal() const {
7238
    return captureKindVal;
7239
  }
7240
 
7241
 
7242
    llvm::omp::Clause getCaptureKind() const {
7243
      return static_cast<llvm::omp::Clause>(getCaptureKindVal());
7244
    }
7245
 
7246
 
7247
  static bool classof(const Attr *A) { return A->getKind() == attr::OMPCaptureKind; }
7248
};
7249
 
7250
class OMPCaptureNoInitAttr : public InheritableAttr {
7251
public:
7252
  // Factory methods
7253
  static OMPCaptureNoInitAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
7254
  static OMPCaptureNoInitAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
7255
  static OMPCaptureNoInitAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7256
  static OMPCaptureNoInitAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7257
 
7258
  // Constructors
7259
  OMPCaptureNoInitAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
7260
             );
7261
 
7262
  OMPCaptureNoInitAttr *clone(ASTContext &C) const;
7263
  void printPretty(raw_ostream &OS,
7264
                   const PrintingPolicy &Policy) const;
7265
  const char *getSpelling() const;
7266
 
7267
 
7268
  static bool classof(const Attr *A) { return A->getKind() == attr::OMPCaptureNoInit; }
7269
};
7270
 
7271
class OMPDeclareSimdDeclAttr : public Attr {
7272
public:
7273
  enum BranchStateTy {
7274
    BS_Undefined,
7275
    BS_Inbranch,
7276
    BS_Notinbranch
7277
  };
7278
private:
7279
  BranchStateTy branchState;
7280
 
7281
Expr * simdlen;
7282
 
7283
  unsigned uniforms_Size;
7284
  Expr * *uniforms_;
7285
 
7286
  unsigned aligneds_Size;
7287
  Expr * *aligneds_;
7288
 
7289
  unsigned alignments_Size;
7290
  Expr * *alignments_;
7291
 
7292
  unsigned linears_Size;
7293
  Expr * *linears_;
7294
 
7295
  unsigned modifiers_Size;
7296
  unsigned *modifiers_;
7297
 
7298
  unsigned steps_Size;
7299
  Expr * *steps_;
7300
 
7301
public:
7302
  // Factory methods
7303
  static OMPDeclareSimdDeclAttr *CreateImplicit(ASTContext &Ctx, BranchStateTy BranchState, Expr * Simdlen, Expr * *Uniforms, unsigned UniformsSize, Expr * *Aligneds, unsigned AlignedsSize, Expr * *Alignments, unsigned AlignmentsSize, Expr * *Linears, unsigned LinearsSize, unsigned *Modifiers, unsigned ModifiersSize, Expr * *Steps, unsigned StepsSize, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
7304
  static OMPDeclareSimdDeclAttr *Create(ASTContext &Ctx, BranchStateTy BranchState, Expr * Simdlen, Expr * *Uniforms, unsigned UniformsSize, Expr * *Aligneds, unsigned AlignedsSize, Expr * *Alignments, unsigned AlignmentsSize, Expr * *Linears, unsigned LinearsSize, unsigned *Modifiers, unsigned ModifiersSize, Expr * *Steps, unsigned StepsSize, const AttributeCommonInfo &CommonInfo);
7305
  static OMPDeclareSimdDeclAttr *CreateImplicit(ASTContext &Ctx, BranchStateTy BranchState, Expr * Simdlen, Expr * *Uniforms, unsigned UniformsSize, Expr * *Aligneds, unsigned AlignedsSize, Expr * *Alignments, unsigned AlignmentsSize, Expr * *Linears, unsigned LinearsSize, unsigned *Modifiers, unsigned ModifiersSize, Expr * *Steps, unsigned StepsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7306
  static OMPDeclareSimdDeclAttr *Create(ASTContext &Ctx, BranchStateTy BranchState, Expr * Simdlen, Expr * *Uniforms, unsigned UniformsSize, Expr * *Aligneds, unsigned AlignedsSize, Expr * *Alignments, unsigned AlignmentsSize, Expr * *Linears, unsigned LinearsSize, unsigned *Modifiers, unsigned ModifiersSize, Expr * *Steps, unsigned StepsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7307
 
7308
  // Constructors
7309
  OMPDeclareSimdDeclAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
7310
              , BranchStateTy BranchState
7311
              , Expr * Simdlen
7312
              , Expr * *Uniforms, unsigned UniformsSize
7313
              , Expr * *Aligneds, unsigned AlignedsSize
7314
              , Expr * *Alignments, unsigned AlignmentsSize
7315
              , Expr * *Linears, unsigned LinearsSize
7316
              , unsigned *Modifiers, unsigned ModifiersSize
7317
              , Expr * *Steps, unsigned StepsSize
7318
             );
7319
  OMPDeclareSimdDeclAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
7320
              , BranchStateTy BranchState
7321
              , Expr * Simdlen
7322
             );
7323
 
7324
  OMPDeclareSimdDeclAttr *clone(ASTContext &C) const;
7325
  void printPretty(raw_ostream &OS,
7326
                   const PrintingPolicy &Policy) const;
7327
  const char *getSpelling() const;
7328
  BranchStateTy getBranchState() const {
7329
    return branchState;
7330
  }
7331
 
7332
  static bool ConvertStrToBranchStateTy(StringRef Val, BranchStateTy &Out);
7333
  static const char *ConvertBranchStateTyToStr(BranchStateTy Val);
7334
  Expr * getSimdlen() const {
7335
    return simdlen;
7336
  }
7337
 
7338
  typedef Expr ** uniforms_iterator;
7339
  uniforms_iterator uniforms_begin() const { return uniforms_; }
7340
  uniforms_iterator uniforms_end() const { return uniforms_ + uniforms_Size; }
7341
  unsigned uniforms_size() const { return uniforms_Size; }
7342
  llvm::iterator_range<uniforms_iterator> uniforms() const { return llvm::make_range(uniforms_begin(), uniforms_end()); }
7343
 
7344
 
7345
  typedef Expr ** aligneds_iterator;
7346
  aligneds_iterator aligneds_begin() const { return aligneds_; }
7347
  aligneds_iterator aligneds_end() const { return aligneds_ + aligneds_Size; }
7348
  unsigned aligneds_size() const { return aligneds_Size; }
7349
  llvm::iterator_range<aligneds_iterator> aligneds() const { return llvm::make_range(aligneds_begin(), aligneds_end()); }
7350
 
7351
 
7352
  typedef Expr ** alignments_iterator;
7353
  alignments_iterator alignments_begin() const { return alignments_; }
7354
  alignments_iterator alignments_end() const { return alignments_ + alignments_Size; }
7355
  unsigned alignments_size() const { return alignments_Size; }
7356
  llvm::iterator_range<alignments_iterator> alignments() const { return llvm::make_range(alignments_begin(), alignments_end()); }
7357
 
7358
 
7359
  typedef Expr ** linears_iterator;
7360
  linears_iterator linears_begin() const { return linears_; }
7361
  linears_iterator linears_end() const { return linears_ + linears_Size; }
7362
  unsigned linears_size() const { return linears_Size; }
7363
  llvm::iterator_range<linears_iterator> linears() const { return llvm::make_range(linears_begin(), linears_end()); }
7364
 
7365
 
7366
  typedef unsigned* modifiers_iterator;
7367
  modifiers_iterator modifiers_begin() const { return modifiers_; }
7368
  modifiers_iterator modifiers_end() const { return modifiers_ + modifiers_Size; }
7369
  unsigned modifiers_size() const { return modifiers_Size; }
7370
  llvm::iterator_range<modifiers_iterator> modifiers() const { return llvm::make_range(modifiers_begin(), modifiers_end()); }
7371
 
7372
 
7373
  typedef Expr ** steps_iterator;
7374
  steps_iterator steps_begin() const { return steps_; }
7375
  steps_iterator steps_end() const { return steps_ + steps_Size; }
7376
  unsigned steps_size() const { return steps_Size; }
7377
  llvm::iterator_range<steps_iterator> steps() const { return llvm::make_range(steps_begin(), steps_end()); }
7378
 
7379
 
7380
 
7381
    void printPrettyPragma(raw_ostream & OS, const PrintingPolicy &Policy)
7382
        const;
7383
 
7384
 
7385
  static bool classof(const Attr *A) { return A->getKind() == attr::OMPDeclareSimdDecl; }
7386
};
7387
 
7388
class OMPDeclareTargetDeclAttr : public InheritableAttr {
7389
public:
7390
  enum MapTypeTy {
7391
    MT_To,
7392
    MT_Enter,
7393
    MT_Link
7394
  };
7395
private:
7396
  MapTypeTy mapType;
7397
 
7398
public:
7399
  enum DevTypeTy {
7400
    DT_Host,
7401
    DT_NoHost,
7402
    DT_Any
7403
  };
7404
private:
7405
  DevTypeTy devType;
7406
 
7407
Expr * indirectExpr;
7408
 
7409
bool indirect;
7410
 
7411
unsigned level;
7412
 
7413
public:
7414
  // Factory methods
7415
  static OMPDeclareTargetDeclAttr *CreateImplicit(ASTContext &Ctx, MapTypeTy MapType, DevTypeTy DevType, Expr * IndirectExpr, bool Indirect, unsigned Level, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
7416
  static OMPDeclareTargetDeclAttr *Create(ASTContext &Ctx, MapTypeTy MapType, DevTypeTy DevType, Expr * IndirectExpr, bool Indirect, unsigned Level, const AttributeCommonInfo &CommonInfo);
7417
  static OMPDeclareTargetDeclAttr *CreateImplicit(ASTContext &Ctx, MapTypeTy MapType, DevTypeTy DevType, Expr * IndirectExpr, bool Indirect, unsigned Level, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7418
  static OMPDeclareTargetDeclAttr *Create(ASTContext &Ctx, MapTypeTy MapType, DevTypeTy DevType, Expr * IndirectExpr, bool Indirect, unsigned Level, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7419
 
7420
  // Constructors
7421
  OMPDeclareTargetDeclAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
7422
              , MapTypeTy MapType
7423
              , DevTypeTy DevType
7424
              , Expr * IndirectExpr
7425
              , bool Indirect
7426
              , unsigned Level
7427
             );
7428
 
7429
  OMPDeclareTargetDeclAttr *clone(ASTContext &C) const;
7430
  void printPretty(raw_ostream &OS,
7431
                   const PrintingPolicy &Policy) const;
7432
  const char *getSpelling() const;
7433
  MapTypeTy getMapType() const {
7434
    return mapType;
7435
  }
7436
 
7437
  static bool ConvertStrToMapTypeTy(StringRef Val, MapTypeTy &Out);
7438
  static const char *ConvertMapTypeTyToStr(MapTypeTy Val);
7439
  DevTypeTy getDevType() const {
7440
    return devType;
7441
  }
7442
 
7443
  static bool ConvertStrToDevTypeTy(StringRef Val, DevTypeTy &Out);
7444
  static const char *ConvertDevTypeTyToStr(DevTypeTy Val);
7445
  Expr * getIndirectExpr() const {
7446
    return indirectExpr;
7447
  }
7448
 
7449
  bool getIndirect() const {
7450
    return indirect;
7451
  }
7452
 
7453
  unsigned getLevel() const {
7454
    return level;
7455
  }
7456
 
7457
 
7458
    void printPrettyPragma(raw_ostream &OS, const PrintingPolicy &Policy) const;
7459
    static std::optional<MapTypeTy>
7460
    isDeclareTargetDeclaration(const ValueDecl *VD);
7461
    static std::optional<OMPDeclareTargetDeclAttr*> getActiveAttr(const ValueDecl *VD);
7462
    static std::optional<DevTypeTy> getDeviceType(const ValueDecl *VD);
7463
    static std::optional<SourceLocation> getLocation(const ValueDecl *VD);
7464
 
7465
 
7466
  static bool classof(const Attr *A) { return A->getKind() == attr::OMPDeclareTargetDecl; }
7467
};
7468
 
7469
class OMPDeclareVariantAttr : public InheritableAttr {
7470
Expr * variantFuncRef;
7471
 
7472
OMPTraitInfo * traitInfos;
7473
 
7474
  unsigned adjustArgsNothing_Size;
7475
  Expr * *adjustArgsNothing_;
7476
 
7477
  unsigned adjustArgsNeedDevicePtr_Size;
7478
  Expr * *adjustArgsNeedDevicePtr_;
7479
 
7480
  unsigned appendArgs_Size;
7481
  OMPInteropInfo *appendArgs_;
7482
 
7483
public:
7484
  // Factory methods
7485
  static OMPDeclareVariantAttr *CreateImplicit(ASTContext &Ctx, Expr * VariantFuncRef, OMPTraitInfo * TraitInfos, Expr * *AdjustArgsNothing, unsigned AdjustArgsNothingSize, Expr * *AdjustArgsNeedDevicePtr, unsigned AdjustArgsNeedDevicePtrSize, OMPInteropInfo *AppendArgs, unsigned AppendArgsSize, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
7486
  static OMPDeclareVariantAttr *Create(ASTContext &Ctx, Expr * VariantFuncRef, OMPTraitInfo * TraitInfos, Expr * *AdjustArgsNothing, unsigned AdjustArgsNothingSize, Expr * *AdjustArgsNeedDevicePtr, unsigned AdjustArgsNeedDevicePtrSize, OMPInteropInfo *AppendArgs, unsigned AppendArgsSize, const AttributeCommonInfo &CommonInfo);
7487
  static OMPDeclareVariantAttr *CreateImplicit(ASTContext &Ctx, Expr * VariantFuncRef, OMPTraitInfo * TraitInfos, Expr * *AdjustArgsNothing, unsigned AdjustArgsNothingSize, Expr * *AdjustArgsNeedDevicePtr, unsigned AdjustArgsNeedDevicePtrSize, OMPInteropInfo *AppendArgs, unsigned AppendArgsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7488
  static OMPDeclareVariantAttr *Create(ASTContext &Ctx, Expr * VariantFuncRef, OMPTraitInfo * TraitInfos, Expr * *AdjustArgsNothing, unsigned AdjustArgsNothingSize, Expr * *AdjustArgsNeedDevicePtr, unsigned AdjustArgsNeedDevicePtrSize, OMPInteropInfo *AppendArgs, unsigned AppendArgsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7489
 
7490
  // Constructors
7491
  OMPDeclareVariantAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
7492
              , Expr * VariantFuncRef
7493
              , OMPTraitInfo * TraitInfos
7494
              , Expr * *AdjustArgsNothing, unsigned AdjustArgsNothingSize
7495
              , Expr * *AdjustArgsNeedDevicePtr, unsigned AdjustArgsNeedDevicePtrSize
7496
              , OMPInteropInfo *AppendArgs, unsigned AppendArgsSize
7497
             );
7498
  OMPDeclareVariantAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
7499
              , Expr * VariantFuncRef
7500
              , OMPTraitInfo * TraitInfos
7501
              , OMPInteropInfo *AppendArgs, unsigned AppendArgsSize
7502
             );
7503
 
7504
  OMPDeclareVariantAttr *clone(ASTContext &C) const;
7505
  void printPretty(raw_ostream &OS,
7506
                   const PrintingPolicy &Policy) const;
7507
  const char *getSpelling() const;
7508
  Expr * getVariantFuncRef() const {
7509
    return variantFuncRef;
7510
  }
7511
 
7512
  OMPTraitInfo * getTraitInfos() const {
7513
    return traitInfos;
7514
  }
7515
 
7516
  typedef Expr ** adjustArgsNothing_iterator;
7517
  adjustArgsNothing_iterator adjustArgsNothing_begin() const { return adjustArgsNothing_; }
7518
  adjustArgsNothing_iterator adjustArgsNothing_end() const { return adjustArgsNothing_ + adjustArgsNothing_Size; }
7519
  unsigned adjustArgsNothing_size() const { return adjustArgsNothing_Size; }
7520
  llvm::iterator_range<adjustArgsNothing_iterator> adjustArgsNothing() const { return llvm::make_range(adjustArgsNothing_begin(), adjustArgsNothing_end()); }
7521
 
7522
 
7523
  typedef Expr ** adjustArgsNeedDevicePtr_iterator;
7524
  adjustArgsNeedDevicePtr_iterator adjustArgsNeedDevicePtr_begin() const { return adjustArgsNeedDevicePtr_; }
7525
  adjustArgsNeedDevicePtr_iterator adjustArgsNeedDevicePtr_end() const { return adjustArgsNeedDevicePtr_ + adjustArgsNeedDevicePtr_Size; }
7526
  unsigned adjustArgsNeedDevicePtr_size() const { return adjustArgsNeedDevicePtr_Size; }
7527
  llvm::iterator_range<adjustArgsNeedDevicePtr_iterator> adjustArgsNeedDevicePtr() const { return llvm::make_range(adjustArgsNeedDevicePtr_begin(), adjustArgsNeedDevicePtr_end()); }
7528
 
7529
 
7530
  typedef OMPInteropInfo* appendArgs_iterator;
7531
  appendArgs_iterator appendArgs_begin() const { return appendArgs_; }
7532
  appendArgs_iterator appendArgs_end() const { return appendArgs_ + appendArgs_Size; }
7533
  unsigned appendArgs_size() const { return appendArgs_Size; }
7534
  llvm::iterator_range<appendArgs_iterator> appendArgs() const { return llvm::make_range(appendArgs_begin(), appendArgs_end()); }
7535
 
7536
 
7537
 
7538
    OMPTraitInfo &getTraitInfo() { return *traitInfos; }
7539
    void printPrettyPragma(raw_ostream & OS, const PrintingPolicy &Policy)
7540
        const;
7541
    static StringRef getInteropTypeString(const OMPInteropInfo *I) {
7542
      if (I->IsTarget && I->IsTargetSync)
7543
        return "target,targetsync";
7544
      if (I->IsTarget)
7545
        return "target";
7546
      return "targetsync";
7547
    }
7548
 
7549
 
7550
  static bool classof(const Attr *A) { return A->getKind() == attr::OMPDeclareVariant; }
7551
};
7552
 
7553
class OMPReferencedVarAttr : public Attr {
7554
Expr * ref;
7555
 
7556
public:
7557
  // Factory methods
7558
  static OMPReferencedVarAttr *CreateImplicit(ASTContext &Ctx, Expr * Ref, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
7559
  static OMPReferencedVarAttr *Create(ASTContext &Ctx, Expr * Ref, const AttributeCommonInfo &CommonInfo);
7560
  static OMPReferencedVarAttr *CreateImplicit(ASTContext &Ctx, Expr * Ref, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7561
  static OMPReferencedVarAttr *Create(ASTContext &Ctx, Expr * Ref, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7562
 
7563
  // Constructors
7564
  OMPReferencedVarAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
7565
              , Expr * Ref
7566
             );
7567
 
7568
  OMPReferencedVarAttr *clone(ASTContext &C) const;
7569
  void printPretty(raw_ostream &OS,
7570
                   const PrintingPolicy &Policy) const;
7571
  const char *getSpelling() const;
7572
  Expr * getRef() const {
7573
    return ref;
7574
  }
7575
 
7576
 
7577
 
7578
  static bool classof(const Attr *A) { return A->getKind() == attr::OMPReferencedVar; }
7579
};
7580
 
7581
class OMPThreadPrivateDeclAttr : public InheritableAttr {
7582
public:
7583
  // Factory methods
7584
  static OMPThreadPrivateDeclAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
7585
  static OMPThreadPrivateDeclAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
7586
  static OMPThreadPrivateDeclAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7587
  static OMPThreadPrivateDeclAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7588
 
7589
  // Constructors
7590
  OMPThreadPrivateDeclAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
7591
             );
7592
 
7593
  OMPThreadPrivateDeclAttr *clone(ASTContext &C) const;
7594
  void printPretty(raw_ostream &OS,
7595
                   const PrintingPolicy &Policy) const;
7596
  const char *getSpelling() const;
7597
 
7598
 
7599
  static bool classof(const Attr *A) { return A->getKind() == attr::OMPThreadPrivateDecl; }
7600
};
7601
 
7602
class OSConsumedAttr : public InheritableParamAttr {
7603
public:
7604
  enum Spelling {
7605
    GNU_os_consumed = 0,
7606
    CXX11_clang_os_consumed = 1,
7607
    C2x_clang_os_consumed = 2,
7608
  SpellingNotCalculated = 15
7609
 
7610
  };
7611
 
7612
  // Factory methods
7613
  static OSConsumedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
7614
  static OSConsumedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
7615
  static OSConsumedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7616
  static OSConsumedAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7617
 
7618
  // Constructors
7619
  OSConsumedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
7620
             );
7621
 
7622
  OSConsumedAttr *clone(ASTContext &C) const;
7623
  void printPretty(raw_ostream &OS,
7624
                   const PrintingPolicy &Policy) const;
7625
  const char *getSpelling() const;
7626
 
7627
 
7628
  static bool classof(const Attr *A) { return A->getKind() == attr::OSConsumed; }
7629
};
7630
 
7631
class OSConsumesThisAttr : public InheritableAttr {
7632
public:
7633
  enum Spelling {
7634
    GNU_os_consumes_this = 0,
7635
    CXX11_clang_os_consumes_this = 1,
7636
    C2x_clang_os_consumes_this = 2,
7637
  SpellingNotCalculated = 15
7638
 
7639
  };
7640
 
7641
  // Factory methods
7642
  static OSConsumesThisAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
7643
  static OSConsumesThisAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
7644
  static OSConsumesThisAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7645
  static OSConsumesThisAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7646
 
7647
  // Constructors
7648
  OSConsumesThisAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
7649
             );
7650
 
7651
  OSConsumesThisAttr *clone(ASTContext &C) const;
7652
  void printPretty(raw_ostream &OS,
7653
                   const PrintingPolicy &Policy) const;
7654
  const char *getSpelling() const;
7655
 
7656
 
7657
  static bool classof(const Attr *A) { return A->getKind() == attr::OSConsumesThis; }
7658
};
7659
 
7660
class OSReturnsNotRetainedAttr : public InheritableAttr {
7661
public:
7662
  enum Spelling {
7663
    GNU_os_returns_not_retained = 0,
7664
    CXX11_clang_os_returns_not_retained = 1,
7665
    C2x_clang_os_returns_not_retained = 2,
7666
  SpellingNotCalculated = 15
7667
 
7668
  };
7669
 
7670
  // Factory methods
7671
  static OSReturnsNotRetainedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
7672
  static OSReturnsNotRetainedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
7673
  static OSReturnsNotRetainedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7674
  static OSReturnsNotRetainedAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7675
 
7676
  // Constructors
7677
  OSReturnsNotRetainedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
7678
             );
7679
 
7680
  OSReturnsNotRetainedAttr *clone(ASTContext &C) const;
7681
  void printPretty(raw_ostream &OS,
7682
                   const PrintingPolicy &Policy) const;
7683
  const char *getSpelling() const;
7684
 
7685
 
7686
  static bool classof(const Attr *A) { return A->getKind() == attr::OSReturnsNotRetained; }
7687
};
7688
 
7689
class OSReturnsRetainedAttr : public InheritableAttr {
7690
public:
7691
  enum Spelling {
7692
    GNU_os_returns_retained = 0,
7693
    CXX11_clang_os_returns_retained = 1,
7694
    C2x_clang_os_returns_retained = 2,
7695
  SpellingNotCalculated = 15
7696
 
7697
  };
7698
 
7699
  // Factory methods
7700
  static OSReturnsRetainedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
7701
  static OSReturnsRetainedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
7702
  static OSReturnsRetainedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7703
  static OSReturnsRetainedAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7704
 
7705
  // Constructors
7706
  OSReturnsRetainedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
7707
             );
7708
 
7709
  OSReturnsRetainedAttr *clone(ASTContext &C) const;
7710
  void printPretty(raw_ostream &OS,
7711
                   const PrintingPolicy &Policy) const;
7712
  const char *getSpelling() const;
7713
 
7714
 
7715
  static bool classof(const Attr *A) { return A->getKind() == attr::OSReturnsRetained; }
7716
};
7717
 
7718
class OSReturnsRetainedOnNonZeroAttr : public InheritableAttr {
7719
public:
7720
  enum Spelling {
7721
    GNU_os_returns_retained_on_non_zero = 0,
7722
    CXX11_clang_os_returns_retained_on_non_zero = 1,
7723
    C2x_clang_os_returns_retained_on_non_zero = 2,
7724
  SpellingNotCalculated = 15
7725
 
7726
  };
7727
 
7728
  // Factory methods
7729
  static OSReturnsRetainedOnNonZeroAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
7730
  static OSReturnsRetainedOnNonZeroAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
7731
  static OSReturnsRetainedOnNonZeroAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7732
  static OSReturnsRetainedOnNonZeroAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7733
 
7734
  // Constructors
7735
  OSReturnsRetainedOnNonZeroAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
7736
             );
7737
 
7738
  OSReturnsRetainedOnNonZeroAttr *clone(ASTContext &C) const;
7739
  void printPretty(raw_ostream &OS,
7740
                   const PrintingPolicy &Policy) const;
7741
  const char *getSpelling() const;
7742
 
7743
 
7744
  static bool classof(const Attr *A) { return A->getKind() == attr::OSReturnsRetainedOnNonZero; }
7745
};
7746
 
7747
class OSReturnsRetainedOnZeroAttr : public InheritableAttr {
7748
public:
7749
  enum Spelling {
7750
    GNU_os_returns_retained_on_zero = 0,
7751
    CXX11_clang_os_returns_retained_on_zero = 1,
7752
    C2x_clang_os_returns_retained_on_zero = 2,
7753
  SpellingNotCalculated = 15
7754
 
7755
  };
7756
 
7757
  // Factory methods
7758
  static OSReturnsRetainedOnZeroAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
7759
  static OSReturnsRetainedOnZeroAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
7760
  static OSReturnsRetainedOnZeroAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7761
  static OSReturnsRetainedOnZeroAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7762
 
7763
  // Constructors
7764
  OSReturnsRetainedOnZeroAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
7765
             );
7766
 
7767
  OSReturnsRetainedOnZeroAttr *clone(ASTContext &C) const;
7768
  void printPretty(raw_ostream &OS,
7769
                   const PrintingPolicy &Policy) const;
7770
  const char *getSpelling() const;
7771
 
7772
 
7773
  static bool classof(const Attr *A) { return A->getKind() == attr::OSReturnsRetainedOnZero; }
7774
};
7775
 
7776
class ObjCBoxableAttr : public Attr {
7777
public:
7778
  enum Spelling {
7779
    GNU_objc_boxable = 0,
7780
    CXX11_clang_objc_boxable = 1,
7781
    C2x_clang_objc_boxable = 2,
7782
  SpellingNotCalculated = 15
7783
 
7784
  };
7785
 
7786
  // Factory methods
7787
  static ObjCBoxableAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
7788
  static ObjCBoxableAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
7789
  static ObjCBoxableAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7790
  static ObjCBoxableAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7791
 
7792
  // Constructors
7793
  ObjCBoxableAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
7794
             );
7795
 
7796
  ObjCBoxableAttr *clone(ASTContext &C) const;
7797
  void printPretty(raw_ostream &OS,
7798
                   const PrintingPolicy &Policy) const;
7799
  const char *getSpelling() const;
7800
 
7801
 
7802
  static bool classof(const Attr *A) { return A->getKind() == attr::ObjCBoxable; }
7803
};
7804
 
7805
class ObjCBridgeAttr : public InheritableAttr {
7806
IdentifierInfo * bridgedType;
7807
 
7808
public:
7809
  enum Spelling {
7810
    GNU_objc_bridge = 0,
7811
    CXX11_clang_objc_bridge = 1,
7812
    C2x_clang_objc_bridge = 2,
7813
  SpellingNotCalculated = 15
7814
 
7815
  };
7816
 
7817
  // Factory methods
7818
  static ObjCBridgeAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * BridgedType, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
7819
  static ObjCBridgeAttr *Create(ASTContext &Ctx, IdentifierInfo * BridgedType, const AttributeCommonInfo &CommonInfo);
7820
  static ObjCBridgeAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * BridgedType, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7821
  static ObjCBridgeAttr *Create(ASTContext &Ctx, IdentifierInfo * BridgedType, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7822
 
7823
  // Constructors
7824
  ObjCBridgeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
7825
              , IdentifierInfo * BridgedType
7826
             );
7827
 
7828
  ObjCBridgeAttr *clone(ASTContext &C) const;
7829
  void printPretty(raw_ostream &OS,
7830
                   const PrintingPolicy &Policy) const;
7831
  const char *getSpelling() const;
7832
  IdentifierInfo * getBridgedType() const {
7833
    return bridgedType;
7834
  }
7835
 
7836
 
7837
 
7838
  static bool classof(const Attr *A) { return A->getKind() == attr::ObjCBridge; }
7839
};
7840
 
7841
class ObjCBridgeMutableAttr : public InheritableAttr {
7842
IdentifierInfo * bridgedType;
7843
 
7844
public:
7845
  enum Spelling {
7846
    GNU_objc_bridge_mutable = 0,
7847
    CXX11_clang_objc_bridge_mutable = 1,
7848
    C2x_clang_objc_bridge_mutable = 2,
7849
  SpellingNotCalculated = 15
7850
 
7851
  };
7852
 
7853
  // Factory methods
7854
  static ObjCBridgeMutableAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * BridgedType, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
7855
  static ObjCBridgeMutableAttr *Create(ASTContext &Ctx, IdentifierInfo * BridgedType, const AttributeCommonInfo &CommonInfo);
7856
  static ObjCBridgeMutableAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * BridgedType, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7857
  static ObjCBridgeMutableAttr *Create(ASTContext &Ctx, IdentifierInfo * BridgedType, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7858
 
7859
  // Constructors
7860
  ObjCBridgeMutableAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
7861
              , IdentifierInfo * BridgedType
7862
             );
7863
 
7864
  ObjCBridgeMutableAttr *clone(ASTContext &C) const;
7865
  void printPretty(raw_ostream &OS,
7866
                   const PrintingPolicy &Policy) const;
7867
  const char *getSpelling() const;
7868
  IdentifierInfo * getBridgedType() const {
7869
    return bridgedType;
7870
  }
7871
 
7872
 
7873
 
7874
  static bool classof(const Attr *A) { return A->getKind() == attr::ObjCBridgeMutable; }
7875
};
7876
 
7877
class ObjCBridgeRelatedAttr : public InheritableAttr {
7878
IdentifierInfo * relatedClass;
7879
 
7880
IdentifierInfo * classMethod;
7881
 
7882
IdentifierInfo * instanceMethod;
7883
 
7884
public:
7885
  enum Spelling {
7886
    GNU_objc_bridge_related = 0,
7887
    CXX11_clang_objc_bridge_related = 1,
7888
    C2x_clang_objc_bridge_related = 2,
7889
  SpellingNotCalculated = 15
7890
 
7891
  };
7892
 
7893
  // Factory methods
7894
  static ObjCBridgeRelatedAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * RelatedClass, IdentifierInfo * ClassMethod, IdentifierInfo * InstanceMethod, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
7895
  static ObjCBridgeRelatedAttr *Create(ASTContext &Ctx, IdentifierInfo * RelatedClass, IdentifierInfo * ClassMethod, IdentifierInfo * InstanceMethod, const AttributeCommonInfo &CommonInfo);
7896
  static ObjCBridgeRelatedAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * RelatedClass, IdentifierInfo * ClassMethod, IdentifierInfo * InstanceMethod, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7897
  static ObjCBridgeRelatedAttr *Create(ASTContext &Ctx, IdentifierInfo * RelatedClass, IdentifierInfo * ClassMethod, IdentifierInfo * InstanceMethod, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7898
 
7899
  // Constructors
7900
  ObjCBridgeRelatedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
7901
              , IdentifierInfo * RelatedClass
7902
              , IdentifierInfo * ClassMethod
7903
              , IdentifierInfo * InstanceMethod
7904
             );
7905
 
7906
  ObjCBridgeRelatedAttr *clone(ASTContext &C) const;
7907
  void printPretty(raw_ostream &OS,
7908
                   const PrintingPolicy &Policy) const;
7909
  const char *getSpelling() const;
7910
  IdentifierInfo * getRelatedClass() const {
7911
    return relatedClass;
7912
  }
7913
 
7914
  IdentifierInfo * getClassMethod() const {
7915
    return classMethod;
7916
  }
7917
 
7918
  IdentifierInfo * getInstanceMethod() const {
7919
    return instanceMethod;
7920
  }
7921
 
7922
 
7923
 
7924
  static bool classof(const Attr *A) { return A->getKind() == attr::ObjCBridgeRelated; }
7925
};
7926
 
7927
class ObjCClassStubAttr : public Attr {
7928
public:
7929
  enum Spelling {
7930
    GNU_objc_class_stub = 0,
7931
    CXX11_clang_objc_class_stub = 1,
7932
    C2x_clang_objc_class_stub = 2,
7933
  SpellingNotCalculated = 15
7934
 
7935
  };
7936
 
7937
  // Factory methods
7938
  static ObjCClassStubAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
7939
  static ObjCClassStubAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
7940
  static ObjCClassStubAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7941
  static ObjCClassStubAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7942
 
7943
  // Constructors
7944
  ObjCClassStubAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
7945
             );
7946
 
7947
  ObjCClassStubAttr *clone(ASTContext &C) const;
7948
  void printPretty(raw_ostream &OS,
7949
                   const PrintingPolicy &Policy) const;
7950
  const char *getSpelling() const;
7951
 
7952
 
7953
  static bool classof(const Attr *A) { return A->getKind() == attr::ObjCClassStub; }
7954
};
7955
 
7956
class ObjCDesignatedInitializerAttr : public Attr {
7957
public:
7958
  enum Spelling {
7959
    GNU_objc_designated_initializer = 0,
7960
    CXX11_clang_objc_designated_initializer = 1,
7961
    C2x_clang_objc_designated_initializer = 2,
7962
  SpellingNotCalculated = 15
7963
 
7964
  };
7965
 
7966
  // Factory methods
7967
  static ObjCDesignatedInitializerAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
7968
  static ObjCDesignatedInitializerAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
7969
  static ObjCDesignatedInitializerAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7970
  static ObjCDesignatedInitializerAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7971
 
7972
  // Constructors
7973
  ObjCDesignatedInitializerAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
7974
             );
7975
 
7976
  ObjCDesignatedInitializerAttr *clone(ASTContext &C) const;
7977
  void printPretty(raw_ostream &OS,
7978
                   const PrintingPolicy &Policy) const;
7979
  const char *getSpelling() const;
7980
 
7981
 
7982
  static bool classof(const Attr *A) { return A->getKind() == attr::ObjCDesignatedInitializer; }
7983
};
7984
 
7985
class ObjCDirectAttr : public Attr {
7986
public:
7987
  enum Spelling {
7988
    GNU_objc_direct = 0,
7989
    CXX11_clang_objc_direct = 1,
7990
    C2x_clang_objc_direct = 2,
7991
  SpellingNotCalculated = 15
7992
 
7993
  };
7994
 
7995
  // Factory methods
7996
  static ObjCDirectAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
7997
  static ObjCDirectAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
7998
  static ObjCDirectAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
7999
  static ObjCDirectAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8000
 
8001
  // Constructors
8002
  ObjCDirectAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
8003
             );
8004
 
8005
  ObjCDirectAttr *clone(ASTContext &C) const;
8006
  void printPretty(raw_ostream &OS,
8007
                   const PrintingPolicy &Policy) const;
8008
  const char *getSpelling() const;
8009
 
8010
 
8011
  static bool classof(const Attr *A) { return A->getKind() == attr::ObjCDirect; }
8012
};
8013
 
8014
class ObjCDirectMembersAttr : public Attr {
8015
public:
8016
  enum Spelling {
8017
    GNU_objc_direct_members = 0,
8018
    CXX11_clang_objc_direct_members = 1,
8019
    C2x_clang_objc_direct_members = 2,
8020
  SpellingNotCalculated = 15
8021
 
8022
  };
8023
 
8024
  // Factory methods
8025
  static ObjCDirectMembersAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
8026
  static ObjCDirectMembersAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
8027
  static ObjCDirectMembersAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8028
  static ObjCDirectMembersAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8029
 
8030
  // Constructors
8031
  ObjCDirectMembersAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
8032
             );
8033
 
8034
  ObjCDirectMembersAttr *clone(ASTContext &C) const;
8035
  void printPretty(raw_ostream &OS,
8036
                   const PrintingPolicy &Policy) const;
8037
  const char *getSpelling() const;
8038
 
8039
 
8040
  static bool classof(const Attr *A) { return A->getKind() == attr::ObjCDirectMembers; }
8041
};
8042
 
8043
class ObjCExceptionAttr : public InheritableAttr {
8044
public:
8045
  enum Spelling {
8046
    GNU_objc_exception = 0,
8047
    CXX11_clang_objc_exception = 1,
8048
    C2x_clang_objc_exception = 2,
8049
  SpellingNotCalculated = 15
8050
 
8051
  };
8052
 
8053
  // Factory methods
8054
  static ObjCExceptionAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
8055
  static ObjCExceptionAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
8056
  static ObjCExceptionAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8057
  static ObjCExceptionAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8058
 
8059
  // Constructors
8060
  ObjCExceptionAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
8061
             );
8062
 
8063
  ObjCExceptionAttr *clone(ASTContext &C) const;
8064
  void printPretty(raw_ostream &OS,
8065
                   const PrintingPolicy &Policy) const;
8066
  const char *getSpelling() const;
8067
 
8068
 
8069
  static bool classof(const Attr *A) { return A->getKind() == attr::ObjCException; }
8070
};
8071
 
8072
class ObjCExplicitProtocolImplAttr : public InheritableAttr {
8073
public:
8074
  enum Spelling {
8075
    GNU_objc_protocol_requires_explicit_implementation = 0,
8076
    CXX11_clang_objc_protocol_requires_explicit_implementation = 1,
8077
    C2x_clang_objc_protocol_requires_explicit_implementation = 2,
8078
  SpellingNotCalculated = 15
8079
 
8080
  };
8081
 
8082
  // Factory methods
8083
  static ObjCExplicitProtocolImplAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
8084
  static ObjCExplicitProtocolImplAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
8085
  static ObjCExplicitProtocolImplAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8086
  static ObjCExplicitProtocolImplAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8087
 
8088
  // Constructors
8089
  ObjCExplicitProtocolImplAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
8090
             );
8091
 
8092
  ObjCExplicitProtocolImplAttr *clone(ASTContext &C) const;
8093
  void printPretty(raw_ostream &OS,
8094
                   const PrintingPolicy &Policy) const;
8095
  const char *getSpelling() const;
8096
 
8097
 
8098
  static bool classof(const Attr *A) { return A->getKind() == attr::ObjCExplicitProtocolImpl; }
8099
};
8100
 
8101
class ObjCExternallyRetainedAttr : public InheritableAttr {
8102
public:
8103
  enum Spelling {
8104
    GNU_objc_externally_retained = 0,
8105
    CXX11_clang_objc_externally_retained = 1,
8106
    C2x_clang_objc_externally_retained = 2,
8107
  SpellingNotCalculated = 15
8108
 
8109
  };
8110
 
8111
  // Factory methods
8112
  static ObjCExternallyRetainedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
8113
  static ObjCExternallyRetainedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
8114
  static ObjCExternallyRetainedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8115
  static ObjCExternallyRetainedAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8116
 
8117
  // Constructors
8118
  ObjCExternallyRetainedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
8119
             );
8120
 
8121
  ObjCExternallyRetainedAttr *clone(ASTContext &C) const;
8122
  void printPretty(raw_ostream &OS,
8123
                   const PrintingPolicy &Policy) const;
8124
  const char *getSpelling() const;
8125
 
8126
 
8127
  static bool classof(const Attr *A) { return A->getKind() == attr::ObjCExternallyRetained; }
8128
};
8129
 
8130
class ObjCGCAttr : public TypeAttr {
8131
IdentifierInfo * kind;
8132
 
8133
public:
8134
  enum Spelling {
8135
    GNU_objc_gc = 0,
8136
    CXX11_clang_objc_gc = 1,
8137
    C2x_clang_objc_gc = 2,
8138
  SpellingNotCalculated = 15
8139
 
8140
  };
8141
 
8142
  // Factory methods
8143
  static ObjCGCAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * Kind, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
8144
  static ObjCGCAttr *Create(ASTContext &Ctx, IdentifierInfo * Kind, const AttributeCommonInfo &CommonInfo);
8145
  static ObjCGCAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * Kind, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8146
  static ObjCGCAttr *Create(ASTContext &Ctx, IdentifierInfo * Kind, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8147
 
8148
  // Constructors
8149
  ObjCGCAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
8150
              , IdentifierInfo * Kind
8151
             );
8152
 
8153
  ObjCGCAttr *clone(ASTContext &C) const;
8154
  void printPretty(raw_ostream &OS,
8155
                   const PrintingPolicy &Policy) const;
8156
  const char *getSpelling() const;
8157
  IdentifierInfo * getKind() const {
8158
    return kind;
8159
  }
8160
 
8161
 
8162
 
8163
  static bool classof(const Attr *A) { return A->getKind() == attr::ObjCGC; }
8164
};
8165
 
8166
class ObjCIndependentClassAttr : public InheritableAttr {
8167
public:
8168
  enum Spelling {
8169
    GNU_objc_independent_class = 0,
8170
    CXX11_clang_objc_independent_class = 1,
8171
    C2x_clang_objc_independent_class = 2,
8172
  SpellingNotCalculated = 15
8173
 
8174
  };
8175
 
8176
  // Factory methods
8177
  static ObjCIndependentClassAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
8178
  static ObjCIndependentClassAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
8179
  static ObjCIndependentClassAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8180
  static ObjCIndependentClassAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8181
 
8182
  // Constructors
8183
  ObjCIndependentClassAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
8184
             );
8185
 
8186
  ObjCIndependentClassAttr *clone(ASTContext &C) const;
8187
  void printPretty(raw_ostream &OS,
8188
                   const PrintingPolicy &Policy) const;
8189
  const char *getSpelling() const;
8190
 
8191
 
8192
  static bool classof(const Attr *A) { return A->getKind() == attr::ObjCIndependentClass; }
8193
};
8194
 
8195
class ObjCInertUnsafeUnretainedAttr : public TypeAttr {
8196
public:
8197
  // Factory methods
8198
  static ObjCInertUnsafeUnretainedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
8199
  static ObjCInertUnsafeUnretainedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
8200
  static ObjCInertUnsafeUnretainedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8201
  static ObjCInertUnsafeUnretainedAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8202
 
8203
  // Constructors
8204
  ObjCInertUnsafeUnretainedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
8205
             );
8206
 
8207
  ObjCInertUnsafeUnretainedAttr *clone(ASTContext &C) const;
8208
  void printPretty(raw_ostream &OS,
8209
                   const PrintingPolicy &Policy) const;
8210
  const char *getSpelling() const;
8211
 
8212
 
8213
  static bool classof(const Attr *A) { return A->getKind() == attr::ObjCInertUnsafeUnretained; }
8214
};
8215
 
8216
class ObjCKindOfAttr : public TypeAttr {
8217
public:
8218
  // Factory methods
8219
  static ObjCKindOfAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
8220
  static ObjCKindOfAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
8221
  static ObjCKindOfAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8222
  static ObjCKindOfAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8223
 
8224
  // Constructors
8225
  ObjCKindOfAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
8226
             );
8227
 
8228
  ObjCKindOfAttr *clone(ASTContext &C) const;
8229
  void printPretty(raw_ostream &OS,
8230
                   const PrintingPolicy &Policy) const;
8231
  const char *getSpelling() const;
8232
 
8233
 
8234
  static bool classof(const Attr *A) { return A->getKind() == attr::ObjCKindOf; }
8235
};
8236
 
8237
class ObjCMethodFamilyAttr : public InheritableAttr {
8238
public:
8239
  enum FamilyKind {
8240
    OMF_None,
8241
    OMF_alloc,
8242
    OMF_copy,
8243
    OMF_init,
8244
    OMF_mutableCopy,
8245
    OMF_new
8246
  };
8247
private:
8248
  FamilyKind family;
8249
 
8250
public:
8251
  enum Spelling {
8252
    GNU_objc_method_family = 0,
8253
    CXX11_clang_objc_method_family = 1,
8254
    C2x_clang_objc_method_family = 2,
8255
  SpellingNotCalculated = 15
8256
 
8257
  };
8258
 
8259
  // Factory methods
8260
  static ObjCMethodFamilyAttr *CreateImplicit(ASTContext &Ctx, FamilyKind Family, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
8261
  static ObjCMethodFamilyAttr *Create(ASTContext &Ctx, FamilyKind Family, const AttributeCommonInfo &CommonInfo);
8262
  static ObjCMethodFamilyAttr *CreateImplicit(ASTContext &Ctx, FamilyKind Family, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8263
  static ObjCMethodFamilyAttr *Create(ASTContext &Ctx, FamilyKind Family, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8264
 
8265
  // Constructors
8266
  ObjCMethodFamilyAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
8267
              , FamilyKind Family
8268
             );
8269
 
8270
  ObjCMethodFamilyAttr *clone(ASTContext &C) const;
8271
  void printPretty(raw_ostream &OS,
8272
                   const PrintingPolicy &Policy) const;
8273
  const char *getSpelling() const;
8274
  FamilyKind getFamily() const {
8275
    return family;
8276
  }
8277
 
8278
  static bool ConvertStrToFamilyKind(StringRef Val, FamilyKind &Out);
8279
  static const char *ConvertFamilyKindToStr(FamilyKind Val);
8280
 
8281
 
8282
  static bool classof(const Attr *A) { return A->getKind() == attr::ObjCMethodFamily; }
8283
};
8284
 
8285
class ObjCNSObjectAttr : public InheritableAttr {
8286
public:
8287
  enum Spelling {
8288
    GNU_NSObject = 0,
8289
    CXX11_clang_NSObject = 1,
8290
    C2x_clang_NSObject = 2,
8291
  SpellingNotCalculated = 15
8292
 
8293
  };
8294
 
8295
  // Factory methods
8296
  static ObjCNSObjectAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
8297
  static ObjCNSObjectAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
8298
  static ObjCNSObjectAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8299
  static ObjCNSObjectAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8300
 
8301
  // Constructors
8302
  ObjCNSObjectAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
8303
             );
8304
 
8305
  ObjCNSObjectAttr *clone(ASTContext &C) const;
8306
  void printPretty(raw_ostream &OS,
8307
                   const PrintingPolicy &Policy) const;
8308
  const char *getSpelling() const;
8309
 
8310
 
8311
  static bool classof(const Attr *A) { return A->getKind() == attr::ObjCNSObject; }
8312
};
8313
 
8314
class ObjCNonLazyClassAttr : public Attr {
8315
public:
8316
  enum Spelling {
8317
    GNU_objc_nonlazy_class = 0,
8318
    CXX11_clang_objc_nonlazy_class = 1,
8319
    C2x_clang_objc_nonlazy_class = 2,
8320
  SpellingNotCalculated = 15
8321
 
8322
  };
8323
 
8324
  // Factory methods
8325
  static ObjCNonLazyClassAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
8326
  static ObjCNonLazyClassAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
8327
  static ObjCNonLazyClassAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8328
  static ObjCNonLazyClassAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8329
 
8330
  // Constructors
8331
  ObjCNonLazyClassAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
8332
             );
8333
 
8334
  ObjCNonLazyClassAttr *clone(ASTContext &C) const;
8335
  void printPretty(raw_ostream &OS,
8336
                   const PrintingPolicy &Policy) const;
8337
  const char *getSpelling() const;
8338
 
8339
 
8340
  static bool classof(const Attr *A) { return A->getKind() == attr::ObjCNonLazyClass; }
8341
};
8342
 
8343
class ObjCNonRuntimeProtocolAttr : public Attr {
8344
public:
8345
  enum Spelling {
8346
    GNU_objc_non_runtime_protocol = 0,
8347
    CXX11_clang_objc_non_runtime_protocol = 1,
8348
    C2x_clang_objc_non_runtime_protocol = 2,
8349
  SpellingNotCalculated = 15
8350
 
8351
  };
8352
 
8353
  // Factory methods
8354
  static ObjCNonRuntimeProtocolAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
8355
  static ObjCNonRuntimeProtocolAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
8356
  static ObjCNonRuntimeProtocolAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8357
  static ObjCNonRuntimeProtocolAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8358
 
8359
  // Constructors
8360
  ObjCNonRuntimeProtocolAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
8361
             );
8362
 
8363
  ObjCNonRuntimeProtocolAttr *clone(ASTContext &C) const;
8364
  void printPretty(raw_ostream &OS,
8365
                   const PrintingPolicy &Policy) const;
8366
  const char *getSpelling() const;
8367
 
8368
 
8369
  static bool classof(const Attr *A) { return A->getKind() == attr::ObjCNonRuntimeProtocol; }
8370
};
8371
 
8372
class ObjCOwnershipAttr : public InheritableAttr {
8373
IdentifierInfo * kind;
8374
 
8375
public:
8376
  enum Spelling {
8377
    GNU_objc_ownership = 0,
8378
    CXX11_clang_objc_ownership = 1,
8379
    C2x_clang_objc_ownership = 2,
8380
  SpellingNotCalculated = 15
8381
 
8382
  };
8383
 
8384
  // Factory methods
8385
  static ObjCOwnershipAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * Kind, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
8386
  static ObjCOwnershipAttr *Create(ASTContext &Ctx, IdentifierInfo * Kind, const AttributeCommonInfo &CommonInfo);
8387
  static ObjCOwnershipAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * Kind, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8388
  static ObjCOwnershipAttr *Create(ASTContext &Ctx, IdentifierInfo * Kind, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8389
 
8390
  // Constructors
8391
  ObjCOwnershipAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
8392
              , IdentifierInfo * Kind
8393
             );
8394
 
8395
  ObjCOwnershipAttr *clone(ASTContext &C) const;
8396
  void printPretty(raw_ostream &OS,
8397
                   const PrintingPolicy &Policy) const;
8398
  const char *getSpelling() const;
8399
  IdentifierInfo * getKind() const {
8400
    return kind;
8401
  }
8402
 
8403
 
8404
 
8405
  static bool classof(const Attr *A) { return A->getKind() == attr::ObjCOwnership; }
8406
};
8407
 
8408
class ObjCPreciseLifetimeAttr : public InheritableAttr {
8409
public:
8410
  enum Spelling {
8411
    GNU_objc_precise_lifetime = 0,
8412
    CXX11_clang_objc_precise_lifetime = 1,
8413
    C2x_clang_objc_precise_lifetime = 2,
8414
  SpellingNotCalculated = 15
8415
 
8416
  };
8417
 
8418
  // Factory methods
8419
  static ObjCPreciseLifetimeAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
8420
  static ObjCPreciseLifetimeAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
8421
  static ObjCPreciseLifetimeAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8422
  static ObjCPreciseLifetimeAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8423
 
8424
  // Constructors
8425
  ObjCPreciseLifetimeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
8426
             );
8427
 
8428
  ObjCPreciseLifetimeAttr *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::ObjCPreciseLifetime; }
8435
};
8436
 
8437
class ObjCRequiresPropertyDefsAttr : public InheritableAttr {
8438
public:
8439
  enum Spelling {
8440
    GNU_objc_requires_property_definitions = 0,
8441
    CXX11_clang_objc_requires_property_definitions = 1,
8442
    C2x_clang_objc_requires_property_definitions = 2,
8443
  SpellingNotCalculated = 15
8444
 
8445
  };
8446
 
8447
  // Factory methods
8448
  static ObjCRequiresPropertyDefsAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
8449
  static ObjCRequiresPropertyDefsAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
8450
  static ObjCRequiresPropertyDefsAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8451
  static ObjCRequiresPropertyDefsAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8452
 
8453
  // Constructors
8454
  ObjCRequiresPropertyDefsAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
8455
             );
8456
 
8457
  ObjCRequiresPropertyDefsAttr *clone(ASTContext &C) const;
8458
  void printPretty(raw_ostream &OS,
8459
                   const PrintingPolicy &Policy) const;
8460
  const char *getSpelling() const;
8461
 
8462
 
8463
  static bool classof(const Attr *A) { return A->getKind() == attr::ObjCRequiresPropertyDefs; }
8464
};
8465
 
8466
class ObjCRequiresSuperAttr : public InheritableAttr {
8467
public:
8468
  enum Spelling {
8469
    GNU_objc_requires_super = 0,
8470
    CXX11_clang_objc_requires_super = 1,
8471
    C2x_clang_objc_requires_super = 2,
8472
  SpellingNotCalculated = 15
8473
 
8474
  };
8475
 
8476
  // Factory methods
8477
  static ObjCRequiresSuperAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
8478
  static ObjCRequiresSuperAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
8479
  static ObjCRequiresSuperAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8480
  static ObjCRequiresSuperAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8481
 
8482
  // Constructors
8483
  ObjCRequiresSuperAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
8484
             );
8485
 
8486
  ObjCRequiresSuperAttr *clone(ASTContext &C) const;
8487
  void printPretty(raw_ostream &OS,
8488
                   const PrintingPolicy &Policy) const;
8489
  const char *getSpelling() const;
8490
 
8491
 
8492
  static bool classof(const Attr *A) { return A->getKind() == attr::ObjCRequiresSuper; }
8493
};
8494
 
8495
class ObjCReturnsInnerPointerAttr : public InheritableAttr {
8496
public:
8497
  enum Spelling {
8498
    GNU_objc_returns_inner_pointer = 0,
8499
    CXX11_clang_objc_returns_inner_pointer = 1,
8500
    C2x_clang_objc_returns_inner_pointer = 2,
8501
  SpellingNotCalculated = 15
8502
 
8503
  };
8504
 
8505
  // Factory methods
8506
  static ObjCReturnsInnerPointerAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
8507
  static ObjCReturnsInnerPointerAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
8508
  static ObjCReturnsInnerPointerAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8509
  static ObjCReturnsInnerPointerAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8510
 
8511
  // Constructors
8512
  ObjCReturnsInnerPointerAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
8513
             );
8514
 
8515
  ObjCReturnsInnerPointerAttr *clone(ASTContext &C) const;
8516
  void printPretty(raw_ostream &OS,
8517
                   const PrintingPolicy &Policy) const;
8518
  const char *getSpelling() const;
8519
 
8520
 
8521
  static bool classof(const Attr *A) { return A->getKind() == attr::ObjCReturnsInnerPointer; }
8522
};
8523
 
8524
class ObjCRootClassAttr : public InheritableAttr {
8525
public:
8526
  enum Spelling {
8527
    GNU_objc_root_class = 0,
8528
    CXX11_clang_objc_root_class = 1,
8529
    C2x_clang_objc_root_class = 2,
8530
  SpellingNotCalculated = 15
8531
 
8532
  };
8533
 
8534
  // Factory methods
8535
  static ObjCRootClassAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
8536
  static ObjCRootClassAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
8537
  static ObjCRootClassAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8538
  static ObjCRootClassAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8539
 
8540
  // Constructors
8541
  ObjCRootClassAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
8542
             );
8543
 
8544
  ObjCRootClassAttr *clone(ASTContext &C) const;
8545
  void printPretty(raw_ostream &OS,
8546
                   const PrintingPolicy &Policy) const;
8547
  const char *getSpelling() const;
8548
 
8549
 
8550
  static bool classof(const Attr *A) { return A->getKind() == attr::ObjCRootClass; }
8551
};
8552
 
8553
class ObjCRuntimeNameAttr : public Attr {
8554
unsigned metadataNameLength;
8555
char *metadataName;
8556
 
8557
public:
8558
  enum Spelling {
8559
    GNU_objc_runtime_name = 0,
8560
    CXX11_clang_objc_runtime_name = 1,
8561
    C2x_clang_objc_runtime_name = 2,
8562
  SpellingNotCalculated = 15
8563
 
8564
  };
8565
 
8566
  // Factory methods
8567
  static ObjCRuntimeNameAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef MetadataName, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
8568
  static ObjCRuntimeNameAttr *Create(ASTContext &Ctx, llvm::StringRef MetadataName, const AttributeCommonInfo &CommonInfo);
8569
  static ObjCRuntimeNameAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef MetadataName, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8570
  static ObjCRuntimeNameAttr *Create(ASTContext &Ctx, llvm::StringRef MetadataName, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8571
 
8572
  // Constructors
8573
  ObjCRuntimeNameAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
8574
              , llvm::StringRef MetadataName
8575
             );
8576
 
8577
  ObjCRuntimeNameAttr *clone(ASTContext &C) const;
8578
  void printPretty(raw_ostream &OS,
8579
                   const PrintingPolicy &Policy) const;
8580
  const char *getSpelling() const;
8581
  llvm::StringRef getMetadataName() const {
8582
    return llvm::StringRef(metadataName, metadataNameLength);
8583
  }
8584
  unsigned getMetadataNameLength() const {
8585
    return metadataNameLength;
8586
  }
8587
  void setMetadataName(ASTContext &C, llvm::StringRef S) {
8588
    metadataNameLength = S.size();
8589
    this->metadataName = new (C, 1) char [metadataNameLength];
8590
    if (!S.empty())
8591
      std::memcpy(this->metadataName, S.data(), metadataNameLength);
8592
  }
8593
 
8594
 
8595
 
8596
  static bool classof(const Attr *A) { return A->getKind() == attr::ObjCRuntimeName; }
8597
};
8598
 
8599
class ObjCRuntimeVisibleAttr : public Attr {
8600
public:
8601
  enum Spelling {
8602
    GNU_objc_runtime_visible = 0,
8603
    CXX11_clang_objc_runtime_visible = 1,
8604
    C2x_clang_objc_runtime_visible = 2,
8605
  SpellingNotCalculated = 15
8606
 
8607
  };
8608
 
8609
  // Factory methods
8610
  static ObjCRuntimeVisibleAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
8611
  static ObjCRuntimeVisibleAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
8612
  static ObjCRuntimeVisibleAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8613
  static ObjCRuntimeVisibleAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8614
 
8615
  // Constructors
8616
  ObjCRuntimeVisibleAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
8617
             );
8618
 
8619
  ObjCRuntimeVisibleAttr *clone(ASTContext &C) const;
8620
  void printPretty(raw_ostream &OS,
8621
                   const PrintingPolicy &Policy) const;
8622
  const char *getSpelling() const;
8623
 
8624
 
8625
  static bool classof(const Attr *A) { return A->getKind() == attr::ObjCRuntimeVisible; }
8626
};
8627
 
8628
class ObjCSubclassingRestrictedAttr : public InheritableAttr {
8629
public:
8630
  enum Spelling {
8631
    GNU_objc_subclassing_restricted = 0,
8632
    CXX11_clang_objc_subclassing_restricted = 1,
8633
    C2x_clang_objc_subclassing_restricted = 2,
8634
  SpellingNotCalculated = 15
8635
 
8636
  };
8637
 
8638
  // Factory methods
8639
  static ObjCSubclassingRestrictedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
8640
  static ObjCSubclassingRestrictedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
8641
  static ObjCSubclassingRestrictedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8642
  static ObjCSubclassingRestrictedAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8643
 
8644
  // Constructors
8645
  ObjCSubclassingRestrictedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
8646
             );
8647
 
8648
  ObjCSubclassingRestrictedAttr *clone(ASTContext &C) const;
8649
  void printPretty(raw_ostream &OS,
8650
                   const PrintingPolicy &Policy) const;
8651
  const char *getSpelling() const;
8652
 
8653
 
8654
  static bool classof(const Attr *A) { return A->getKind() == attr::ObjCSubclassingRestricted; }
8655
};
8656
 
8657
class OpenCLAccessAttr : public Attr {
8658
public:
8659
  enum Spelling {
8660
    Keyword_read_only = 0,
8661
    Keyword_write_only = 2,
8662
    Keyword_read_write = 4,
8663
  SpellingNotCalculated = 15
8664
 
8665
  };
8666
 
8667
  // Factory methods
8668
  static OpenCLAccessAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
8669
  static OpenCLAccessAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
8670
  static OpenCLAccessAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax, OpenCLAccessAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
8671
  static OpenCLAccessAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax, OpenCLAccessAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
8672
 
8673
  // Constructors
8674
  OpenCLAccessAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
8675
             );
8676
 
8677
  OpenCLAccessAttr *clone(ASTContext &C) const;
8678
  void printPretty(raw_ostream &OS,
8679
                   const PrintingPolicy &Policy) const;
8680
  const char *getSpelling() const;
8681
  Spelling getSemanticSpelling() const;
8682
  bool isReadOnly() const { return getAttributeSpellingListIndex() == 0 ||
8683
    getAttributeSpellingListIndex() == 1; }
8684
  bool isReadWrite() const { return getAttributeSpellingListIndex() == 4 ||
8685
    getAttributeSpellingListIndex() == 5; }
8686
  bool isWriteOnly() const { return getAttributeSpellingListIndex() == 2 ||
8687
    getAttributeSpellingListIndex() == 3; }
8688
 
8689
 
8690
  static bool classof(const Attr *A) { return A->getKind() == attr::OpenCLAccess; }
8691
};
8692
 
8693
class OpenCLConstantAddressSpaceAttr : public TypeAttr {
8694
public:
8695
  enum Spelling {
8696
    Keyword_constant = 0,
8697
    GNU_opencl_constant = 2,
8698
    CXX11_clang_opencl_constant = 3,
8699
    C2x_clang_opencl_constant = 4,
8700
  SpellingNotCalculated = 15
8701
 
8702
  };
8703
 
8704
  // Factory methods
8705
  static OpenCLConstantAddressSpaceAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
8706
  static OpenCLConstantAddressSpaceAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
8707
  static OpenCLConstantAddressSpaceAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax, OpenCLConstantAddressSpaceAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
8708
  static OpenCLConstantAddressSpaceAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax, OpenCLConstantAddressSpaceAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
8709
 
8710
  // Constructors
8711
  OpenCLConstantAddressSpaceAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
8712
             );
8713
 
8714
  OpenCLConstantAddressSpaceAttr *clone(ASTContext &C) const;
8715
  void printPretty(raw_ostream &OS,
8716
                   const PrintingPolicy &Policy) const;
8717
  const char *getSpelling() const;
8718
  Spelling getSemanticSpelling() const;
8719
 
8720
 
8721
  static bool classof(const Attr *A) { return A->getKind() == attr::OpenCLConstantAddressSpace; }
8722
};
8723
 
8724
class OpenCLGenericAddressSpaceAttr : public TypeAttr {
8725
public:
8726
  enum Spelling {
8727
    Keyword_generic = 0,
8728
    GNU_opencl_generic = 2,
8729
    CXX11_clang_opencl_generic = 3,
8730
    C2x_clang_opencl_generic = 4,
8731
  SpellingNotCalculated = 15
8732
 
8733
  };
8734
 
8735
  // Factory methods
8736
  static OpenCLGenericAddressSpaceAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
8737
  static OpenCLGenericAddressSpaceAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
8738
  static OpenCLGenericAddressSpaceAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax, OpenCLGenericAddressSpaceAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
8739
  static OpenCLGenericAddressSpaceAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax, OpenCLGenericAddressSpaceAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
8740
 
8741
  // Constructors
8742
  OpenCLGenericAddressSpaceAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
8743
             );
8744
 
8745
  OpenCLGenericAddressSpaceAttr *clone(ASTContext &C) const;
8746
  void printPretty(raw_ostream &OS,
8747
                   const PrintingPolicy &Policy) const;
8748
  const char *getSpelling() const;
8749
  Spelling getSemanticSpelling() const;
8750
 
8751
 
8752
  static bool classof(const Attr *A) { return A->getKind() == attr::OpenCLGenericAddressSpace; }
8753
};
8754
 
8755
class OpenCLGlobalAddressSpaceAttr : public TypeAttr {
8756
public:
8757
  enum Spelling {
8758
    Keyword_global = 0,
8759
    GNU_opencl_global = 2,
8760
    CXX11_clang_opencl_global = 3,
8761
    C2x_clang_opencl_global = 4,
8762
  SpellingNotCalculated = 15
8763
 
8764
  };
8765
 
8766
  // Factory methods
8767
  static OpenCLGlobalAddressSpaceAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
8768
  static OpenCLGlobalAddressSpaceAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
8769
  static OpenCLGlobalAddressSpaceAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax, OpenCLGlobalAddressSpaceAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
8770
  static OpenCLGlobalAddressSpaceAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax, OpenCLGlobalAddressSpaceAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
8771
 
8772
  // Constructors
8773
  OpenCLGlobalAddressSpaceAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
8774
             );
8775
 
8776
  OpenCLGlobalAddressSpaceAttr *clone(ASTContext &C) const;
8777
  void printPretty(raw_ostream &OS,
8778
                   const PrintingPolicy &Policy) const;
8779
  const char *getSpelling() const;
8780
  Spelling getSemanticSpelling() const;
8781
 
8782
 
8783
  static bool classof(const Attr *A) { return A->getKind() == attr::OpenCLGlobalAddressSpace; }
8784
};
8785
 
8786
class OpenCLGlobalDeviceAddressSpaceAttr : public TypeAttr {
8787
public:
8788
  enum Spelling {
8789
    GNU_opencl_global_device = 0,
8790
    CXX11_clang_opencl_global_device = 1,
8791
    C2x_clang_opencl_global_device = 2,
8792
  SpellingNotCalculated = 15
8793
 
8794
  };
8795
 
8796
  // Factory methods
8797
  static OpenCLGlobalDeviceAddressSpaceAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
8798
  static OpenCLGlobalDeviceAddressSpaceAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
8799
  static OpenCLGlobalDeviceAddressSpaceAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8800
  static OpenCLGlobalDeviceAddressSpaceAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8801
 
8802
  // Constructors
8803
  OpenCLGlobalDeviceAddressSpaceAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
8804
             );
8805
 
8806
  OpenCLGlobalDeviceAddressSpaceAttr *clone(ASTContext &C) const;
8807
  void printPretty(raw_ostream &OS,
8808
                   const PrintingPolicy &Policy) const;
8809
  const char *getSpelling() const;
8810
 
8811
 
8812
  static bool classof(const Attr *A) { return A->getKind() == attr::OpenCLGlobalDeviceAddressSpace; }
8813
};
8814
 
8815
class OpenCLGlobalHostAddressSpaceAttr : public TypeAttr {
8816
public:
8817
  enum Spelling {
8818
    GNU_opencl_global_host = 0,
8819
    CXX11_clang_opencl_global_host = 1,
8820
    C2x_clang_opencl_global_host = 2,
8821
  SpellingNotCalculated = 15
8822
 
8823
  };
8824
 
8825
  // Factory methods
8826
  static OpenCLGlobalHostAddressSpaceAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
8827
  static OpenCLGlobalHostAddressSpaceAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
8828
  static OpenCLGlobalHostAddressSpaceAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8829
  static OpenCLGlobalHostAddressSpaceAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8830
 
8831
  // Constructors
8832
  OpenCLGlobalHostAddressSpaceAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
8833
             );
8834
 
8835
  OpenCLGlobalHostAddressSpaceAttr *clone(ASTContext &C) const;
8836
  void printPretty(raw_ostream &OS,
8837
                   const PrintingPolicy &Policy) const;
8838
  const char *getSpelling() const;
8839
 
8840
 
8841
  static bool classof(const Attr *A) { return A->getKind() == attr::OpenCLGlobalHostAddressSpace; }
8842
};
8843
 
8844
class OpenCLIntelReqdSubGroupSizeAttr : public InheritableAttr {
8845
unsigned subGroupSize;
8846
 
8847
public:
8848
  // Factory methods
8849
  static OpenCLIntelReqdSubGroupSizeAttr *CreateImplicit(ASTContext &Ctx, unsigned SubGroupSize, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
8850
  static OpenCLIntelReqdSubGroupSizeAttr *Create(ASTContext &Ctx, unsigned SubGroupSize, const AttributeCommonInfo &CommonInfo);
8851
  static OpenCLIntelReqdSubGroupSizeAttr *CreateImplicit(ASTContext &Ctx, unsigned SubGroupSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8852
  static OpenCLIntelReqdSubGroupSizeAttr *Create(ASTContext &Ctx, unsigned SubGroupSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8853
 
8854
  // Constructors
8855
  OpenCLIntelReqdSubGroupSizeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
8856
              , unsigned SubGroupSize
8857
             );
8858
 
8859
  OpenCLIntelReqdSubGroupSizeAttr *clone(ASTContext &C) const;
8860
  void printPretty(raw_ostream &OS,
8861
                   const PrintingPolicy &Policy) const;
8862
  const char *getSpelling() const;
8863
  unsigned getSubGroupSize() const {
8864
    return subGroupSize;
8865
  }
8866
 
8867
 
8868
 
8869
  static bool classof(const Attr *A) { return A->getKind() == attr::OpenCLIntelReqdSubGroupSize; }
8870
};
8871
 
8872
class OpenCLKernelAttr : public InheritableAttr {
8873
public:
8874
  enum Spelling {
8875
    Keyword_kernel = 0,
8876
  SpellingNotCalculated = 15
8877
 
8878
  };
8879
 
8880
  // Factory methods
8881
  static OpenCLKernelAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
8882
  static OpenCLKernelAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
8883
  static OpenCLKernelAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8884
  static OpenCLKernelAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8885
 
8886
  // Constructors
8887
  OpenCLKernelAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
8888
             );
8889
 
8890
  OpenCLKernelAttr *clone(ASTContext &C) const;
8891
  void printPretty(raw_ostream &OS,
8892
                   const PrintingPolicy &Policy) const;
8893
  const char *getSpelling() const;
8894
 
8895
 
8896
  static bool classof(const Attr *A) { return A->getKind() == attr::OpenCLKernel; }
8897
};
8898
 
8899
class OpenCLLocalAddressSpaceAttr : public TypeAttr {
8900
public:
8901
  enum Spelling {
8902
    Keyword_local = 0,
8903
    GNU_opencl_local = 2,
8904
    CXX11_clang_opencl_local = 3,
8905
    C2x_clang_opencl_local = 4,
8906
  SpellingNotCalculated = 15
8907
 
8908
  };
8909
 
8910
  // Factory methods
8911
  static OpenCLLocalAddressSpaceAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
8912
  static OpenCLLocalAddressSpaceAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
8913
  static OpenCLLocalAddressSpaceAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax, OpenCLLocalAddressSpaceAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
8914
  static OpenCLLocalAddressSpaceAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax, OpenCLLocalAddressSpaceAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
8915
 
8916
  // Constructors
8917
  OpenCLLocalAddressSpaceAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
8918
             );
8919
 
8920
  OpenCLLocalAddressSpaceAttr *clone(ASTContext &C) const;
8921
  void printPretty(raw_ostream &OS,
8922
                   const PrintingPolicy &Policy) const;
8923
  const char *getSpelling() const;
8924
  Spelling getSemanticSpelling() const;
8925
 
8926
 
8927
  static bool classof(const Attr *A) { return A->getKind() == attr::OpenCLLocalAddressSpace; }
8928
};
8929
 
8930
class OpenCLPrivateAddressSpaceAttr : public TypeAttr {
8931
public:
8932
  enum Spelling {
8933
    Keyword_private = 0,
8934
    GNU_opencl_private = 2,
8935
    CXX11_clang_opencl_private = 3,
8936
    C2x_clang_opencl_private = 4,
8937
  SpellingNotCalculated = 15
8938
 
8939
  };
8940
 
8941
  // Factory methods
8942
  static OpenCLPrivateAddressSpaceAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
8943
  static OpenCLPrivateAddressSpaceAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
8944
  static OpenCLPrivateAddressSpaceAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax, OpenCLPrivateAddressSpaceAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
8945
  static OpenCLPrivateAddressSpaceAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax, OpenCLPrivateAddressSpaceAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
8946
 
8947
  // Constructors
8948
  OpenCLPrivateAddressSpaceAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
8949
             );
8950
 
8951
  OpenCLPrivateAddressSpaceAttr *clone(ASTContext &C) const;
8952
  void printPretty(raw_ostream &OS,
8953
                   const PrintingPolicy &Policy) const;
8954
  const char *getSpelling() const;
8955
  Spelling getSemanticSpelling() const;
8956
 
8957
 
8958
  static bool classof(const Attr *A) { return A->getKind() == attr::OpenCLPrivateAddressSpace; }
8959
};
8960
 
8961
class OpenCLUnrollHintAttr : public StmtAttr {
8962
unsigned unrollHint;
8963
 
8964
public:
8965
  // Factory methods
8966
  static OpenCLUnrollHintAttr *CreateImplicit(ASTContext &Ctx, unsigned UnrollHint, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
8967
  static OpenCLUnrollHintAttr *Create(ASTContext &Ctx, unsigned UnrollHint, const AttributeCommonInfo &CommonInfo);
8968
  static OpenCLUnrollHintAttr *CreateImplicit(ASTContext &Ctx, unsigned UnrollHint, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8969
  static OpenCLUnrollHintAttr *Create(ASTContext &Ctx, unsigned UnrollHint, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
8970
 
8971
  // Constructors
8972
  OpenCLUnrollHintAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
8973
              , unsigned UnrollHint
8974
             );
8975
  OpenCLUnrollHintAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
8976
             );
8977
 
8978
  OpenCLUnrollHintAttr *clone(ASTContext &C) const;
8979
  void printPretty(raw_ostream &OS,
8980
                   const PrintingPolicy &Policy) const;
8981
  const char *getSpelling() const;
8982
  unsigned getUnrollHint() const {
8983
    return unrollHint;
8984
  }
8985
 
8986
 
8987
 
8988
  static bool classof(const Attr *A) { return A->getKind() == attr::OpenCLUnrollHint; }
8989
};
8990
 
8991
class OptimizeNoneAttr : public InheritableAttr {
8992
public:
8993
  enum Spelling {
8994
    GNU_optnone = 0,
8995
    CXX11_clang_optnone = 1,
8996
    C2x_clang_optnone = 2,
8997
  SpellingNotCalculated = 15
8998
 
8999
  };
9000
 
9001
  // Factory methods
9002
  static OptimizeNoneAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
9003
  static OptimizeNoneAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
9004
  static OptimizeNoneAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9005
  static OptimizeNoneAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9006
 
9007
  // Constructors
9008
  OptimizeNoneAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
9009
             );
9010
 
9011
  OptimizeNoneAttr *clone(ASTContext &C) const;
9012
  void printPretty(raw_ostream &OS,
9013
                   const PrintingPolicy &Policy) const;
9014
  const char *getSpelling() const;
9015
 
9016
 
9017
  static bool classof(const Attr *A) { return A->getKind() == attr::OptimizeNone; }
9018
};
9019
 
9020
class OverloadableAttr : public Attr {
9021
public:
9022
  enum Spelling {
9023
    GNU_overloadable = 0,
9024
    CXX11_clang_overloadable = 1,
9025
    C2x_clang_overloadable = 2,
9026
  SpellingNotCalculated = 15
9027
 
9028
  };
9029
 
9030
  // Factory methods
9031
  static OverloadableAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
9032
  static OverloadableAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
9033
  static OverloadableAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9034
  static OverloadableAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9035
 
9036
  // Constructors
9037
  OverloadableAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
9038
             );
9039
 
9040
  OverloadableAttr *clone(ASTContext &C) const;
9041
  void printPretty(raw_ostream &OS,
9042
                   const PrintingPolicy &Policy) const;
9043
  const char *getSpelling() const;
9044
 
9045
 
9046
  static bool classof(const Attr *A) { return A->getKind() == attr::Overloadable; }
9047
};
9048
 
9049
class OverrideAttr : public InheritableAttr {
9050
public:
9051
  // Factory methods
9052
  static OverrideAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
9053
  static OverrideAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
9054
  static OverrideAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9055
  static OverrideAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9056
 
9057
  // Constructors
9058
  OverrideAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
9059
             );
9060
 
9061
  OverrideAttr *clone(ASTContext &C) const;
9062
  void printPretty(raw_ostream &OS,
9063
                   const PrintingPolicy &Policy) const;
9064
  const char *getSpelling() const;
9065
 
9066
 
9067
  static bool classof(const Attr *A) { return A->getKind() == attr::Override; }
9068
};
9069
 
9070
class OwnerAttr : public InheritableAttr {
9071
TypeSourceInfo * derefType;
9072
 
9073
public:
9074
  // Factory methods
9075
  static OwnerAttr *CreateImplicit(ASTContext &Ctx, TypeSourceInfo * DerefType, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
9076
  static OwnerAttr *Create(ASTContext &Ctx, TypeSourceInfo * DerefType, const AttributeCommonInfo &CommonInfo);
9077
  static OwnerAttr *CreateImplicit(ASTContext &Ctx, TypeSourceInfo * DerefType, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9078
  static OwnerAttr *Create(ASTContext &Ctx, TypeSourceInfo * DerefType, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9079
 
9080
  // Constructors
9081
  OwnerAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
9082
              , TypeSourceInfo * DerefType
9083
             );
9084
  OwnerAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
9085
             );
9086
 
9087
  OwnerAttr *clone(ASTContext &C) const;
9088
  void printPretty(raw_ostream &OS,
9089
                   const PrintingPolicy &Policy) const;
9090
  const char *getSpelling() const;
9091
  QualType getDerefType() const {
9092
    return derefType->getType();
9093
  }  TypeSourceInfo * getDerefTypeLoc() const {
9094
    return derefType;
9095
  }
9096
 
9097
 
9098
 
9099
  static bool classof(const Attr *A) { return A->getKind() == attr::Owner; }
9100
};
9101
 
9102
class OwnershipAttr : public InheritableAttr {
9103
IdentifierInfo * module;
9104
 
9105
  unsigned args_Size;
9106
  ParamIdx *args_;
9107
 
9108
public:
9109
  enum Spelling {
9110
    GNU_ownership_holds = 0,
9111
    CXX11_clang_ownership_holds = 1,
9112
    C2x_clang_ownership_holds = 2,
9113
    GNU_ownership_returns = 3,
9114
    CXX11_clang_ownership_returns = 4,
9115
    C2x_clang_ownership_returns = 5,
9116
    GNU_ownership_takes = 6,
9117
    CXX11_clang_ownership_takes = 7,
9118
    C2x_clang_ownership_takes = 8,
9119
  SpellingNotCalculated = 15
9120
 
9121
  };
9122
 
9123
  // Factory methods
9124
  static OwnershipAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * Module, ParamIdx *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
9125
  static OwnershipAttr *Create(ASTContext &Ctx, IdentifierInfo * Module, ParamIdx *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo);
9126
  static OwnershipAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * Module, ParamIdx *Args, unsigned ArgsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax, OwnershipAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
9127
  static OwnershipAttr *Create(ASTContext &Ctx, IdentifierInfo * Module, ParamIdx *Args, unsigned ArgsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax, OwnershipAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
9128
 
9129
  // Constructors
9130
  OwnershipAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
9131
              , IdentifierInfo * Module
9132
              , ParamIdx *Args, unsigned ArgsSize
9133
             );
9134
  OwnershipAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
9135
              , IdentifierInfo * Module
9136
             );
9137
 
9138
  OwnershipAttr *clone(ASTContext &C) const;
9139
  void printPretty(raw_ostream &OS,
9140
                   const PrintingPolicy &Policy) const;
9141
  const char *getSpelling() const;
9142
  Spelling getSemanticSpelling() const;
9143
  bool isHolds() const { return getAttributeSpellingListIndex() == 0 ||
9144
    getAttributeSpellingListIndex() == 1 ||
9145
    getAttributeSpellingListIndex() == 2; }
9146
  bool isReturns() const { return getAttributeSpellingListIndex() == 3 ||
9147
    getAttributeSpellingListIndex() == 4 ||
9148
    getAttributeSpellingListIndex() == 5; }
9149
  bool isTakes() const { return getAttributeSpellingListIndex() == 6 ||
9150
    getAttributeSpellingListIndex() == 7 ||
9151
    getAttributeSpellingListIndex() == 8; }
9152
  IdentifierInfo * getModule() const {
9153
    return module;
9154
  }
9155
 
9156
  typedef ParamIdx* args_iterator;
9157
  args_iterator args_begin() const { return args_; }
9158
  args_iterator args_end() const { return args_ + args_Size; }
9159
  unsigned args_size() const { return args_Size; }
9160
  llvm::iterator_range<args_iterator> args() const { return llvm::make_range(args_begin(), args_end()); }
9161
 
9162
 
9163
 
9164
    enum OwnershipKind { Holds, Returns, Takes };
9165
    OwnershipKind getOwnKind() const {
9166
      return isHolds() ? Holds :
9167
             isTakes() ? Takes :
9168
             Returns;
9169
    }
9170
 
9171
 
9172
  static bool classof(const Attr *A) { return A->getKind() == attr::Ownership; }
9173
};
9174
 
9175
class PackedAttr : public InheritableAttr {
9176
public:
9177
  enum Spelling {
9178
    GNU_packed = 0,
9179
    CXX11_gnu_packed = 1,
9180
    C2x_gnu_packed = 2,
9181
  SpellingNotCalculated = 15
9182
 
9183
  };
9184
 
9185
  // Factory methods
9186
  static PackedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
9187
  static PackedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
9188
  static PackedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9189
  static PackedAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9190
 
9191
  // Constructors
9192
  PackedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
9193
             );
9194
 
9195
  PackedAttr *clone(ASTContext &C) const;
9196
  void printPretty(raw_ostream &OS,
9197
                   const PrintingPolicy &Policy) const;
9198
  const char *getSpelling() const;
9199
 
9200
 
9201
  static bool classof(const Attr *A) { return A->getKind() == attr::Packed; }
9202
};
9203
 
9204
class ParamTypestateAttr : public InheritableAttr {
9205
public:
9206
  enum ConsumedState {
9207
    Unknown,
9208
    Consumed,
9209
    Unconsumed
9210
  };
9211
private:
9212
  ConsumedState paramState;
9213
 
9214
public:
9215
  enum Spelling {
9216
    GNU_param_typestate = 0,
9217
    CXX11_clang_param_typestate = 1,
9218
  SpellingNotCalculated = 15
9219
 
9220
  };
9221
 
9222
  // Factory methods
9223
  static ParamTypestateAttr *CreateImplicit(ASTContext &Ctx, ConsumedState ParamState, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
9224
  static ParamTypestateAttr *Create(ASTContext &Ctx, ConsumedState ParamState, const AttributeCommonInfo &CommonInfo);
9225
  static ParamTypestateAttr *CreateImplicit(ASTContext &Ctx, ConsumedState ParamState, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9226
  static ParamTypestateAttr *Create(ASTContext &Ctx, ConsumedState ParamState, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9227
 
9228
  // Constructors
9229
  ParamTypestateAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
9230
              , ConsumedState ParamState
9231
             );
9232
 
9233
  ParamTypestateAttr *clone(ASTContext &C) const;
9234
  void printPretty(raw_ostream &OS,
9235
                   const PrintingPolicy &Policy) const;
9236
  const char *getSpelling() const;
9237
  ConsumedState getParamState() const {
9238
    return paramState;
9239
  }
9240
 
9241
  static bool ConvertStrToConsumedState(StringRef Val, ConsumedState &Out);
9242
  static const char *ConvertConsumedStateToStr(ConsumedState Val);
9243
 
9244
 
9245
  static bool classof(const Attr *A) { return A->getKind() == attr::ParamTypestate; }
9246
};
9247
 
9248
class PascalAttr : public InheritableAttr {
9249
public:
9250
  enum Spelling {
9251
    GNU_pascal = 0,
9252
    CXX11_clang_pascal = 1,
9253
    C2x_clang_pascal = 2,
9254
    Keyword_pascal = 3,
9255
  SpellingNotCalculated = 15
9256
 
9257
  };
9258
 
9259
  // Factory methods
9260
  static PascalAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
9261
  static PascalAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
9262
  static PascalAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9263
  static PascalAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9264
 
9265
  // Constructors
9266
  PascalAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
9267
             );
9268
 
9269
  PascalAttr *clone(ASTContext &C) const;
9270
  void printPretty(raw_ostream &OS,
9271
                   const PrintingPolicy &Policy) const;
9272
  const char *getSpelling() const;
9273
 
9274
 
9275
  static bool classof(const Attr *A) { return A->getKind() == attr::Pascal; }
9276
};
9277
 
9278
class PassObjectSizeAttr : public InheritableParamAttr {
9279
int type;
9280
 
9281
public:
9282
  enum Spelling {
9283
    GNU_pass_object_size = 0,
9284
    CXX11_clang_pass_object_size = 1,
9285
    C2x_clang_pass_object_size = 2,
9286
    GNU_pass_dynamic_object_size = 3,
9287
    CXX11_clang_pass_dynamic_object_size = 4,
9288
    C2x_clang_pass_dynamic_object_size = 5,
9289
  SpellingNotCalculated = 15
9290
 
9291
  };
9292
 
9293
  // Factory methods
9294
  static PassObjectSizeAttr *CreateImplicit(ASTContext &Ctx, int Type, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
9295
  static PassObjectSizeAttr *Create(ASTContext &Ctx, int Type, const AttributeCommonInfo &CommonInfo);
9296
  static PassObjectSizeAttr *CreateImplicit(ASTContext &Ctx, int Type, SourceRange Range, AttributeCommonInfo::Syntax Syntax, PassObjectSizeAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
9297
  static PassObjectSizeAttr *Create(ASTContext &Ctx, int Type, SourceRange Range, AttributeCommonInfo::Syntax Syntax, PassObjectSizeAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
9298
 
9299
  // Constructors
9300
  PassObjectSizeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
9301
              , int Type
9302
             );
9303
 
9304
  PassObjectSizeAttr *clone(ASTContext &C) const;
9305
  void printPretty(raw_ostream &OS,
9306
                   const PrintingPolicy &Policy) const;
9307
  const char *getSpelling() const;
9308
  Spelling getSemanticSpelling() const;
9309
  bool isDynamic() const { return getAttributeSpellingListIndex() == 3 ||
9310
    getAttributeSpellingListIndex() == 4 ||
9311
    getAttributeSpellingListIndex() == 5; }
9312
  int getType() const {
9313
    return type;
9314
  }
9315
 
9316
 
9317
 
9318
  static bool classof(const Attr *A) { return A->getKind() == attr::PassObjectSize; }
9319
};
9320
 
9321
class PatchableFunctionEntryAttr : public InheritableAttr {
9322
unsigned count;
9323
 
9324
int offset;
9325
 
9326
public:
9327
  enum Spelling {
9328
    GNU_patchable_function_entry = 0,
9329
    CXX11_gnu_patchable_function_entry = 1,
9330
    C2x_gnu_patchable_function_entry = 2,
9331
  SpellingNotCalculated = 15
9332
 
9333
  };
9334
 
9335
  // Factory methods
9336
  static PatchableFunctionEntryAttr *CreateImplicit(ASTContext &Ctx, unsigned Count, int Offset, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
9337
  static PatchableFunctionEntryAttr *Create(ASTContext &Ctx, unsigned Count, int Offset, const AttributeCommonInfo &CommonInfo);
9338
  static PatchableFunctionEntryAttr *CreateImplicit(ASTContext &Ctx, unsigned Count, int Offset, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9339
  static PatchableFunctionEntryAttr *Create(ASTContext &Ctx, unsigned Count, int Offset, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9340
 
9341
  // Constructors
9342
  PatchableFunctionEntryAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
9343
              , unsigned Count
9344
              , int Offset
9345
             );
9346
  PatchableFunctionEntryAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
9347
              , unsigned Count
9348
             );
9349
 
9350
  PatchableFunctionEntryAttr *clone(ASTContext &C) const;
9351
  void printPretty(raw_ostream &OS,
9352
                   const PrintingPolicy &Policy) const;
9353
  const char *getSpelling() const;
9354
  unsigned getCount() const {
9355
    return count;
9356
  }
9357
 
9358
  int getOffset() const {
9359
    return offset;
9360
  }
9361
 
9362
  static const int DefaultOffset = 0;
9363
 
9364
 
9365
 
9366
  static bool classof(const Attr *A) { return A->getKind() == attr::PatchableFunctionEntry; }
9367
};
9368
 
9369
class PcsAttr : public InheritableAttr {
9370
public:
9371
  enum PCSType {
9372
    AAPCS,
9373
    AAPCS_VFP
9374
  };
9375
private:
9376
  PCSType pCS;
9377
 
9378
public:
9379
  enum Spelling {
9380
    GNU_pcs = 0,
9381
    CXX11_gnu_pcs = 1,
9382
    C2x_gnu_pcs = 2,
9383
  SpellingNotCalculated = 15
9384
 
9385
  };
9386
 
9387
  // Factory methods
9388
  static PcsAttr *CreateImplicit(ASTContext &Ctx, PCSType PCS, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
9389
  static PcsAttr *Create(ASTContext &Ctx, PCSType PCS, const AttributeCommonInfo &CommonInfo);
9390
  static PcsAttr *CreateImplicit(ASTContext &Ctx, PCSType PCS, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9391
  static PcsAttr *Create(ASTContext &Ctx, PCSType PCS, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9392
 
9393
  // Constructors
9394
  PcsAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
9395
              , PCSType PCS
9396
             );
9397
 
9398
  PcsAttr *clone(ASTContext &C) const;
9399
  void printPretty(raw_ostream &OS,
9400
                   const PrintingPolicy &Policy) const;
9401
  const char *getSpelling() const;
9402
  PCSType getPCS() const {
9403
    return pCS;
9404
  }
9405
 
9406
  static bool ConvertStrToPCSType(StringRef Val, PCSType &Out);
9407
  static const char *ConvertPCSTypeToStr(PCSType Val);
9408
 
9409
 
9410
  static bool classof(const Attr *A) { return A->getKind() == attr::Pcs; }
9411
};
9412
 
9413
class PointerAttr : public InheritableAttr {
9414
TypeSourceInfo * derefType;
9415
 
9416
public:
9417
  // Factory methods
9418
  static PointerAttr *CreateImplicit(ASTContext &Ctx, TypeSourceInfo * DerefType, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
9419
  static PointerAttr *Create(ASTContext &Ctx, TypeSourceInfo * DerefType, const AttributeCommonInfo &CommonInfo);
9420
  static PointerAttr *CreateImplicit(ASTContext &Ctx, TypeSourceInfo * DerefType, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9421
  static PointerAttr *Create(ASTContext &Ctx, TypeSourceInfo * DerefType, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9422
 
9423
  // Constructors
9424
  PointerAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
9425
              , TypeSourceInfo * DerefType
9426
             );
9427
  PointerAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
9428
             );
9429
 
9430
  PointerAttr *clone(ASTContext &C) const;
9431
  void printPretty(raw_ostream &OS,
9432
                   const PrintingPolicy &Policy) const;
9433
  const char *getSpelling() const;
9434
  QualType getDerefType() const {
9435
    return derefType->getType();
9436
  }  TypeSourceInfo * getDerefTypeLoc() const {
9437
    return derefType;
9438
  }
9439
 
9440
 
9441
 
9442
  static bool classof(const Attr *A) { return A->getKind() == attr::Pointer; }
9443
};
9444
 
9445
class PragmaClangBSSSectionAttr : public InheritableAttr {
9446
unsigned nameLength;
9447
char *name;
9448
 
9449
public:
9450
  // Factory methods
9451
  static PragmaClangBSSSectionAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Name, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
9452
  static PragmaClangBSSSectionAttr *Create(ASTContext &Ctx, llvm::StringRef Name, const AttributeCommonInfo &CommonInfo);
9453
  static PragmaClangBSSSectionAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Name, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9454
  static PragmaClangBSSSectionAttr *Create(ASTContext &Ctx, llvm::StringRef Name, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9455
 
9456
  // Constructors
9457
  PragmaClangBSSSectionAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
9458
              , llvm::StringRef Name
9459
             );
9460
 
9461
  PragmaClangBSSSectionAttr *clone(ASTContext &C) const;
9462
  void printPretty(raw_ostream &OS,
9463
                   const PrintingPolicy &Policy) const;
9464
  const char *getSpelling() const;
9465
  llvm::StringRef getName() const {
9466
    return llvm::StringRef(name, nameLength);
9467
  }
9468
  unsigned getNameLength() const {
9469
    return nameLength;
9470
  }
9471
  void setName(ASTContext &C, llvm::StringRef S) {
9472
    nameLength = S.size();
9473
    this->name = new (C, 1) char [nameLength];
9474
    if (!S.empty())
9475
      std::memcpy(this->name, S.data(), nameLength);
9476
  }
9477
 
9478
 
9479
 
9480
  static bool classof(const Attr *A) { return A->getKind() == attr::PragmaClangBSSSection; }
9481
};
9482
 
9483
class PragmaClangDataSectionAttr : public InheritableAttr {
9484
unsigned nameLength;
9485
char *name;
9486
 
9487
public:
9488
  // Factory methods
9489
  static PragmaClangDataSectionAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Name, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
9490
  static PragmaClangDataSectionAttr *Create(ASTContext &Ctx, llvm::StringRef Name, const AttributeCommonInfo &CommonInfo);
9491
  static PragmaClangDataSectionAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Name, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9492
  static PragmaClangDataSectionAttr *Create(ASTContext &Ctx, llvm::StringRef Name, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9493
 
9494
  // Constructors
9495
  PragmaClangDataSectionAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
9496
              , llvm::StringRef Name
9497
             );
9498
 
9499
  PragmaClangDataSectionAttr *clone(ASTContext &C) const;
9500
  void printPretty(raw_ostream &OS,
9501
                   const PrintingPolicy &Policy) const;
9502
  const char *getSpelling() const;
9503
  llvm::StringRef getName() const {
9504
    return llvm::StringRef(name, nameLength);
9505
  }
9506
  unsigned getNameLength() const {
9507
    return nameLength;
9508
  }
9509
  void setName(ASTContext &C, llvm::StringRef S) {
9510
    nameLength = S.size();
9511
    this->name = new (C, 1) char [nameLength];
9512
    if (!S.empty())
9513
      std::memcpy(this->name, S.data(), nameLength);
9514
  }
9515
 
9516
 
9517
 
9518
  static bool classof(const Attr *A) { return A->getKind() == attr::PragmaClangDataSection; }
9519
};
9520
 
9521
class PragmaClangRelroSectionAttr : public InheritableAttr {
9522
unsigned nameLength;
9523
char *name;
9524
 
9525
public:
9526
  // Factory methods
9527
  static PragmaClangRelroSectionAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Name, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
9528
  static PragmaClangRelroSectionAttr *Create(ASTContext &Ctx, llvm::StringRef Name, const AttributeCommonInfo &CommonInfo);
9529
  static PragmaClangRelroSectionAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Name, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9530
  static PragmaClangRelroSectionAttr *Create(ASTContext &Ctx, llvm::StringRef Name, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9531
 
9532
  // Constructors
9533
  PragmaClangRelroSectionAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
9534
              , llvm::StringRef Name
9535
             );
9536
 
9537
  PragmaClangRelroSectionAttr *clone(ASTContext &C) const;
9538
  void printPretty(raw_ostream &OS,
9539
                   const PrintingPolicy &Policy) const;
9540
  const char *getSpelling() const;
9541
  llvm::StringRef getName() const {
9542
    return llvm::StringRef(name, nameLength);
9543
  }
9544
  unsigned getNameLength() const {
9545
    return nameLength;
9546
  }
9547
  void setName(ASTContext &C, llvm::StringRef S) {
9548
    nameLength = S.size();
9549
    this->name = new (C, 1) char [nameLength];
9550
    if (!S.empty())
9551
      std::memcpy(this->name, S.data(), nameLength);
9552
  }
9553
 
9554
 
9555
 
9556
  static bool classof(const Attr *A) { return A->getKind() == attr::PragmaClangRelroSection; }
9557
};
9558
 
9559
class PragmaClangRodataSectionAttr : public InheritableAttr {
9560
unsigned nameLength;
9561
char *name;
9562
 
9563
public:
9564
  // Factory methods
9565
  static PragmaClangRodataSectionAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Name, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
9566
  static PragmaClangRodataSectionAttr *Create(ASTContext &Ctx, llvm::StringRef Name, const AttributeCommonInfo &CommonInfo);
9567
  static PragmaClangRodataSectionAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Name, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9568
  static PragmaClangRodataSectionAttr *Create(ASTContext &Ctx, llvm::StringRef Name, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9569
 
9570
  // Constructors
9571
  PragmaClangRodataSectionAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
9572
              , llvm::StringRef Name
9573
             );
9574
 
9575
  PragmaClangRodataSectionAttr *clone(ASTContext &C) const;
9576
  void printPretty(raw_ostream &OS,
9577
                   const PrintingPolicy &Policy) const;
9578
  const char *getSpelling() const;
9579
  llvm::StringRef getName() const {
9580
    return llvm::StringRef(name, nameLength);
9581
  }
9582
  unsigned getNameLength() const {
9583
    return nameLength;
9584
  }
9585
  void setName(ASTContext &C, llvm::StringRef S) {
9586
    nameLength = S.size();
9587
    this->name = new (C, 1) char [nameLength];
9588
    if (!S.empty())
9589
      std::memcpy(this->name, S.data(), nameLength);
9590
  }
9591
 
9592
 
9593
 
9594
  static bool classof(const Attr *A) { return A->getKind() == attr::PragmaClangRodataSection; }
9595
};
9596
 
9597
class PragmaClangTextSectionAttr : public InheritableAttr {
9598
unsigned nameLength;
9599
char *name;
9600
 
9601
public:
9602
  // Factory methods
9603
  static PragmaClangTextSectionAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Name, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
9604
  static PragmaClangTextSectionAttr *Create(ASTContext &Ctx, llvm::StringRef Name, const AttributeCommonInfo &CommonInfo);
9605
  static PragmaClangTextSectionAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Name, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9606
  static PragmaClangTextSectionAttr *Create(ASTContext &Ctx, llvm::StringRef Name, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9607
 
9608
  // Constructors
9609
  PragmaClangTextSectionAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
9610
              , llvm::StringRef Name
9611
             );
9612
 
9613
  PragmaClangTextSectionAttr *clone(ASTContext &C) const;
9614
  void printPretty(raw_ostream &OS,
9615
                   const PrintingPolicy &Policy) const;
9616
  const char *getSpelling() const;
9617
  llvm::StringRef getName() const {
9618
    return llvm::StringRef(name, nameLength);
9619
  }
9620
  unsigned getNameLength() const {
9621
    return nameLength;
9622
  }
9623
  void setName(ASTContext &C, llvm::StringRef S) {
9624
    nameLength = S.size();
9625
    this->name = new (C, 1) char [nameLength];
9626
    if (!S.empty())
9627
      std::memcpy(this->name, S.data(), nameLength);
9628
  }
9629
 
9630
 
9631
 
9632
  static bool classof(const Attr *A) { return A->getKind() == attr::PragmaClangTextSection; }
9633
};
9634
 
9635
class PreferredNameAttr : public InheritableAttr {
9636
TypeSourceInfo * typedefType;
9637
 
9638
public:
9639
  enum Spelling {
9640
    GNU_preferred_name = 0,
9641
    CXX11_clang_preferred_name = 1,
9642
  SpellingNotCalculated = 15
9643
 
9644
  };
9645
 
9646
  // Factory methods
9647
  static PreferredNameAttr *CreateImplicit(ASTContext &Ctx, TypeSourceInfo * TypedefType, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
9648
  static PreferredNameAttr *Create(ASTContext &Ctx, TypeSourceInfo * TypedefType, const AttributeCommonInfo &CommonInfo);
9649
  static PreferredNameAttr *CreateImplicit(ASTContext &Ctx, TypeSourceInfo * TypedefType, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9650
  static PreferredNameAttr *Create(ASTContext &Ctx, TypeSourceInfo * TypedefType, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9651
 
9652
  // Constructors
9653
  PreferredNameAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
9654
              , TypeSourceInfo * TypedefType
9655
             );
9656
 
9657
  PreferredNameAttr *clone(ASTContext &C) const;
9658
  void printPretty(raw_ostream &OS,
9659
                   const PrintingPolicy &Policy) const;
9660
  const char *getSpelling() const;
9661
  QualType getTypedefType() const {
9662
    return typedefType->getType();
9663
  }  TypeSourceInfo * getTypedefTypeLoc() const {
9664
    return typedefType;
9665
  }
9666
 
9667
 
9668
 
9669
  static bool classof(const Attr *A) { return A->getKind() == attr::PreferredName; }
9670
};
9671
 
9672
class PreserveAllAttr : public InheritableAttr {
9673
public:
9674
  enum Spelling {
9675
    GNU_preserve_all = 0,
9676
    CXX11_clang_preserve_all = 1,
9677
    C2x_clang_preserve_all = 2,
9678
  SpellingNotCalculated = 15
9679
 
9680
  };
9681
 
9682
  // Factory methods
9683
  static PreserveAllAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
9684
  static PreserveAllAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
9685
  static PreserveAllAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9686
  static PreserveAllAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9687
 
9688
  // Constructors
9689
  PreserveAllAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
9690
             );
9691
 
9692
  PreserveAllAttr *clone(ASTContext &C) const;
9693
  void printPretty(raw_ostream &OS,
9694
                   const PrintingPolicy &Policy) const;
9695
  const char *getSpelling() const;
9696
 
9697
 
9698
  static bool classof(const Attr *A) { return A->getKind() == attr::PreserveAll; }
9699
};
9700
 
9701
class PreserveMostAttr : public InheritableAttr {
9702
public:
9703
  enum Spelling {
9704
    GNU_preserve_most = 0,
9705
    CXX11_clang_preserve_most = 1,
9706
    C2x_clang_preserve_most = 2,
9707
  SpellingNotCalculated = 15
9708
 
9709
  };
9710
 
9711
  // Factory methods
9712
  static PreserveMostAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
9713
  static PreserveMostAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
9714
  static PreserveMostAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9715
  static PreserveMostAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9716
 
9717
  // Constructors
9718
  PreserveMostAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
9719
             );
9720
 
9721
  PreserveMostAttr *clone(ASTContext &C) const;
9722
  void printPretty(raw_ostream &OS,
9723
                   const PrintingPolicy &Policy) const;
9724
  const char *getSpelling() const;
9725
 
9726
 
9727
  static bool classof(const Attr *A) { return A->getKind() == attr::PreserveMost; }
9728
};
9729
 
9730
class PtGuardedByAttr : public InheritableAttr {
9731
Expr * arg;
9732
 
9733
public:
9734
  // Factory methods
9735
  static PtGuardedByAttr *CreateImplicit(ASTContext &Ctx, Expr * Arg, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
9736
  static PtGuardedByAttr *Create(ASTContext &Ctx, Expr * Arg, const AttributeCommonInfo &CommonInfo);
9737
  static PtGuardedByAttr *CreateImplicit(ASTContext &Ctx, Expr * Arg, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9738
  static PtGuardedByAttr *Create(ASTContext &Ctx, Expr * Arg, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9739
 
9740
  // Constructors
9741
  PtGuardedByAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
9742
              , Expr * Arg
9743
             );
9744
 
9745
  PtGuardedByAttr *clone(ASTContext &C) const;
9746
  void printPretty(raw_ostream &OS,
9747
                   const PrintingPolicy &Policy) const;
9748
  const char *getSpelling() const;
9749
  Expr * getArg() const {
9750
    return arg;
9751
  }
9752
 
9753
 
9754
 
9755
  static bool classof(const Attr *A) { return A->getKind() == attr::PtGuardedBy; }
9756
};
9757
 
9758
class PtGuardedVarAttr : public InheritableAttr {
9759
public:
9760
  enum Spelling {
9761
    GNU_pt_guarded_var = 0,
9762
    CXX11_clang_pt_guarded_var = 1,
9763
  SpellingNotCalculated = 15
9764
 
9765
  };
9766
 
9767
  // Factory methods
9768
  static PtGuardedVarAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
9769
  static PtGuardedVarAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
9770
  static PtGuardedVarAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9771
  static PtGuardedVarAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9772
 
9773
  // Constructors
9774
  PtGuardedVarAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
9775
             );
9776
 
9777
  PtGuardedVarAttr *clone(ASTContext &C) const;
9778
  void printPretty(raw_ostream &OS,
9779
                   const PrintingPolicy &Policy) const;
9780
  const char *getSpelling() const;
9781
 
9782
 
9783
  static bool classof(const Attr *A) { return A->getKind() == attr::PtGuardedVar; }
9784
};
9785
 
9786
class Ptr32Attr : public TypeAttr {
9787
public:
9788
  // Factory methods
9789
  static Ptr32Attr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
9790
  static Ptr32Attr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
9791
  static Ptr32Attr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9792
  static Ptr32Attr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9793
 
9794
  // Constructors
9795
  Ptr32Attr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
9796
             );
9797
 
9798
  Ptr32Attr *clone(ASTContext &C) const;
9799
  void printPretty(raw_ostream &OS,
9800
                   const PrintingPolicy &Policy) const;
9801
  const char *getSpelling() const;
9802
 
9803
 
9804
  static bool classof(const Attr *A) { return A->getKind() == attr::Ptr32; }
9805
};
9806
 
9807
class Ptr64Attr : public TypeAttr {
9808
public:
9809
  // Factory methods
9810
  static Ptr64Attr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
9811
  static Ptr64Attr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
9812
  static Ptr64Attr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9813
  static Ptr64Attr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9814
 
9815
  // Constructors
9816
  Ptr64Attr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
9817
             );
9818
 
9819
  Ptr64Attr *clone(ASTContext &C) const;
9820
  void printPretty(raw_ostream &OS,
9821
                   const PrintingPolicy &Policy) const;
9822
  const char *getSpelling() const;
9823
 
9824
 
9825
  static bool classof(const Attr *A) { return A->getKind() == attr::Ptr64; }
9826
};
9827
 
9828
class PureAttr : public InheritableAttr {
9829
public:
9830
  enum Spelling {
9831
    GNU_pure = 0,
9832
    CXX11_gnu_pure = 1,
9833
    C2x_gnu_pure = 2,
9834
  SpellingNotCalculated = 15
9835
 
9836
  };
9837
 
9838
  // Factory methods
9839
  static PureAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
9840
  static PureAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
9841
  static PureAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9842
  static PureAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9843
 
9844
  // Constructors
9845
  PureAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
9846
             );
9847
 
9848
  PureAttr *clone(ASTContext &C) const;
9849
  void printPretty(raw_ostream &OS,
9850
                   const PrintingPolicy &Policy) const;
9851
  const char *getSpelling() const;
9852
 
9853
 
9854
  static bool classof(const Attr *A) { return A->getKind() == attr::Pure; }
9855
};
9856
 
9857
class RISCVInterruptAttr : public InheritableAttr {
9858
public:
9859
  enum InterruptType {
9860
    user,
9861
    supervisor,
9862
    machine
9863
  };
9864
private:
9865
  InterruptType interrupt;
9866
 
9867
public:
9868
  enum Spelling {
9869
    GNU_interrupt = 0,
9870
    CXX11_gnu_interrupt = 1,
9871
    C2x_gnu_interrupt = 2,
9872
  SpellingNotCalculated = 15
9873
 
9874
  };
9875
 
9876
  // Factory methods
9877
  static RISCVInterruptAttr *CreateImplicit(ASTContext &Ctx, InterruptType Interrupt, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
9878
  static RISCVInterruptAttr *Create(ASTContext &Ctx, InterruptType Interrupt, const AttributeCommonInfo &CommonInfo);
9879
  static RISCVInterruptAttr *CreateImplicit(ASTContext &Ctx, InterruptType Interrupt, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9880
  static RISCVInterruptAttr *Create(ASTContext &Ctx, InterruptType Interrupt, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9881
 
9882
  // Constructors
9883
  RISCVInterruptAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
9884
              , InterruptType Interrupt
9885
             );
9886
  RISCVInterruptAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
9887
             );
9888
 
9889
  RISCVInterruptAttr *clone(ASTContext &C) const;
9890
  void printPretty(raw_ostream &OS,
9891
                   const PrintingPolicy &Policy) const;
9892
  const char *getSpelling() const;
9893
  InterruptType getInterrupt() const {
9894
    return interrupt;
9895
  }
9896
 
9897
  static bool ConvertStrToInterruptType(StringRef Val, InterruptType &Out);
9898
  static const char *ConvertInterruptTypeToStr(InterruptType Val);
9899
 
9900
 
9901
  static bool classof(const Attr *A) { return A->getKind() == attr::RISCVInterrupt; }
9902
};
9903
 
9904
class RandomizeLayoutAttr : public InheritableAttr {
9905
public:
9906
  enum Spelling {
9907
    GNU_randomize_layout = 0,
9908
    CXX11_gnu_randomize_layout = 1,
9909
    C2x_gnu_randomize_layout = 2,
9910
  SpellingNotCalculated = 15
9911
 
9912
  };
9913
 
9914
  // Factory methods
9915
  static RandomizeLayoutAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
9916
  static RandomizeLayoutAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
9917
  static RandomizeLayoutAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9918
  static RandomizeLayoutAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9919
 
9920
  // Constructors
9921
  RandomizeLayoutAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
9922
             );
9923
 
9924
  RandomizeLayoutAttr *clone(ASTContext &C) const;
9925
  void printPretty(raw_ostream &OS,
9926
                   const PrintingPolicy &Policy) const;
9927
  const char *getSpelling() const;
9928
 
9929
 
9930
  static bool classof(const Attr *A) { return A->getKind() == attr::RandomizeLayout; }
9931
};
9932
 
9933
class ReadOnlyPlacementAttr : public InheritableAttr {
9934
public:
9935
  enum Spelling {
9936
    GNU_enforce_read_only_placement = 0,
9937
    CXX11_clang_enforce_read_only_placement = 1,
9938
    C2x_clang_enforce_read_only_placement = 2,
9939
  SpellingNotCalculated = 15
9940
 
9941
  };
9942
 
9943
  // Factory methods
9944
  static ReadOnlyPlacementAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
9945
  static ReadOnlyPlacementAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
9946
  static ReadOnlyPlacementAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9947
  static ReadOnlyPlacementAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9948
 
9949
  // Constructors
9950
  ReadOnlyPlacementAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
9951
             );
9952
 
9953
  ReadOnlyPlacementAttr *clone(ASTContext &C) const;
9954
  void printPretty(raw_ostream &OS,
9955
                   const PrintingPolicy &Policy) const;
9956
  const char *getSpelling() const;
9957
 
9958
 
9959
  static bool classof(const Attr *A) { return A->getKind() == attr::ReadOnlyPlacement; }
9960
};
9961
 
9962
class RegCallAttr : public InheritableAttr {
9963
public:
9964
  enum Spelling {
9965
    GNU_regcall = 0,
9966
    CXX11_gnu_regcall = 1,
9967
    C2x_gnu_regcall = 2,
9968
    Keyword_regcall = 3,
9969
  SpellingNotCalculated = 15
9970
 
9971
  };
9972
 
9973
  // Factory methods
9974
  static RegCallAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
9975
  static RegCallAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
9976
  static RegCallAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9977
  static RegCallAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
9978
 
9979
  // Constructors
9980
  RegCallAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
9981
             );
9982
 
9983
  RegCallAttr *clone(ASTContext &C) const;
9984
  void printPretty(raw_ostream &OS,
9985
                   const PrintingPolicy &Policy) const;
9986
  const char *getSpelling() const;
9987
 
9988
 
9989
  static bool classof(const Attr *A) { return A->getKind() == attr::RegCall; }
9990
};
9991
 
9992
class ReinitializesAttr : public InheritableAttr {
9993
public:
9994
  enum Spelling {
9995
    GNU_reinitializes = 0,
9996
    CXX11_clang_reinitializes = 1,
9997
  SpellingNotCalculated = 15
9998
 
9999
  };
10000
 
10001
  // Factory methods
10002
  static ReinitializesAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
10003
  static ReinitializesAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
10004
  static ReinitializesAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10005
  static ReinitializesAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10006
 
10007
  // Constructors
10008
  ReinitializesAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
10009
             );
10010
 
10011
  ReinitializesAttr *clone(ASTContext &C) const;
10012
  void printPretty(raw_ostream &OS,
10013
                   const PrintingPolicy &Policy) const;
10014
  const char *getSpelling() const;
10015
 
10016
 
10017
  static bool classof(const Attr *A) { return A->getKind() == attr::Reinitializes; }
10018
};
10019
 
10020
class ReleaseCapabilityAttr : public InheritableAttr {
10021
  unsigned args_Size;
10022
  Expr * *args_;
10023
 
10024
public:
10025
  enum Spelling {
10026
    GNU_release_capability = 0,
10027
    CXX11_clang_release_capability = 1,
10028
    GNU_release_shared_capability = 2,
10029
    CXX11_clang_release_shared_capability = 3,
10030
    GNU_release_generic_capability = 4,
10031
    CXX11_clang_release_generic_capability = 5,
10032
    GNU_unlock_function = 6,
10033
    CXX11_clang_unlock_function = 7,
10034
  SpellingNotCalculated = 15
10035
 
10036
  };
10037
 
10038
  // Factory methods
10039
  static ReleaseCapabilityAttr *CreateImplicit(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
10040
  static ReleaseCapabilityAttr *Create(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo);
10041
  static ReleaseCapabilityAttr *CreateImplicit(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax, ReleaseCapabilityAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
10042
  static ReleaseCapabilityAttr *Create(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax, ReleaseCapabilityAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
10043
 
10044
  // Constructors
10045
  ReleaseCapabilityAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
10046
              , Expr * *Args, unsigned ArgsSize
10047
             );
10048
  ReleaseCapabilityAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
10049
             );
10050
 
10051
  ReleaseCapabilityAttr *clone(ASTContext &C) const;
10052
  void printPretty(raw_ostream &OS,
10053
                   const PrintingPolicy &Policy) const;
10054
  const char *getSpelling() const;
10055
  Spelling getSemanticSpelling() const;
10056
  bool isShared() const { return getAttributeSpellingListIndex() == 2 ||
10057
    getAttributeSpellingListIndex() == 3; }
10058
  bool isGeneric() const { return getAttributeSpellingListIndex() == 4 ||
10059
    getAttributeSpellingListIndex() == 5 ||
10060
    getAttributeSpellingListIndex() == 6 ||
10061
    getAttributeSpellingListIndex() == 7; }
10062
  typedef Expr ** args_iterator;
10063
  args_iterator args_begin() const { return args_; }
10064
  args_iterator args_end() const { return args_ + args_Size; }
10065
  unsigned args_size() const { return args_Size; }
10066
  llvm::iterator_range<args_iterator> args() const { return llvm::make_range(args_begin(), args_end()); }
10067
 
10068
 
10069
 
10070
 
10071
  static bool classof(const Attr *A) { return A->getKind() == attr::ReleaseCapability; }
10072
};
10073
 
10074
class ReleaseHandleAttr : public InheritableParamAttr {
10075
unsigned handleTypeLength;
10076
char *handleType;
10077
 
10078
public:
10079
  enum Spelling {
10080
    GNU_release_handle = 0,
10081
    CXX11_clang_release_handle = 1,
10082
    C2x_clang_release_handle = 2,
10083
  SpellingNotCalculated = 15
10084
 
10085
  };
10086
 
10087
  // Factory methods
10088
  static ReleaseHandleAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef HandleType, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
10089
  static ReleaseHandleAttr *Create(ASTContext &Ctx, llvm::StringRef HandleType, const AttributeCommonInfo &CommonInfo);
10090
  static ReleaseHandleAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef HandleType, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10091
  static ReleaseHandleAttr *Create(ASTContext &Ctx, llvm::StringRef HandleType, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10092
 
10093
  // Constructors
10094
  ReleaseHandleAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
10095
              , llvm::StringRef HandleType
10096
             );
10097
 
10098
  ReleaseHandleAttr *clone(ASTContext &C) const;
10099
  void printPretty(raw_ostream &OS,
10100
                   const PrintingPolicy &Policy) const;
10101
  const char *getSpelling() const;
10102
  llvm::StringRef getHandleType() const {
10103
    return llvm::StringRef(handleType, handleTypeLength);
10104
  }
10105
  unsigned getHandleTypeLength() const {
10106
    return handleTypeLength;
10107
  }
10108
  void setHandleType(ASTContext &C, llvm::StringRef S) {
10109
    handleTypeLength = S.size();
10110
    this->handleType = new (C, 1) char [handleTypeLength];
10111
    if (!S.empty())
10112
      std::memcpy(this->handleType, S.data(), handleTypeLength);
10113
  }
10114
 
10115
 
10116
 
10117
  static bool classof(const Attr *A) { return A->getKind() == attr::ReleaseHandle; }
10118
};
10119
 
10120
class RenderScriptKernelAttr : public Attr {
10121
public:
10122
  // Factory methods
10123
  static RenderScriptKernelAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
10124
  static RenderScriptKernelAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
10125
  static RenderScriptKernelAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10126
  static RenderScriptKernelAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10127
 
10128
  // Constructors
10129
  RenderScriptKernelAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
10130
             );
10131
 
10132
  RenderScriptKernelAttr *clone(ASTContext &C) const;
10133
  void printPretty(raw_ostream &OS,
10134
                   const PrintingPolicy &Policy) const;
10135
  const char *getSpelling() const;
10136
 
10137
 
10138
  static bool classof(const Attr *A) { return A->getKind() == attr::RenderScriptKernel; }
10139
};
10140
 
10141
class ReqdWorkGroupSizeAttr : public InheritableAttr {
10142
unsigned xDim;
10143
 
10144
unsigned yDim;
10145
 
10146
unsigned zDim;
10147
 
10148
public:
10149
  // Factory methods
10150
  static ReqdWorkGroupSizeAttr *CreateImplicit(ASTContext &Ctx, unsigned XDim, unsigned YDim, unsigned ZDim, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
10151
  static ReqdWorkGroupSizeAttr *Create(ASTContext &Ctx, unsigned XDim, unsigned YDim, unsigned ZDim, const AttributeCommonInfo &CommonInfo);
10152
  static ReqdWorkGroupSizeAttr *CreateImplicit(ASTContext &Ctx, unsigned XDim, unsigned YDim, unsigned ZDim, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10153
  static ReqdWorkGroupSizeAttr *Create(ASTContext &Ctx, unsigned XDim, unsigned YDim, unsigned ZDim, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10154
 
10155
  // Constructors
10156
  ReqdWorkGroupSizeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
10157
              , unsigned XDim
10158
              , unsigned YDim
10159
              , unsigned ZDim
10160
             );
10161
 
10162
  ReqdWorkGroupSizeAttr *clone(ASTContext &C) const;
10163
  void printPretty(raw_ostream &OS,
10164
                   const PrintingPolicy &Policy) const;
10165
  const char *getSpelling() const;
10166
  unsigned getXDim() const {
10167
    return xDim;
10168
  }
10169
 
10170
  unsigned getYDim() const {
10171
    return yDim;
10172
  }
10173
 
10174
  unsigned getZDim() const {
10175
    return zDim;
10176
  }
10177
 
10178
 
10179
 
10180
  static bool classof(const Attr *A) { return A->getKind() == attr::ReqdWorkGroupSize; }
10181
};
10182
 
10183
class RequiresCapabilityAttr : public InheritableAttr {
10184
  unsigned args_Size;
10185
  Expr * *args_;
10186
 
10187
public:
10188
  enum Spelling {
10189
    GNU_requires_capability = 0,
10190
    CXX11_clang_requires_capability = 1,
10191
    GNU_exclusive_locks_required = 2,
10192
    CXX11_clang_exclusive_locks_required = 3,
10193
    GNU_requires_shared_capability = 4,
10194
    CXX11_clang_requires_shared_capability = 5,
10195
    GNU_shared_locks_required = 6,
10196
    CXX11_clang_shared_locks_required = 7,
10197
  SpellingNotCalculated = 15
10198
 
10199
  };
10200
 
10201
  // Factory methods
10202
  static RequiresCapabilityAttr *CreateImplicit(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
10203
  static RequiresCapabilityAttr *Create(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo);
10204
  static RequiresCapabilityAttr *CreateImplicit(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax, RequiresCapabilityAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
10205
  static RequiresCapabilityAttr *Create(ASTContext &Ctx, Expr * *Args, unsigned ArgsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax, RequiresCapabilityAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
10206
 
10207
  // Constructors
10208
  RequiresCapabilityAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
10209
              , Expr * *Args, unsigned ArgsSize
10210
             );
10211
  RequiresCapabilityAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
10212
             );
10213
 
10214
  RequiresCapabilityAttr *clone(ASTContext &C) const;
10215
  void printPretty(raw_ostream &OS,
10216
                   const PrintingPolicy &Policy) const;
10217
  const char *getSpelling() const;
10218
  Spelling getSemanticSpelling() const;
10219
  bool isShared() const { return getAttributeSpellingListIndex() == 4 ||
10220
    getAttributeSpellingListIndex() == 5 ||
10221
    getAttributeSpellingListIndex() == 6 ||
10222
    getAttributeSpellingListIndex() == 7; }
10223
  typedef Expr ** args_iterator;
10224
  args_iterator args_begin() const { return args_; }
10225
  args_iterator args_end() const { return args_ + args_Size; }
10226
  unsigned args_size() const { return args_Size; }
10227
  llvm::iterator_range<args_iterator> args() const { return llvm::make_range(args_begin(), args_end()); }
10228
 
10229
 
10230
 
10231
 
10232
  static bool classof(const Attr *A) { return A->getKind() == attr::RequiresCapability; }
10233
};
10234
 
10235
class RestrictAttr : public InheritableAttr {
10236
public:
10237
  enum Spelling {
10238
    Declspec_restrict = 0,
10239
    GNU_malloc = 1,
10240
    CXX11_gnu_malloc = 2,
10241
    C2x_gnu_malloc = 3,
10242
  SpellingNotCalculated = 15
10243
 
10244
  };
10245
 
10246
  // Factory methods
10247
  static RestrictAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
10248
  static RestrictAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
10249
  static RestrictAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax, RestrictAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
10250
  static RestrictAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax, RestrictAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
10251
 
10252
  // Constructors
10253
  RestrictAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
10254
             );
10255
 
10256
  RestrictAttr *clone(ASTContext &C) const;
10257
  void printPretty(raw_ostream &OS,
10258
                   const PrintingPolicy &Policy) const;
10259
  const char *getSpelling() const;
10260
  Spelling getSemanticSpelling() const;
10261
 
10262
 
10263
  static bool classof(const Attr *A) { return A->getKind() == attr::Restrict; }
10264
};
10265
 
10266
class RetainAttr : public InheritableAttr {
10267
public:
10268
  enum Spelling {
10269
    GNU_retain = 0,
10270
    CXX11_gnu_retain = 1,
10271
    C2x_gnu_retain = 2,
10272
  SpellingNotCalculated = 15
10273
 
10274
  };
10275
 
10276
  // Factory methods
10277
  static RetainAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
10278
  static RetainAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
10279
  static RetainAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10280
  static RetainAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10281
 
10282
  // Constructors
10283
  RetainAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
10284
             );
10285
 
10286
  RetainAttr *clone(ASTContext &C) const;
10287
  void printPretty(raw_ostream &OS,
10288
                   const PrintingPolicy &Policy) const;
10289
  const char *getSpelling() const;
10290
 
10291
 
10292
  static bool classof(const Attr *A) { return A->getKind() == attr::Retain; }
10293
};
10294
 
10295
class ReturnTypestateAttr : public InheritableAttr {
10296
public:
10297
  enum ConsumedState {
10298
    Unknown,
10299
    Consumed,
10300
    Unconsumed
10301
  };
10302
private:
10303
  ConsumedState state;
10304
 
10305
public:
10306
  enum Spelling {
10307
    GNU_return_typestate = 0,
10308
    CXX11_clang_return_typestate = 1,
10309
  SpellingNotCalculated = 15
10310
 
10311
  };
10312
 
10313
  // Factory methods
10314
  static ReturnTypestateAttr *CreateImplicit(ASTContext &Ctx, ConsumedState State, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
10315
  static ReturnTypestateAttr *Create(ASTContext &Ctx, ConsumedState State, const AttributeCommonInfo &CommonInfo);
10316
  static ReturnTypestateAttr *CreateImplicit(ASTContext &Ctx, ConsumedState State, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10317
  static ReturnTypestateAttr *Create(ASTContext &Ctx, ConsumedState State, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10318
 
10319
  // Constructors
10320
  ReturnTypestateAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
10321
              , ConsumedState State
10322
             );
10323
 
10324
  ReturnTypestateAttr *clone(ASTContext &C) const;
10325
  void printPretty(raw_ostream &OS,
10326
                   const PrintingPolicy &Policy) const;
10327
  const char *getSpelling() const;
10328
  ConsumedState getState() const {
10329
    return state;
10330
  }
10331
 
10332
  static bool ConvertStrToConsumedState(StringRef Val, ConsumedState &Out);
10333
  static const char *ConvertConsumedStateToStr(ConsumedState Val);
10334
 
10335
 
10336
  static bool classof(const Attr *A) { return A->getKind() == attr::ReturnTypestate; }
10337
};
10338
 
10339
class ReturnsNonNullAttr : public InheritableAttr {
10340
public:
10341
  enum Spelling {
10342
    GNU_returns_nonnull = 0,
10343
    CXX11_gnu_returns_nonnull = 1,
10344
    C2x_gnu_returns_nonnull = 2,
10345
  SpellingNotCalculated = 15
10346
 
10347
  };
10348
 
10349
  // Factory methods
10350
  static ReturnsNonNullAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
10351
  static ReturnsNonNullAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
10352
  static ReturnsNonNullAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10353
  static ReturnsNonNullAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10354
 
10355
  // Constructors
10356
  ReturnsNonNullAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
10357
             );
10358
 
10359
  ReturnsNonNullAttr *clone(ASTContext &C) const;
10360
  void printPretty(raw_ostream &OS,
10361
                   const PrintingPolicy &Policy) const;
10362
  const char *getSpelling() const;
10363
 
10364
 
10365
  static bool classof(const Attr *A) { return A->getKind() == attr::ReturnsNonNull; }
10366
};
10367
 
10368
class ReturnsTwiceAttr : public InheritableAttr {
10369
public:
10370
  enum Spelling {
10371
    GNU_returns_twice = 0,
10372
    CXX11_gnu_returns_twice = 1,
10373
    C2x_gnu_returns_twice = 2,
10374
  SpellingNotCalculated = 15
10375
 
10376
  };
10377
 
10378
  // Factory methods
10379
  static ReturnsTwiceAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
10380
  static ReturnsTwiceAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
10381
  static ReturnsTwiceAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10382
  static ReturnsTwiceAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10383
 
10384
  // Constructors
10385
  ReturnsTwiceAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
10386
             );
10387
 
10388
  ReturnsTwiceAttr *clone(ASTContext &C) const;
10389
  void printPretty(raw_ostream &OS,
10390
                   const PrintingPolicy &Policy) const;
10391
  const char *getSpelling() const;
10392
 
10393
 
10394
  static bool classof(const Attr *A) { return A->getKind() == attr::ReturnsTwice; }
10395
};
10396
 
10397
class SPtrAttr : public TypeAttr {
10398
public:
10399
  // Factory methods
10400
  static SPtrAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
10401
  static SPtrAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
10402
  static SPtrAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10403
  static SPtrAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10404
 
10405
  // Constructors
10406
  SPtrAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
10407
             );
10408
 
10409
  SPtrAttr *clone(ASTContext &C) const;
10410
  void printPretty(raw_ostream &OS,
10411
                   const PrintingPolicy &Policy) const;
10412
  const char *getSpelling() const;
10413
 
10414
 
10415
  static bool classof(const Attr *A) { return A->getKind() == attr::SPtr; }
10416
};
10417
 
10418
class SYCLKernelAttr : public InheritableAttr {
10419
public:
10420
  enum Spelling {
10421
    GNU_sycl_kernel = 0,
10422
    CXX11_clang_sycl_kernel = 1,
10423
    C2x_clang_sycl_kernel = 2,
10424
  SpellingNotCalculated = 15
10425
 
10426
  };
10427
 
10428
  // Factory methods
10429
  static SYCLKernelAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
10430
  static SYCLKernelAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
10431
  static SYCLKernelAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10432
  static SYCLKernelAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10433
 
10434
  // Constructors
10435
  SYCLKernelAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
10436
             );
10437
 
10438
  SYCLKernelAttr *clone(ASTContext &C) const;
10439
  void printPretty(raw_ostream &OS,
10440
                   const PrintingPolicy &Policy) const;
10441
  const char *getSpelling() const;
10442
 
10443
 
10444
  static bool classof(const Attr *A) { return A->getKind() == attr::SYCLKernel; }
10445
};
10446
 
10447
class SYCLSpecialClassAttr : public InheritableAttr {
10448
public:
10449
  enum Spelling {
10450
    GNU_sycl_special_class = 0,
10451
    CXX11_clang_sycl_special_class = 1,
10452
    C2x_clang_sycl_special_class = 2,
10453
  SpellingNotCalculated = 15
10454
 
10455
  };
10456
 
10457
  // Factory methods
10458
  static SYCLSpecialClassAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
10459
  static SYCLSpecialClassAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
10460
  static SYCLSpecialClassAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10461
  static SYCLSpecialClassAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10462
 
10463
  // Constructors
10464
  SYCLSpecialClassAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
10465
             );
10466
 
10467
  SYCLSpecialClassAttr *clone(ASTContext &C) const;
10468
  void printPretty(raw_ostream &OS,
10469
                   const PrintingPolicy &Policy) const;
10470
  const char *getSpelling() const;
10471
 
10472
 
10473
  static bool classof(const Attr *A) { return A->getKind() == attr::SYCLSpecialClass; }
10474
};
10475
 
10476
class ScopedLockableAttr : public InheritableAttr {
10477
public:
10478
  enum Spelling {
10479
    GNU_scoped_lockable = 0,
10480
    CXX11_clang_scoped_lockable = 1,
10481
  SpellingNotCalculated = 15
10482
 
10483
  };
10484
 
10485
  // Factory methods
10486
  static ScopedLockableAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
10487
  static ScopedLockableAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
10488
  static ScopedLockableAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10489
  static ScopedLockableAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10490
 
10491
  // Constructors
10492
  ScopedLockableAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
10493
             );
10494
 
10495
  ScopedLockableAttr *clone(ASTContext &C) const;
10496
  void printPretty(raw_ostream &OS,
10497
                   const PrintingPolicy &Policy) const;
10498
  const char *getSpelling() const;
10499
 
10500
 
10501
  static bool classof(const Attr *A) { return A->getKind() == attr::ScopedLockable; }
10502
};
10503
 
10504
class SectionAttr : public InheritableAttr {
10505
unsigned nameLength;
10506
char *name;
10507
 
10508
public:
10509
  enum Spelling {
10510
    GNU_section = 0,
10511
    CXX11_gnu_section = 1,
10512
    C2x_gnu_section = 2,
10513
    Declspec_allocate = 3,
10514
  SpellingNotCalculated = 15
10515
 
10516
  };
10517
 
10518
  // Factory methods
10519
  static SectionAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Name, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
10520
  static SectionAttr *Create(ASTContext &Ctx, llvm::StringRef Name, const AttributeCommonInfo &CommonInfo);
10521
  static SectionAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Name, SourceRange Range, AttributeCommonInfo::Syntax Syntax, SectionAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
10522
  static SectionAttr *Create(ASTContext &Ctx, llvm::StringRef Name, SourceRange Range, AttributeCommonInfo::Syntax Syntax, SectionAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
10523
 
10524
  // Constructors
10525
  SectionAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
10526
              , llvm::StringRef Name
10527
             );
10528
 
10529
  SectionAttr *clone(ASTContext &C) const;
10530
  void printPretty(raw_ostream &OS,
10531
                   const PrintingPolicy &Policy) const;
10532
  const char *getSpelling() const;
10533
  Spelling getSemanticSpelling() const;
10534
  llvm::StringRef getName() const {
10535
    return llvm::StringRef(name, nameLength);
10536
  }
10537
  unsigned getNameLength() const {
10538
    return nameLength;
10539
  }
10540
  void setName(ASTContext &C, llvm::StringRef S) {
10541
    nameLength = S.size();
10542
    this->name = new (C, 1) char [nameLength];
10543
    if (!S.empty())
10544
      std::memcpy(this->name, S.data(), nameLength);
10545
  }
10546
 
10547
 
10548
 
10549
  static bool classof(const Attr *A) { return A->getKind() == attr::Section; }
10550
};
10551
 
10552
class SelectAnyAttr : public InheritableAttr {
10553
public:
10554
  enum Spelling {
10555
    Declspec_selectany = 0,
10556
    GNU_selectany = 1,
10557
    CXX11_gnu_selectany = 2,
10558
    C2x_gnu_selectany = 3,
10559
  SpellingNotCalculated = 15
10560
 
10561
  };
10562
 
10563
  // Factory methods
10564
  static SelectAnyAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
10565
  static SelectAnyAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
10566
  static SelectAnyAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10567
  static SelectAnyAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10568
 
10569
  // Constructors
10570
  SelectAnyAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
10571
             );
10572
 
10573
  SelectAnyAttr *clone(ASTContext &C) const;
10574
  void printPretty(raw_ostream &OS,
10575
                   const PrintingPolicy &Policy) const;
10576
  const char *getSpelling() const;
10577
 
10578
 
10579
  static bool classof(const Attr *A) { return A->getKind() == attr::SelectAny; }
10580
};
10581
 
10582
class SentinelAttr : public InheritableAttr {
10583
int sentinel;
10584
 
10585
int nullPos;
10586
 
10587
public:
10588
  enum Spelling {
10589
    GNU_sentinel = 0,
10590
    CXX11_gnu_sentinel = 1,
10591
    C2x_gnu_sentinel = 2,
10592
  SpellingNotCalculated = 15
10593
 
10594
  };
10595
 
10596
  // Factory methods
10597
  static SentinelAttr *CreateImplicit(ASTContext &Ctx, int Sentinel, int NullPos, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
10598
  static SentinelAttr *Create(ASTContext &Ctx, int Sentinel, int NullPos, const AttributeCommonInfo &CommonInfo);
10599
  static SentinelAttr *CreateImplicit(ASTContext &Ctx, int Sentinel, int NullPos, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10600
  static SentinelAttr *Create(ASTContext &Ctx, int Sentinel, int NullPos, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10601
 
10602
  // Constructors
10603
  SentinelAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
10604
              , int Sentinel
10605
              , int NullPos
10606
             );
10607
  SentinelAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
10608
             );
10609
 
10610
  SentinelAttr *clone(ASTContext &C) const;
10611
  void printPretty(raw_ostream &OS,
10612
                   const PrintingPolicy &Policy) const;
10613
  const char *getSpelling() const;
10614
  int getSentinel() const {
10615
    return sentinel;
10616
  }
10617
 
10618
  static const int DefaultSentinel = 0;
10619
 
10620
  int getNullPos() const {
10621
    return nullPos;
10622
  }
10623
 
10624
  static const int DefaultNullPos = 0;
10625
 
10626
 
10627
 
10628
  static bool classof(const Attr *A) { return A->getKind() == attr::Sentinel; }
10629
};
10630
 
10631
class SetTypestateAttr : public InheritableAttr {
10632
public:
10633
  enum ConsumedState {
10634
    Unknown,
10635
    Consumed,
10636
    Unconsumed
10637
  };
10638
private:
10639
  ConsumedState newState;
10640
 
10641
public:
10642
  enum Spelling {
10643
    GNU_set_typestate = 0,
10644
    CXX11_clang_set_typestate = 1,
10645
  SpellingNotCalculated = 15
10646
 
10647
  };
10648
 
10649
  // Factory methods
10650
  static SetTypestateAttr *CreateImplicit(ASTContext &Ctx, ConsumedState NewState, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
10651
  static SetTypestateAttr *Create(ASTContext &Ctx, ConsumedState NewState, const AttributeCommonInfo &CommonInfo);
10652
  static SetTypestateAttr *CreateImplicit(ASTContext &Ctx, ConsumedState NewState, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10653
  static SetTypestateAttr *Create(ASTContext &Ctx, ConsumedState NewState, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10654
 
10655
  // Constructors
10656
  SetTypestateAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
10657
              , ConsumedState NewState
10658
             );
10659
 
10660
  SetTypestateAttr *clone(ASTContext &C) const;
10661
  void printPretty(raw_ostream &OS,
10662
                   const PrintingPolicy &Policy) const;
10663
  const char *getSpelling() const;
10664
  ConsumedState getNewState() const {
10665
    return newState;
10666
  }
10667
 
10668
  static bool ConvertStrToConsumedState(StringRef Val, ConsumedState &Out);
10669
  static const char *ConvertConsumedStateToStr(ConsumedState Val);
10670
 
10671
 
10672
  static bool classof(const Attr *A) { return A->getKind() == attr::SetTypestate; }
10673
};
10674
 
10675
class SharedTrylockFunctionAttr : public InheritableAttr {
10676
Expr * successValue;
10677
 
10678
  unsigned args_Size;
10679
  Expr * *args_;
10680
 
10681
public:
10682
  // Factory methods
10683
  static SharedTrylockFunctionAttr *CreateImplicit(ASTContext &Ctx, Expr * SuccessValue, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
10684
  static SharedTrylockFunctionAttr *Create(ASTContext &Ctx, Expr * SuccessValue, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo);
10685
  static SharedTrylockFunctionAttr *CreateImplicit(ASTContext &Ctx, Expr * SuccessValue, Expr * *Args, unsigned ArgsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10686
  static SharedTrylockFunctionAttr *Create(ASTContext &Ctx, Expr * SuccessValue, Expr * *Args, unsigned ArgsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10687
 
10688
  // Constructors
10689
  SharedTrylockFunctionAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
10690
              , Expr * SuccessValue
10691
              , Expr * *Args, unsigned ArgsSize
10692
             );
10693
  SharedTrylockFunctionAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
10694
              , Expr * SuccessValue
10695
             );
10696
 
10697
  SharedTrylockFunctionAttr *clone(ASTContext &C) const;
10698
  void printPretty(raw_ostream &OS,
10699
                   const PrintingPolicy &Policy) const;
10700
  const char *getSpelling() const;
10701
  Expr * getSuccessValue() const {
10702
    return successValue;
10703
  }
10704
 
10705
  typedef Expr ** args_iterator;
10706
  args_iterator args_begin() const { return args_; }
10707
  args_iterator args_end() const { return args_ + args_Size; }
10708
  unsigned args_size() const { return args_Size; }
10709
  llvm::iterator_range<args_iterator> args() const { return llvm::make_range(args_begin(), args_end()); }
10710
 
10711
 
10712
 
10713
 
10714
  static bool classof(const Attr *A) { return A->getKind() == attr::SharedTrylockFunction; }
10715
};
10716
 
10717
class SpeculativeLoadHardeningAttr : public InheritableAttr {
10718
public:
10719
  enum Spelling {
10720
    GNU_speculative_load_hardening = 0,
10721
    CXX11_clang_speculative_load_hardening = 1,
10722
    C2x_clang_speculative_load_hardening = 2,
10723
  SpellingNotCalculated = 15
10724
 
10725
  };
10726
 
10727
  // Factory methods
10728
  static SpeculativeLoadHardeningAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
10729
  static SpeculativeLoadHardeningAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
10730
  static SpeculativeLoadHardeningAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10731
  static SpeculativeLoadHardeningAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10732
 
10733
  // Constructors
10734
  SpeculativeLoadHardeningAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
10735
             );
10736
 
10737
  SpeculativeLoadHardeningAttr *clone(ASTContext &C) const;
10738
  void printPretty(raw_ostream &OS,
10739
                   const PrintingPolicy &Policy) const;
10740
  const char *getSpelling() const;
10741
 
10742
 
10743
  static bool classof(const Attr *A) { return A->getKind() == attr::SpeculativeLoadHardening; }
10744
};
10745
 
10746
class StandaloneDebugAttr : public InheritableAttr {
10747
public:
10748
  enum Spelling {
10749
    GNU_standalone_debug = 0,
10750
    CXX11_clang_standalone_debug = 1,
10751
  SpellingNotCalculated = 15
10752
 
10753
  };
10754
 
10755
  // Factory methods
10756
  static StandaloneDebugAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
10757
  static StandaloneDebugAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
10758
  static StandaloneDebugAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10759
  static StandaloneDebugAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10760
 
10761
  // Constructors
10762
  StandaloneDebugAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
10763
             );
10764
 
10765
  StandaloneDebugAttr *clone(ASTContext &C) const;
10766
  void printPretty(raw_ostream &OS,
10767
                   const PrintingPolicy &Policy) const;
10768
  const char *getSpelling() const;
10769
 
10770
 
10771
  static bool classof(const Attr *A) { return A->getKind() == attr::StandaloneDebug; }
10772
};
10773
 
10774
class StdCallAttr : public InheritableAttr {
10775
public:
10776
  enum Spelling {
10777
    GNU_stdcall = 0,
10778
    CXX11_gnu_stdcall = 1,
10779
    C2x_gnu_stdcall = 2,
10780
    Keyword_stdcall = 3,
10781
  SpellingNotCalculated = 15
10782
 
10783
  };
10784
 
10785
  // Factory methods
10786
  static StdCallAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
10787
  static StdCallAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
10788
  static StdCallAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10789
  static StdCallAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10790
 
10791
  // Constructors
10792
  StdCallAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
10793
             );
10794
 
10795
  StdCallAttr *clone(ASTContext &C) const;
10796
  void printPretty(raw_ostream &OS,
10797
                   const PrintingPolicy &Policy) const;
10798
  const char *getSpelling() const;
10799
 
10800
 
10801
  static bool classof(const Attr *A) { return A->getKind() == attr::StdCall; }
10802
};
10803
 
10804
class StrictFPAttr : public InheritableAttr {
10805
public:
10806
  // Factory methods
10807
  static StrictFPAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
10808
  static StrictFPAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
10809
  static StrictFPAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10810
  static StrictFPAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10811
 
10812
  // Constructors
10813
  StrictFPAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
10814
             );
10815
 
10816
  StrictFPAttr *clone(ASTContext &C) const;
10817
  void printPretty(raw_ostream &OS,
10818
                   const PrintingPolicy &Policy) const;
10819
  const char *getSpelling() const;
10820
 
10821
 
10822
  static bool classof(const Attr *A) { return A->getKind() == attr::StrictFP; }
10823
};
10824
 
10825
class StrictGuardStackCheckAttr : public InheritableAttr {
10826
public:
10827
  // Factory methods
10828
  static StrictGuardStackCheckAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
10829
  static StrictGuardStackCheckAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
10830
  static StrictGuardStackCheckAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10831
  static StrictGuardStackCheckAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10832
 
10833
  // Constructors
10834
  StrictGuardStackCheckAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
10835
             );
10836
 
10837
  StrictGuardStackCheckAttr *clone(ASTContext &C) const;
10838
  void printPretty(raw_ostream &OS,
10839
                   const PrintingPolicy &Policy) const;
10840
  const char *getSpelling() const;
10841
 
10842
 
10843
  static bool classof(const Attr *A) { return A->getKind() == attr::StrictGuardStackCheck; }
10844
};
10845
 
10846
class SuppressAttr : public StmtAttr {
10847
  unsigned diagnosticIdentifiers_Size;
10848
  StringRef *diagnosticIdentifiers_;
10849
 
10850
public:
10851
  // Factory methods
10852
  static SuppressAttr *CreateImplicit(ASTContext &Ctx, StringRef *DiagnosticIdentifiers, unsigned DiagnosticIdentifiersSize, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
10853
  static SuppressAttr *Create(ASTContext &Ctx, StringRef *DiagnosticIdentifiers, unsigned DiagnosticIdentifiersSize, const AttributeCommonInfo &CommonInfo);
10854
  static SuppressAttr *CreateImplicit(ASTContext &Ctx, StringRef *DiagnosticIdentifiers, unsigned DiagnosticIdentifiersSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10855
  static SuppressAttr *Create(ASTContext &Ctx, StringRef *DiagnosticIdentifiers, unsigned DiagnosticIdentifiersSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10856
 
10857
  // Constructors
10858
  SuppressAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
10859
              , StringRef *DiagnosticIdentifiers, unsigned DiagnosticIdentifiersSize
10860
             );
10861
  SuppressAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
10862
             );
10863
 
10864
  SuppressAttr *clone(ASTContext &C) const;
10865
  void printPretty(raw_ostream &OS,
10866
                   const PrintingPolicy &Policy) const;
10867
  const char *getSpelling() const;
10868
  typedef StringRef* diagnosticIdentifiers_iterator;
10869
  diagnosticIdentifiers_iterator diagnosticIdentifiers_begin() const { return diagnosticIdentifiers_; }
10870
  diagnosticIdentifiers_iterator diagnosticIdentifiers_end() const { return diagnosticIdentifiers_ + diagnosticIdentifiers_Size; }
10871
  unsigned diagnosticIdentifiers_size() const { return diagnosticIdentifiers_Size; }
10872
  llvm::iterator_range<diagnosticIdentifiers_iterator> diagnosticIdentifiers() const { return llvm::make_range(diagnosticIdentifiers_begin(), diagnosticIdentifiers_end()); }
10873
 
10874
 
10875
 
10876
 
10877
  static bool classof(const Attr *A) { return A->getKind() == attr::Suppress; }
10878
};
10879
 
10880
class SwiftAsyncAttr : public InheritableAttr {
10881
public:
10882
  enum Kind {
10883
    None,
10884
    SwiftPrivate,
10885
    NotSwiftPrivate
10886
  };
10887
private:
10888
  Kind kind;
10889
 
10890
ParamIdx completionHandlerIndex;
10891
 
10892
public:
10893
  enum Spelling {
10894
    GNU_swift_async = 0,
10895
    CXX11_clang_swift_async = 1,
10896
    C2x_clang_swift_async = 2,
10897
  SpellingNotCalculated = 15
10898
 
10899
  };
10900
 
10901
  // Factory methods
10902
  static SwiftAsyncAttr *CreateImplicit(ASTContext &Ctx, Kind Kind, ParamIdx CompletionHandlerIndex, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
10903
  static SwiftAsyncAttr *Create(ASTContext &Ctx, Kind Kind, ParamIdx CompletionHandlerIndex, const AttributeCommonInfo &CommonInfo);
10904
  static SwiftAsyncAttr *CreateImplicit(ASTContext &Ctx, Kind Kind, ParamIdx CompletionHandlerIndex, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10905
  static SwiftAsyncAttr *Create(ASTContext &Ctx, Kind Kind, ParamIdx CompletionHandlerIndex, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10906
 
10907
  // Constructors
10908
  SwiftAsyncAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
10909
              , Kind Kind
10910
              , ParamIdx CompletionHandlerIndex
10911
             );
10912
  SwiftAsyncAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
10913
              , Kind Kind
10914
             );
10915
 
10916
  SwiftAsyncAttr *clone(ASTContext &C) const;
10917
  void printPretty(raw_ostream &OS,
10918
                   const PrintingPolicy &Policy) const;
10919
  const char *getSpelling() const;
10920
  Kind getKind() const {
10921
    return kind;
10922
  }
10923
 
10924
  static bool ConvertStrToKind(StringRef Val, Kind &Out);
10925
  static const char *ConvertKindToStr(Kind Val);
10926
  ParamIdx getCompletionHandlerIndex() const {
10927
    return completionHandlerIndex;
10928
  }
10929
 
10930
 
10931
 
10932
  static bool classof(const Attr *A) { return A->getKind() == attr::SwiftAsync; }
10933
};
10934
 
10935
class SwiftAsyncCallAttr : public InheritableAttr {
10936
public:
10937
  enum Spelling {
10938
    GNU_swiftasynccall = 0,
10939
    CXX11_clang_swiftasynccall = 1,
10940
    C2x_clang_swiftasynccall = 2,
10941
  SpellingNotCalculated = 15
10942
 
10943
  };
10944
 
10945
  // Factory methods
10946
  static SwiftAsyncCallAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
10947
  static SwiftAsyncCallAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
10948
  static SwiftAsyncCallAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10949
  static SwiftAsyncCallAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10950
 
10951
  // Constructors
10952
  SwiftAsyncCallAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
10953
             );
10954
 
10955
  SwiftAsyncCallAttr *clone(ASTContext &C) const;
10956
  void printPretty(raw_ostream &OS,
10957
                   const PrintingPolicy &Policy) const;
10958
  const char *getSpelling() const;
10959
 
10960
 
10961
  static bool classof(const Attr *A) { return A->getKind() == attr::SwiftAsyncCall; }
10962
};
10963
 
10964
class SwiftAsyncContextAttr : public ParameterABIAttr {
10965
public:
10966
  enum Spelling {
10967
    GNU_swift_async_context = 0,
10968
    CXX11_clang_swift_async_context = 1,
10969
    C2x_clang_swift_async_context = 2,
10970
  SpellingNotCalculated = 15
10971
 
10972
  };
10973
 
10974
  // Factory methods
10975
  static SwiftAsyncContextAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
10976
  static SwiftAsyncContextAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
10977
  static SwiftAsyncContextAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10978
  static SwiftAsyncContextAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
10979
 
10980
  // Constructors
10981
  SwiftAsyncContextAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
10982
             );
10983
 
10984
  SwiftAsyncContextAttr *clone(ASTContext &C) const;
10985
  void printPretty(raw_ostream &OS,
10986
                   const PrintingPolicy &Policy) const;
10987
  const char *getSpelling() const;
10988
 
10989
 
10990
  static bool classof(const Attr *A) { return A->getKind() == attr::SwiftAsyncContext; }
10991
};
10992
 
10993
class SwiftAsyncErrorAttr : public InheritableAttr {
10994
public:
10995
  enum ConventionKind {
10996
    None,
10997
    NonNullError,
10998
    ZeroArgument,
10999
    NonZeroArgument
11000
  };
11001
private:
11002
  ConventionKind convention;
11003
 
11004
unsigned handlerParamIdx;
11005
 
11006
public:
11007
  enum Spelling {
11008
    GNU_swift_async_error = 0,
11009
    CXX11_clang_swift_async_error = 1,
11010
    C2x_clang_swift_async_error = 2,
11011
  SpellingNotCalculated = 15
11012
 
11013
  };
11014
 
11015
  // Factory methods
11016
  static SwiftAsyncErrorAttr *CreateImplicit(ASTContext &Ctx, ConventionKind Convention, unsigned HandlerParamIdx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
11017
  static SwiftAsyncErrorAttr *Create(ASTContext &Ctx, ConventionKind Convention, unsigned HandlerParamIdx, const AttributeCommonInfo &CommonInfo);
11018
  static SwiftAsyncErrorAttr *CreateImplicit(ASTContext &Ctx, ConventionKind Convention, unsigned HandlerParamIdx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11019
  static SwiftAsyncErrorAttr *Create(ASTContext &Ctx, ConventionKind Convention, unsigned HandlerParamIdx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11020
 
11021
  // Constructors
11022
  SwiftAsyncErrorAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
11023
              , ConventionKind Convention
11024
              , unsigned HandlerParamIdx
11025
             );
11026
  SwiftAsyncErrorAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
11027
              , ConventionKind Convention
11028
             );
11029
 
11030
  SwiftAsyncErrorAttr *clone(ASTContext &C) const;
11031
  void printPretty(raw_ostream &OS,
11032
                   const PrintingPolicy &Policy) const;
11033
  const char *getSpelling() const;
11034
  ConventionKind getConvention() const {
11035
    return convention;
11036
  }
11037
 
11038
  static bool ConvertStrToConventionKind(StringRef Val, ConventionKind &Out);
11039
  static const char *ConvertConventionKindToStr(ConventionKind Val);
11040
  unsigned getHandlerParamIdx() const {
11041
    return handlerParamIdx;
11042
  }
11043
 
11044
 
11045
 
11046
  static bool classof(const Attr *A) { return A->getKind() == attr::SwiftAsyncError; }
11047
};
11048
 
11049
class SwiftAsyncNameAttr : public InheritableAttr {
11050
unsigned nameLength;
11051
char *name;
11052
 
11053
public:
11054
  // Factory methods
11055
  static SwiftAsyncNameAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Name, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
11056
  static SwiftAsyncNameAttr *Create(ASTContext &Ctx, llvm::StringRef Name, const AttributeCommonInfo &CommonInfo);
11057
  static SwiftAsyncNameAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Name, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11058
  static SwiftAsyncNameAttr *Create(ASTContext &Ctx, llvm::StringRef Name, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11059
 
11060
  // Constructors
11061
  SwiftAsyncNameAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
11062
              , llvm::StringRef Name
11063
             );
11064
 
11065
  SwiftAsyncNameAttr *clone(ASTContext &C) const;
11066
  void printPretty(raw_ostream &OS,
11067
                   const PrintingPolicy &Policy) const;
11068
  const char *getSpelling() const;
11069
  llvm::StringRef getName() const {
11070
    return llvm::StringRef(name, nameLength);
11071
  }
11072
  unsigned getNameLength() const {
11073
    return nameLength;
11074
  }
11075
  void setName(ASTContext &C, llvm::StringRef S) {
11076
    nameLength = S.size();
11077
    this->name = new (C, 1) char [nameLength];
11078
    if (!S.empty())
11079
      std::memcpy(this->name, S.data(), nameLength);
11080
  }
11081
 
11082
 
11083
 
11084
  static bool classof(const Attr *A) { return A->getKind() == attr::SwiftAsyncName; }
11085
};
11086
 
11087
class SwiftAttrAttr : public InheritableAttr {
11088
unsigned attributeLength;
11089
char *attribute;
11090
 
11091
public:
11092
  // Factory methods
11093
  static SwiftAttrAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Attribute, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
11094
  static SwiftAttrAttr *Create(ASTContext &Ctx, llvm::StringRef Attribute, const AttributeCommonInfo &CommonInfo);
11095
  static SwiftAttrAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Attribute, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11096
  static SwiftAttrAttr *Create(ASTContext &Ctx, llvm::StringRef Attribute, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11097
 
11098
  // Constructors
11099
  SwiftAttrAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
11100
              , llvm::StringRef Attribute
11101
             );
11102
 
11103
  SwiftAttrAttr *clone(ASTContext &C) const;
11104
  void printPretty(raw_ostream &OS,
11105
                   const PrintingPolicy &Policy) const;
11106
  const char *getSpelling() const;
11107
  llvm::StringRef getAttribute() const {
11108
    return llvm::StringRef(attribute, attributeLength);
11109
  }
11110
  unsigned getAttributeLength() const {
11111
    return attributeLength;
11112
  }
11113
  void setAttribute(ASTContext &C, llvm::StringRef S) {
11114
    attributeLength = S.size();
11115
    this->attribute = new (C, 1) char [attributeLength];
11116
    if (!S.empty())
11117
      std::memcpy(this->attribute, S.data(), attributeLength);
11118
  }
11119
 
11120
 
11121
 
11122
  static bool classof(const Attr *A) { return A->getKind() == attr::SwiftAttr; }
11123
};
11124
 
11125
class SwiftBridgeAttr : public InheritableAttr {
11126
unsigned swiftTypeLength;
11127
char *swiftType;
11128
 
11129
public:
11130
  // Factory methods
11131
  static SwiftBridgeAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef SwiftType, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
11132
  static SwiftBridgeAttr *Create(ASTContext &Ctx, llvm::StringRef SwiftType, const AttributeCommonInfo &CommonInfo);
11133
  static SwiftBridgeAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef SwiftType, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11134
  static SwiftBridgeAttr *Create(ASTContext &Ctx, llvm::StringRef SwiftType, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11135
 
11136
  // Constructors
11137
  SwiftBridgeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
11138
              , llvm::StringRef SwiftType
11139
             );
11140
 
11141
  SwiftBridgeAttr *clone(ASTContext &C) const;
11142
  void printPretty(raw_ostream &OS,
11143
                   const PrintingPolicy &Policy) const;
11144
  const char *getSpelling() const;
11145
  llvm::StringRef getSwiftType() const {
11146
    return llvm::StringRef(swiftType, swiftTypeLength);
11147
  }
11148
  unsigned getSwiftTypeLength() const {
11149
    return swiftTypeLength;
11150
  }
11151
  void setSwiftType(ASTContext &C, llvm::StringRef S) {
11152
    swiftTypeLength = S.size();
11153
    this->swiftType = new (C, 1) char [swiftTypeLength];
11154
    if (!S.empty())
11155
      std::memcpy(this->swiftType, S.data(), swiftTypeLength);
11156
  }
11157
 
11158
 
11159
 
11160
  static bool classof(const Attr *A) { return A->getKind() == attr::SwiftBridge; }
11161
};
11162
 
11163
class SwiftBridgedTypedefAttr : public InheritableAttr {
11164
public:
11165
  // Factory methods
11166
  static SwiftBridgedTypedefAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
11167
  static SwiftBridgedTypedefAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
11168
  static SwiftBridgedTypedefAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11169
  static SwiftBridgedTypedefAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11170
 
11171
  // Constructors
11172
  SwiftBridgedTypedefAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
11173
             );
11174
 
11175
  SwiftBridgedTypedefAttr *clone(ASTContext &C) const;
11176
  void printPretty(raw_ostream &OS,
11177
                   const PrintingPolicy &Policy) const;
11178
  const char *getSpelling() const;
11179
 
11180
 
11181
  static bool classof(const Attr *A) { return A->getKind() == attr::SwiftBridgedTypedef; }
11182
};
11183
 
11184
class SwiftCallAttr : public InheritableAttr {
11185
public:
11186
  enum Spelling {
11187
    GNU_swiftcall = 0,
11188
    CXX11_clang_swiftcall = 1,
11189
    C2x_clang_swiftcall = 2,
11190
  SpellingNotCalculated = 15
11191
 
11192
  };
11193
 
11194
  // Factory methods
11195
  static SwiftCallAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
11196
  static SwiftCallAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
11197
  static SwiftCallAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11198
  static SwiftCallAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11199
 
11200
  // Constructors
11201
  SwiftCallAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
11202
             );
11203
 
11204
  SwiftCallAttr *clone(ASTContext &C) const;
11205
  void printPretty(raw_ostream &OS,
11206
                   const PrintingPolicy &Policy) const;
11207
  const char *getSpelling() const;
11208
 
11209
 
11210
  static bool classof(const Attr *A) { return A->getKind() == attr::SwiftCall; }
11211
};
11212
 
11213
class SwiftContextAttr : public ParameterABIAttr {
11214
public:
11215
  enum Spelling {
11216
    GNU_swift_context = 0,
11217
    CXX11_clang_swift_context = 1,
11218
    C2x_clang_swift_context = 2,
11219
  SpellingNotCalculated = 15
11220
 
11221
  };
11222
 
11223
  // Factory methods
11224
  static SwiftContextAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
11225
  static SwiftContextAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
11226
  static SwiftContextAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11227
  static SwiftContextAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11228
 
11229
  // Constructors
11230
  SwiftContextAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
11231
             );
11232
 
11233
  SwiftContextAttr *clone(ASTContext &C) const;
11234
  void printPretty(raw_ostream &OS,
11235
                   const PrintingPolicy &Policy) const;
11236
  const char *getSpelling() const;
11237
 
11238
 
11239
  static bool classof(const Attr *A) { return A->getKind() == attr::SwiftContext; }
11240
};
11241
 
11242
class SwiftErrorAttr : public InheritableAttr {
11243
public:
11244
  enum ConventionKind {
11245
    None,
11246
    NonNullError,
11247
    NullResult,
11248
    ZeroResult,
11249
    NonZeroResult
11250
  };
11251
private:
11252
  ConventionKind convention;
11253
 
11254
public:
11255
  // Factory methods
11256
  static SwiftErrorAttr *CreateImplicit(ASTContext &Ctx, ConventionKind Convention, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
11257
  static SwiftErrorAttr *Create(ASTContext &Ctx, ConventionKind Convention, const AttributeCommonInfo &CommonInfo);
11258
  static SwiftErrorAttr *CreateImplicit(ASTContext &Ctx, ConventionKind Convention, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11259
  static SwiftErrorAttr *Create(ASTContext &Ctx, ConventionKind Convention, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11260
 
11261
  // Constructors
11262
  SwiftErrorAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
11263
              , ConventionKind Convention
11264
             );
11265
 
11266
  SwiftErrorAttr *clone(ASTContext &C) const;
11267
  void printPretty(raw_ostream &OS,
11268
                   const PrintingPolicy &Policy) const;
11269
  const char *getSpelling() const;
11270
  ConventionKind getConvention() const {
11271
    return convention;
11272
  }
11273
 
11274
  static bool ConvertStrToConventionKind(StringRef Val, ConventionKind &Out);
11275
  static const char *ConvertConventionKindToStr(ConventionKind Val);
11276
 
11277
 
11278
  static bool classof(const Attr *A) { return A->getKind() == attr::SwiftError; }
11279
};
11280
 
11281
class SwiftErrorResultAttr : public ParameterABIAttr {
11282
public:
11283
  enum Spelling {
11284
    GNU_swift_error_result = 0,
11285
    CXX11_clang_swift_error_result = 1,
11286
    C2x_clang_swift_error_result = 2,
11287
  SpellingNotCalculated = 15
11288
 
11289
  };
11290
 
11291
  // Factory methods
11292
  static SwiftErrorResultAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
11293
  static SwiftErrorResultAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
11294
  static SwiftErrorResultAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11295
  static SwiftErrorResultAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11296
 
11297
  // Constructors
11298
  SwiftErrorResultAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
11299
             );
11300
 
11301
  SwiftErrorResultAttr *clone(ASTContext &C) const;
11302
  void printPretty(raw_ostream &OS,
11303
                   const PrintingPolicy &Policy) const;
11304
  const char *getSpelling() const;
11305
 
11306
 
11307
  static bool classof(const Attr *A) { return A->getKind() == attr::SwiftErrorResult; }
11308
};
11309
 
11310
class SwiftIndirectResultAttr : public ParameterABIAttr {
11311
public:
11312
  enum Spelling {
11313
    GNU_swift_indirect_result = 0,
11314
    CXX11_clang_swift_indirect_result = 1,
11315
    C2x_clang_swift_indirect_result = 2,
11316
  SpellingNotCalculated = 15
11317
 
11318
  };
11319
 
11320
  // Factory methods
11321
  static SwiftIndirectResultAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
11322
  static SwiftIndirectResultAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
11323
  static SwiftIndirectResultAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11324
  static SwiftIndirectResultAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11325
 
11326
  // Constructors
11327
  SwiftIndirectResultAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
11328
             );
11329
 
11330
  SwiftIndirectResultAttr *clone(ASTContext &C) const;
11331
  void printPretty(raw_ostream &OS,
11332
                   const PrintingPolicy &Policy) const;
11333
  const char *getSpelling() const;
11334
 
11335
 
11336
  static bool classof(const Attr *A) { return A->getKind() == attr::SwiftIndirectResult; }
11337
};
11338
 
11339
class SwiftNameAttr : public InheritableAttr {
11340
unsigned nameLength;
11341
char *name;
11342
 
11343
public:
11344
  // Factory methods
11345
  static SwiftNameAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Name, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
11346
  static SwiftNameAttr *Create(ASTContext &Ctx, llvm::StringRef Name, const AttributeCommonInfo &CommonInfo);
11347
  static SwiftNameAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Name, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11348
  static SwiftNameAttr *Create(ASTContext &Ctx, llvm::StringRef Name, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11349
 
11350
  // Constructors
11351
  SwiftNameAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
11352
              , llvm::StringRef Name
11353
             );
11354
 
11355
  SwiftNameAttr *clone(ASTContext &C) const;
11356
  void printPretty(raw_ostream &OS,
11357
                   const PrintingPolicy &Policy) const;
11358
  const char *getSpelling() const;
11359
  llvm::StringRef getName() const {
11360
    return llvm::StringRef(name, nameLength);
11361
  }
11362
  unsigned getNameLength() const {
11363
    return nameLength;
11364
  }
11365
  void setName(ASTContext &C, llvm::StringRef S) {
11366
    nameLength = S.size();
11367
    this->name = new (C, 1) char [nameLength];
11368
    if (!S.empty())
11369
      std::memcpy(this->name, S.data(), nameLength);
11370
  }
11371
 
11372
 
11373
 
11374
  static bool classof(const Attr *A) { return A->getKind() == attr::SwiftName; }
11375
};
11376
 
11377
class SwiftNewTypeAttr : public InheritableAttr {
11378
public:
11379
  enum NewtypeKind {
11380
    NK_Struct,
11381
    NK_Enum
11382
  };
11383
private:
11384
  NewtypeKind newtypeKind;
11385
 
11386
public:
11387
  enum Spelling {
11388
    GNU_swift_newtype = 0,
11389
    GNU_swift_wrapper = 1,
11390
  SpellingNotCalculated = 15
11391
 
11392
  };
11393
 
11394
  // Factory methods
11395
  static SwiftNewTypeAttr *CreateImplicit(ASTContext &Ctx, NewtypeKind NewtypeKind, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
11396
  static SwiftNewTypeAttr *Create(ASTContext &Ctx, NewtypeKind NewtypeKind, const AttributeCommonInfo &CommonInfo);
11397
  static SwiftNewTypeAttr *CreateImplicit(ASTContext &Ctx, NewtypeKind NewtypeKind, SourceRange Range, AttributeCommonInfo::Syntax Syntax, SwiftNewTypeAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
11398
  static SwiftNewTypeAttr *Create(ASTContext &Ctx, NewtypeKind NewtypeKind, SourceRange Range, AttributeCommonInfo::Syntax Syntax, SwiftNewTypeAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
11399
 
11400
  // Constructors
11401
  SwiftNewTypeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
11402
              , NewtypeKind NewtypeKind
11403
             );
11404
 
11405
  SwiftNewTypeAttr *clone(ASTContext &C) const;
11406
  void printPretty(raw_ostream &OS,
11407
                   const PrintingPolicy &Policy) const;
11408
  const char *getSpelling() const;
11409
  Spelling getSemanticSpelling() const;
11410
  NewtypeKind getNewtypeKind() const {
11411
    return newtypeKind;
11412
  }
11413
 
11414
  static bool ConvertStrToNewtypeKind(StringRef Val, NewtypeKind &Out);
11415
  static const char *ConvertNewtypeKindToStr(NewtypeKind Val);
11416
 
11417
 
11418
  static bool classof(const Attr *A) { return A->getKind() == attr::SwiftNewType; }
11419
};
11420
 
11421
class SwiftObjCMembersAttr : public Attr {
11422
public:
11423
  // Factory methods
11424
  static SwiftObjCMembersAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
11425
  static SwiftObjCMembersAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
11426
  static SwiftObjCMembersAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11427
  static SwiftObjCMembersAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11428
 
11429
  // Constructors
11430
  SwiftObjCMembersAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
11431
             );
11432
 
11433
  SwiftObjCMembersAttr *clone(ASTContext &C) const;
11434
  void printPretty(raw_ostream &OS,
11435
                   const PrintingPolicy &Policy) const;
11436
  const char *getSpelling() const;
11437
 
11438
 
11439
  static bool classof(const Attr *A) { return A->getKind() == attr::SwiftObjCMembers; }
11440
};
11441
 
11442
class SwiftPrivateAttr : public InheritableAttr {
11443
public:
11444
  // Factory methods
11445
  static SwiftPrivateAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
11446
  static SwiftPrivateAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
11447
  static SwiftPrivateAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11448
  static SwiftPrivateAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11449
 
11450
  // Constructors
11451
  SwiftPrivateAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
11452
             );
11453
 
11454
  SwiftPrivateAttr *clone(ASTContext &C) const;
11455
  void printPretty(raw_ostream &OS,
11456
                   const PrintingPolicy &Policy) const;
11457
  const char *getSpelling() const;
11458
 
11459
 
11460
  static bool classof(const Attr *A) { return A->getKind() == attr::SwiftPrivate; }
11461
};
11462
 
11463
class SysVABIAttr : public InheritableAttr {
11464
public:
11465
  enum Spelling {
11466
    GNU_sysv_abi = 0,
11467
    CXX11_gnu_sysv_abi = 1,
11468
    C2x_gnu_sysv_abi = 2,
11469
  SpellingNotCalculated = 15
11470
 
11471
  };
11472
 
11473
  // Factory methods
11474
  static SysVABIAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
11475
  static SysVABIAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
11476
  static SysVABIAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11477
  static SysVABIAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11478
 
11479
  // Constructors
11480
  SysVABIAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
11481
             );
11482
 
11483
  SysVABIAttr *clone(ASTContext &C) const;
11484
  void printPretty(raw_ostream &OS,
11485
                   const PrintingPolicy &Policy) const;
11486
  const char *getSpelling() const;
11487
 
11488
 
11489
  static bool classof(const Attr *A) { return A->getKind() == attr::SysVABI; }
11490
};
11491
 
11492
class TLSModelAttr : public InheritableAttr {
11493
unsigned modelLength;
11494
char *model;
11495
 
11496
public:
11497
  enum Spelling {
11498
    GNU_tls_model = 0,
11499
    CXX11_gnu_tls_model = 1,
11500
    C2x_gnu_tls_model = 2,
11501
  SpellingNotCalculated = 15
11502
 
11503
  };
11504
 
11505
  // Factory methods
11506
  static TLSModelAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Model, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
11507
  static TLSModelAttr *Create(ASTContext &Ctx, llvm::StringRef Model, const AttributeCommonInfo &CommonInfo);
11508
  static TLSModelAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Model, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11509
  static TLSModelAttr *Create(ASTContext &Ctx, llvm::StringRef Model, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11510
 
11511
  // Constructors
11512
  TLSModelAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
11513
              , llvm::StringRef Model
11514
             );
11515
 
11516
  TLSModelAttr *clone(ASTContext &C) const;
11517
  void printPretty(raw_ostream &OS,
11518
                   const PrintingPolicy &Policy) const;
11519
  const char *getSpelling() const;
11520
  llvm::StringRef getModel() const {
11521
    return llvm::StringRef(model, modelLength);
11522
  }
11523
  unsigned getModelLength() const {
11524
    return modelLength;
11525
  }
11526
  void setModel(ASTContext &C, llvm::StringRef S) {
11527
    modelLength = S.size();
11528
    this->model = new (C, 1) char [modelLength];
11529
    if (!S.empty())
11530
      std::memcpy(this->model, S.data(), modelLength);
11531
  }
11532
 
11533
 
11534
 
11535
  static bool classof(const Attr *A) { return A->getKind() == attr::TLSModel; }
11536
};
11537
 
11538
class TargetAttr : public InheritableAttr {
11539
unsigned featuresStrLength;
11540
char *featuresStr;
11541
 
11542
public:
11543
  enum Spelling {
11544
    GNU_target = 0,
11545
    CXX11_gnu_target = 1,
11546
    C2x_gnu_target = 2,
11547
  SpellingNotCalculated = 15
11548
 
11549
  };
11550
 
11551
  // Factory methods
11552
  static TargetAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef FeaturesStr, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
11553
  static TargetAttr *Create(ASTContext &Ctx, llvm::StringRef FeaturesStr, const AttributeCommonInfo &CommonInfo);
11554
  static TargetAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef FeaturesStr, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11555
  static TargetAttr *Create(ASTContext &Ctx, llvm::StringRef FeaturesStr, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11556
 
11557
  // Constructors
11558
  TargetAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
11559
              , llvm::StringRef FeaturesStr
11560
             );
11561
 
11562
  TargetAttr *clone(ASTContext &C) const;
11563
  void printPretty(raw_ostream &OS,
11564
                   const PrintingPolicy &Policy) const;
11565
  const char *getSpelling() const;
11566
  llvm::StringRef getFeaturesStr() const {
11567
    return llvm::StringRef(featuresStr, featuresStrLength);
11568
  }
11569
  unsigned getFeaturesStrLength() const {
11570
    return featuresStrLength;
11571
  }
11572
  void setFeaturesStr(ASTContext &C, llvm::StringRef S) {
11573
    featuresStrLength = S.size();
11574
    this->featuresStr = new (C, 1) char [featuresStrLength];
11575
    if (!S.empty())
11576
      std::memcpy(this->featuresStr, S.data(), featuresStrLength);
11577
  }
11578
 
11579
 
11580
    StringRef getArchitecture() const {
11581
      StringRef Features = getFeaturesStr();
11582
      if (Features == "default") return {};
11583
 
11584
      SmallVector<StringRef, 1> AttrFeatures;
11585
      Features.split(AttrFeatures, ",");
11586
 
11587
      for (auto &Feature : AttrFeatures) {
11588
        Feature = Feature.trim();
11589
        if (Feature.startswith("arch="))
11590
          return Feature.drop_front(sizeof("arch=") - 1);
11591
      }
11592
      return "";
11593
    }
11594
 
11595
    // Gets the list of features as simple string-refs with no +/- or 'no-'.
11596
    // Only adds the items to 'Out' that are additions.
11597
    void getAddedFeatures(llvm::SmallVectorImpl<StringRef> &Out) const {
11598
      StringRef Features = getFeaturesStr();
11599
      if (Features == "default") return;
11600
 
11601
      SmallVector<StringRef, 1> AttrFeatures;
11602
      Features.split(AttrFeatures, ",");
11603
 
11604
      for (auto &Feature : AttrFeatures) {
11605
        Feature = Feature.trim();
11606
 
11607
        if (!Feature.startswith("no-") && !Feature.startswith("arch=") &&
11608
            !Feature.startswith("fpmath=") && !Feature.startswith("tune="))
11609
          Out.push_back(Feature);
11610
      }
11611
    }
11612
 
11613
    bool isDefaultVersion() const { return getFeaturesStr() == "default"; }
11614
 
11615
 
11616
  static bool classof(const Attr *A) { return A->getKind() == attr::Target; }
11617
};
11618
 
11619
class TargetClonesAttr : public InheritableAttr {
11620
  unsigned featuresStrs_Size;
11621
  StringRef *featuresStrs_;
11622
 
11623
public:
11624
  enum Spelling {
11625
    GNU_target_clones = 0,
11626
    CXX11_gnu_target_clones = 1,
11627
    C2x_gnu_target_clones = 2,
11628
  SpellingNotCalculated = 15
11629
 
11630
  };
11631
 
11632
  // Factory methods
11633
  static TargetClonesAttr *CreateImplicit(ASTContext &Ctx, StringRef *FeaturesStrs, unsigned FeaturesStrsSize, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
11634
  static TargetClonesAttr *Create(ASTContext &Ctx, StringRef *FeaturesStrs, unsigned FeaturesStrsSize, const AttributeCommonInfo &CommonInfo);
11635
  static TargetClonesAttr *CreateImplicit(ASTContext &Ctx, StringRef *FeaturesStrs, unsigned FeaturesStrsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11636
  static TargetClonesAttr *Create(ASTContext &Ctx, StringRef *FeaturesStrs, unsigned FeaturesStrsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11637
 
11638
  // Constructors
11639
  TargetClonesAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
11640
              , StringRef *FeaturesStrs, unsigned FeaturesStrsSize
11641
             );
11642
  TargetClonesAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
11643
             );
11644
 
11645
  TargetClonesAttr *clone(ASTContext &C) const;
11646
  void printPretty(raw_ostream &OS,
11647
                   const PrintingPolicy &Policy) const;
11648
  const char *getSpelling() const;
11649
  typedef StringRef* featuresStrs_iterator;
11650
  featuresStrs_iterator featuresStrs_begin() const { return featuresStrs_; }
11651
  featuresStrs_iterator featuresStrs_end() const { return featuresStrs_ + featuresStrs_Size; }
11652
  unsigned featuresStrs_size() const { return featuresStrs_Size; }
11653
  llvm::iterator_range<featuresStrs_iterator> featuresStrs() const { return llvm::make_range(featuresStrs_begin(), featuresStrs_end()); }
11654
 
11655
 
11656
 
11657
    StringRef getFeatureStr(unsigned Index) const {
11658
      return *(featuresStrs_begin() + Index);
11659
    }
11660
    // Given an index into the 'featuresStrs' sequence, compute a unique
11661
    // ID to be used with function name mangling for the associated variant.
11662
    // This mapping is necessary due to a requirement that the mangling ID
11663
    // used for the "default" variant be the largest mangling ID in the
11664
    // variant set. Duplicate variants present in 'featuresStrs' are also
11665
    // assigned their own unique ID (the mapping is bijective).
11666
    unsigned getMangledIndex(unsigned Index) const {
11667
      if (getFeatureStr(Index) == "default")
11668
        return std::count_if(featuresStrs_begin(), featuresStrs_end(),
11669
                              [](StringRef S) { return S != "default"; });
11670
 
11671
      return std::count_if(featuresStrs_begin(), featuresStrs_begin() + Index,
11672
                           [](StringRef S) { return S != "default"; });
11673
    }
11674
 
11675
    // Given an index into the 'featuresStrs' sequence, determine if the
11676
    // index corresponds to the first instance of the named variant. This
11677
    // is used to skip over duplicate variant instances when iterating over
11678
    // 'featuresStrs'.
11679
    bool isFirstOfVersion(unsigned Index) const {
11680
      StringRef FeatureStr(getFeatureStr(Index));
11681
      return 0 == std::count_if(
11682
                      featuresStrs_begin(), featuresStrs_begin() + Index,
11683
                      [FeatureStr](StringRef S) { return S == FeatureStr; });
11684
 
11685
    }
11686
 
11687
 
11688
  static bool classof(const Attr *A) { return A->getKind() == attr::TargetClones; }
11689
};
11690
 
11691
class TargetVersionAttr : public InheritableAttr {
11692
unsigned namesStrLength;
11693
char *namesStr;
11694
 
11695
public:
11696
  enum Spelling {
11697
    GNU_target_version = 0,
11698
    CXX11_gnu_target_version = 1,
11699
    C2x_gnu_target_version = 2,
11700
  SpellingNotCalculated = 15
11701
 
11702
  };
11703
 
11704
  // Factory methods
11705
  static TargetVersionAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef NamesStr, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
11706
  static TargetVersionAttr *Create(ASTContext &Ctx, llvm::StringRef NamesStr, const AttributeCommonInfo &CommonInfo);
11707
  static TargetVersionAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef NamesStr, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11708
  static TargetVersionAttr *Create(ASTContext &Ctx, llvm::StringRef NamesStr, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11709
 
11710
  // Constructors
11711
  TargetVersionAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
11712
              , llvm::StringRef NamesStr
11713
             );
11714
 
11715
  TargetVersionAttr *clone(ASTContext &C) const;
11716
  void printPretty(raw_ostream &OS,
11717
                   const PrintingPolicy &Policy) const;
11718
  const char *getSpelling() const;
11719
  llvm::StringRef getNamesStr() const {
11720
    return llvm::StringRef(namesStr, namesStrLength);
11721
  }
11722
  unsigned getNamesStrLength() const {
11723
    return namesStrLength;
11724
  }
11725
  void setNamesStr(ASTContext &C, llvm::StringRef S) {
11726
    namesStrLength = S.size();
11727
    this->namesStr = new (C, 1) char [namesStrLength];
11728
    if (!S.empty())
11729
      std::memcpy(this->namesStr, S.data(), namesStrLength);
11730
  }
11731
 
11732
 
11733
    StringRef getName() const { return getNamesStr().trim(); }
11734
    bool isDefaultVersion() const {
11735
      return getName() == "default";
11736
    }
11737
    void getFeatures(llvm::SmallVectorImpl<StringRef> &Out) const {
11738
      if (isDefaultVersion()) return;
11739
      StringRef Features = getName();
11740
 
11741
      SmallVector<StringRef, 8> AttrFeatures;
11742
      Features.split(AttrFeatures, "+");
11743
 
11744
      for (auto &Feature : AttrFeatures) {
11745
        Feature = Feature.trim();
11746
        Out.push_back(Feature);
11747
      }
11748
    }
11749
 
11750
 
11751
  static bool classof(const Attr *A) { return A->getKind() == attr::TargetVersion; }
11752
};
11753
 
11754
class TestTypestateAttr : public InheritableAttr {
11755
public:
11756
  enum ConsumedState {
11757
    Consumed,
11758
    Unconsumed
11759
  };
11760
private:
11761
  ConsumedState testState;
11762
 
11763
public:
11764
  enum Spelling {
11765
    GNU_test_typestate = 0,
11766
    CXX11_clang_test_typestate = 1,
11767
  SpellingNotCalculated = 15
11768
 
11769
  };
11770
 
11771
  // Factory methods
11772
  static TestTypestateAttr *CreateImplicit(ASTContext &Ctx, ConsumedState TestState, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
11773
  static TestTypestateAttr *Create(ASTContext &Ctx, ConsumedState TestState, const AttributeCommonInfo &CommonInfo);
11774
  static TestTypestateAttr *CreateImplicit(ASTContext &Ctx, ConsumedState TestState, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11775
  static TestTypestateAttr *Create(ASTContext &Ctx, ConsumedState TestState, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11776
 
11777
  // Constructors
11778
  TestTypestateAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
11779
              , ConsumedState TestState
11780
             );
11781
 
11782
  TestTypestateAttr *clone(ASTContext &C) const;
11783
  void printPretty(raw_ostream &OS,
11784
                   const PrintingPolicy &Policy) const;
11785
  const char *getSpelling() const;
11786
  ConsumedState getTestState() const {
11787
    return testState;
11788
  }
11789
 
11790
  static bool ConvertStrToConsumedState(StringRef Val, ConsumedState &Out);
11791
  static const char *ConvertConsumedStateToStr(ConsumedState Val);
11792
 
11793
 
11794
  static bool classof(const Attr *A) { return A->getKind() == attr::TestTypestate; }
11795
};
11796
 
11797
class ThisCallAttr : public InheritableAttr {
11798
public:
11799
  enum Spelling {
11800
    GNU_thiscall = 0,
11801
    CXX11_gnu_thiscall = 1,
11802
    C2x_gnu_thiscall = 2,
11803
    Keyword_thiscall = 3,
11804
  SpellingNotCalculated = 15
11805
 
11806
  };
11807
 
11808
  // Factory methods
11809
  static ThisCallAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
11810
  static ThisCallAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
11811
  static ThisCallAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11812
  static ThisCallAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11813
 
11814
  // Constructors
11815
  ThisCallAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
11816
             );
11817
 
11818
  ThisCallAttr *clone(ASTContext &C) const;
11819
  void printPretty(raw_ostream &OS,
11820
                   const PrintingPolicy &Policy) const;
11821
  const char *getSpelling() const;
11822
 
11823
 
11824
  static bool classof(const Attr *A) { return A->getKind() == attr::ThisCall; }
11825
};
11826
 
11827
class ThreadAttr : public Attr {
11828
public:
11829
  // Factory methods
11830
  static ThreadAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
11831
  static ThreadAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
11832
  static ThreadAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11833
  static ThreadAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11834
 
11835
  // Constructors
11836
  ThreadAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
11837
             );
11838
 
11839
  ThreadAttr *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::Thread; }
11846
};
11847
 
11848
class TransparentUnionAttr : public InheritableAttr {
11849
public:
11850
  enum Spelling {
11851
    GNU_transparent_union = 0,
11852
    CXX11_gnu_transparent_union = 1,
11853
    C2x_gnu_transparent_union = 2,
11854
  SpellingNotCalculated = 15
11855
 
11856
  };
11857
 
11858
  // Factory methods
11859
  static TransparentUnionAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
11860
  static TransparentUnionAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
11861
  static TransparentUnionAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11862
  static TransparentUnionAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11863
 
11864
  // Constructors
11865
  TransparentUnionAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
11866
             );
11867
 
11868
  TransparentUnionAttr *clone(ASTContext &C) const;
11869
  void printPretty(raw_ostream &OS,
11870
                   const PrintingPolicy &Policy) const;
11871
  const char *getSpelling() const;
11872
 
11873
 
11874
  static bool classof(const Attr *A) { return A->getKind() == attr::TransparentUnion; }
11875
};
11876
 
11877
class TrivialABIAttr : public InheritableAttr {
11878
public:
11879
  enum Spelling {
11880
    GNU_trivial_abi = 0,
11881
    CXX11_clang_trivial_abi = 1,
11882
  SpellingNotCalculated = 15
11883
 
11884
  };
11885
 
11886
  // Factory methods
11887
  static TrivialABIAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
11888
  static TrivialABIAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
11889
  static TrivialABIAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11890
  static TrivialABIAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11891
 
11892
  // Constructors
11893
  TrivialABIAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
11894
             );
11895
 
11896
  TrivialABIAttr *clone(ASTContext &C) const;
11897
  void printPretty(raw_ostream &OS,
11898
                   const PrintingPolicy &Policy) const;
11899
  const char *getSpelling() const;
11900
 
11901
 
11902
  static bool classof(const Attr *A) { return A->getKind() == attr::TrivialABI; }
11903
};
11904
 
11905
class TryAcquireCapabilityAttr : public InheritableAttr {
11906
Expr * successValue;
11907
 
11908
  unsigned args_Size;
11909
  Expr * *args_;
11910
 
11911
public:
11912
  enum Spelling {
11913
    GNU_try_acquire_capability = 0,
11914
    CXX11_clang_try_acquire_capability = 1,
11915
    GNU_try_acquire_shared_capability = 2,
11916
    CXX11_clang_try_acquire_shared_capability = 3,
11917
  SpellingNotCalculated = 15
11918
 
11919
  };
11920
 
11921
  // Factory methods
11922
  static TryAcquireCapabilityAttr *CreateImplicit(ASTContext &Ctx, Expr * SuccessValue, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
11923
  static TryAcquireCapabilityAttr *Create(ASTContext &Ctx, Expr * SuccessValue, Expr * *Args, unsigned ArgsSize, const AttributeCommonInfo &CommonInfo);
11924
  static TryAcquireCapabilityAttr *CreateImplicit(ASTContext &Ctx, Expr * SuccessValue, Expr * *Args, unsigned ArgsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax, TryAcquireCapabilityAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
11925
  static TryAcquireCapabilityAttr *Create(ASTContext &Ctx, Expr * SuccessValue, Expr * *Args, unsigned ArgsSize, SourceRange Range, AttributeCommonInfo::Syntax Syntax, TryAcquireCapabilityAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
11926
 
11927
  // Constructors
11928
  TryAcquireCapabilityAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
11929
              , Expr * SuccessValue
11930
              , Expr * *Args, unsigned ArgsSize
11931
             );
11932
  TryAcquireCapabilityAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
11933
              , Expr * SuccessValue
11934
             );
11935
 
11936
  TryAcquireCapabilityAttr *clone(ASTContext &C) const;
11937
  void printPretty(raw_ostream &OS,
11938
                   const PrintingPolicy &Policy) const;
11939
  const char *getSpelling() const;
11940
  Spelling getSemanticSpelling() const;
11941
  bool isShared() const { return getAttributeSpellingListIndex() == 2 ||
11942
    getAttributeSpellingListIndex() == 3; }
11943
  Expr * getSuccessValue() const {
11944
    return successValue;
11945
  }
11946
 
11947
  typedef Expr ** args_iterator;
11948
  args_iterator args_begin() const { return args_; }
11949
  args_iterator args_end() const { return args_ + args_Size; }
11950
  unsigned args_size() const { return args_Size; }
11951
  llvm::iterator_range<args_iterator> args() const { return llvm::make_range(args_begin(), args_end()); }
11952
 
11953
 
11954
 
11955
 
11956
  static bool classof(const Attr *A) { return A->getKind() == attr::TryAcquireCapability; }
11957
};
11958
 
11959
class TypeNonNullAttr : public TypeAttr {
11960
public:
11961
  // Factory methods
11962
  static TypeNonNullAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
11963
  static TypeNonNullAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
11964
  static TypeNonNullAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11965
  static TypeNonNullAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11966
 
11967
  // Constructors
11968
  TypeNonNullAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
11969
             );
11970
 
11971
  TypeNonNullAttr *clone(ASTContext &C) const;
11972
  void printPretty(raw_ostream &OS,
11973
                   const PrintingPolicy &Policy) const;
11974
  const char *getSpelling() const;
11975
 
11976
 
11977
  static bool classof(const Attr *A) { return A->getKind() == attr::TypeNonNull; }
11978
};
11979
 
11980
class TypeNullUnspecifiedAttr : public TypeAttr {
11981
public:
11982
  // Factory methods
11983
  static TypeNullUnspecifiedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
11984
  static TypeNullUnspecifiedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
11985
  static TypeNullUnspecifiedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11986
  static TypeNullUnspecifiedAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
11987
 
11988
  // Constructors
11989
  TypeNullUnspecifiedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
11990
             );
11991
 
11992
  TypeNullUnspecifiedAttr *clone(ASTContext &C) const;
11993
  void printPretty(raw_ostream &OS,
11994
                   const PrintingPolicy &Policy) const;
11995
  const char *getSpelling() const;
11996
 
11997
 
11998
  static bool classof(const Attr *A) { return A->getKind() == attr::TypeNullUnspecified; }
11999
};
12000
 
12001
class TypeNullableAttr : public TypeAttr {
12002
public:
12003
  // Factory methods
12004
  static TypeNullableAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
12005
  static TypeNullableAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
12006
  static TypeNullableAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12007
  static TypeNullableAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12008
 
12009
  // Constructors
12010
  TypeNullableAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
12011
             );
12012
 
12013
  TypeNullableAttr *clone(ASTContext &C) const;
12014
  void printPretty(raw_ostream &OS,
12015
                   const PrintingPolicy &Policy) const;
12016
  const char *getSpelling() const;
12017
 
12018
 
12019
  static bool classof(const Attr *A) { return A->getKind() == attr::TypeNullable; }
12020
};
12021
 
12022
class TypeNullableResultAttr : public TypeAttr {
12023
public:
12024
  // Factory methods
12025
  static TypeNullableResultAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
12026
  static TypeNullableResultAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
12027
  static TypeNullableResultAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12028
  static TypeNullableResultAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12029
 
12030
  // Constructors
12031
  TypeNullableResultAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
12032
             );
12033
 
12034
  TypeNullableResultAttr *clone(ASTContext &C) const;
12035
  void printPretty(raw_ostream &OS,
12036
                   const PrintingPolicy &Policy) const;
12037
  const char *getSpelling() const;
12038
 
12039
 
12040
  static bool classof(const Attr *A) { return A->getKind() == attr::TypeNullableResult; }
12041
};
12042
 
12043
class TypeTagForDatatypeAttr : public InheritableAttr {
12044
IdentifierInfo * argumentKind;
12045
 
12046
TypeSourceInfo * matchingCType;
12047
 
12048
bool layoutCompatible;
12049
 
12050
bool mustBeNull;
12051
 
12052
public:
12053
  enum Spelling {
12054
    GNU_type_tag_for_datatype = 0,
12055
    CXX11_clang_type_tag_for_datatype = 1,
12056
    C2x_clang_type_tag_for_datatype = 2,
12057
  SpellingNotCalculated = 15
12058
 
12059
  };
12060
 
12061
  // Factory methods
12062
  static TypeTagForDatatypeAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * ArgumentKind, TypeSourceInfo * MatchingCType, bool LayoutCompatible, bool MustBeNull, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
12063
  static TypeTagForDatatypeAttr *Create(ASTContext &Ctx, IdentifierInfo * ArgumentKind, TypeSourceInfo * MatchingCType, bool LayoutCompatible, bool MustBeNull, const AttributeCommonInfo &CommonInfo);
12064
  static TypeTagForDatatypeAttr *CreateImplicit(ASTContext &Ctx, IdentifierInfo * ArgumentKind, TypeSourceInfo * MatchingCType, bool LayoutCompatible, bool MustBeNull, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12065
  static TypeTagForDatatypeAttr *Create(ASTContext &Ctx, IdentifierInfo * ArgumentKind, TypeSourceInfo * MatchingCType, bool LayoutCompatible, bool MustBeNull, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12066
 
12067
  // Constructors
12068
  TypeTagForDatatypeAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
12069
              , IdentifierInfo * ArgumentKind
12070
              , TypeSourceInfo * MatchingCType
12071
              , bool LayoutCompatible
12072
              , bool MustBeNull
12073
             );
12074
 
12075
  TypeTagForDatatypeAttr *clone(ASTContext &C) const;
12076
  void printPretty(raw_ostream &OS,
12077
                   const PrintingPolicy &Policy) const;
12078
  const char *getSpelling() const;
12079
  IdentifierInfo * getArgumentKind() const {
12080
    return argumentKind;
12081
  }
12082
 
12083
  QualType getMatchingCType() const {
12084
    return matchingCType->getType();
12085
  }  TypeSourceInfo * getMatchingCTypeLoc() const {
12086
    return matchingCType;
12087
  }
12088
 
12089
  bool getLayoutCompatible() const {
12090
    return layoutCompatible;
12091
  }
12092
 
12093
  bool getMustBeNull() const {
12094
    return mustBeNull;
12095
  }
12096
 
12097
 
12098
 
12099
  static bool classof(const Attr *A) { return A->getKind() == attr::TypeTagForDatatype; }
12100
};
12101
 
12102
class TypeVisibilityAttr : public InheritableAttr {
12103
public:
12104
  enum VisibilityType {
12105
    Default,
12106
    Hidden,
12107
    Protected
12108
  };
12109
private:
12110
  VisibilityType visibility;
12111
 
12112
public:
12113
  enum Spelling {
12114
    GNU_type_visibility = 0,
12115
    CXX11_clang_type_visibility = 1,
12116
    C2x_clang_type_visibility = 2,
12117
  SpellingNotCalculated = 15
12118
 
12119
  };
12120
 
12121
  // Factory methods
12122
  static TypeVisibilityAttr *CreateImplicit(ASTContext &Ctx, VisibilityType Visibility, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
12123
  static TypeVisibilityAttr *Create(ASTContext &Ctx, VisibilityType Visibility, const AttributeCommonInfo &CommonInfo);
12124
  static TypeVisibilityAttr *CreateImplicit(ASTContext &Ctx, VisibilityType Visibility, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12125
  static TypeVisibilityAttr *Create(ASTContext &Ctx, VisibilityType Visibility, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12126
 
12127
  // Constructors
12128
  TypeVisibilityAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
12129
              , VisibilityType Visibility
12130
             );
12131
 
12132
  TypeVisibilityAttr *clone(ASTContext &C) const;
12133
  void printPretty(raw_ostream &OS,
12134
                   const PrintingPolicy &Policy) const;
12135
  const char *getSpelling() const;
12136
  VisibilityType getVisibility() const {
12137
    return visibility;
12138
  }
12139
 
12140
  static bool ConvertStrToVisibilityType(StringRef Val, VisibilityType &Out);
12141
  static const char *ConvertVisibilityTypeToStr(VisibilityType Val);
12142
 
12143
 
12144
  static bool classof(const Attr *A) { return A->getKind() == attr::TypeVisibility; }
12145
};
12146
 
12147
class UPtrAttr : public TypeAttr {
12148
public:
12149
  // Factory methods
12150
  static UPtrAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
12151
  static UPtrAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
12152
  static UPtrAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12153
  static UPtrAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12154
 
12155
  // Constructors
12156
  UPtrAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
12157
             );
12158
 
12159
  UPtrAttr *clone(ASTContext &C) const;
12160
  void printPretty(raw_ostream &OS,
12161
                   const PrintingPolicy &Policy) const;
12162
  const char *getSpelling() const;
12163
 
12164
 
12165
  static bool classof(const Attr *A) { return A->getKind() == attr::UPtr; }
12166
};
12167
 
12168
class UnavailableAttr : public InheritableAttr {
12169
unsigned messageLength;
12170
char *message;
12171
 
12172
public:
12173
  enum ImplicitReason {
12174
    IR_None,
12175
    IR_ARCForbiddenType,
12176
    IR_ForbiddenWeak,
12177
    IR_ARCForbiddenConversion,
12178
    IR_ARCInitReturnsUnrelated,
12179
    IR_ARCFieldWithOwnership
12180
  };
12181
private:
12182
  ImplicitReason implicitReason;
12183
 
12184
public:
12185
  enum Spelling {
12186
    GNU_unavailable = 0,
12187
    CXX11_clang_unavailable = 1,
12188
    C2x_clang_unavailable = 2,
12189
  SpellingNotCalculated = 15
12190
 
12191
  };
12192
 
12193
  // Factory methods
12194
  static UnavailableAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Message, ImplicitReason ImplicitReason, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
12195
  static UnavailableAttr *Create(ASTContext &Ctx, llvm::StringRef Message, ImplicitReason ImplicitReason, const AttributeCommonInfo &CommonInfo);
12196
  static UnavailableAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Message, ImplicitReason ImplicitReason, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12197
  static UnavailableAttr *Create(ASTContext &Ctx, llvm::StringRef Message, ImplicitReason ImplicitReason, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12198
  static UnavailableAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Message, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
12199
  static UnavailableAttr *Create(ASTContext &Ctx, llvm::StringRef Message, const AttributeCommonInfo &CommonInfo);
12200
  static UnavailableAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Message, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12201
  static UnavailableAttr *Create(ASTContext &Ctx, llvm::StringRef Message, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12202
 
12203
  // Constructors
12204
  UnavailableAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
12205
              , llvm::StringRef Message
12206
              , ImplicitReason ImplicitReason
12207
             );
12208
  UnavailableAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
12209
              , llvm::StringRef Message
12210
             );
12211
  UnavailableAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
12212
             );
12213
 
12214
  UnavailableAttr *clone(ASTContext &C) const;
12215
  void printPretty(raw_ostream &OS,
12216
                   const PrintingPolicy &Policy) const;
12217
  const char *getSpelling() const;
12218
  llvm::StringRef getMessage() const {
12219
    return llvm::StringRef(message, messageLength);
12220
  }
12221
  unsigned getMessageLength() const {
12222
    return messageLength;
12223
  }
12224
  void setMessage(ASTContext &C, llvm::StringRef S) {
12225
    messageLength = S.size();
12226
    this->message = new (C, 1) char [messageLength];
12227
    if (!S.empty())
12228
      std::memcpy(this->message, S.data(), messageLength);
12229
  }
12230
 
12231
  ImplicitReason getImplicitReason() const {
12232
    return implicitReason;
12233
  }
12234
 
12235
 
12236
 
12237
  static bool classof(const Attr *A) { return A->getKind() == attr::Unavailable; }
12238
};
12239
 
12240
class UninitializedAttr : public InheritableAttr {
12241
public:
12242
  enum Spelling {
12243
    GNU_uninitialized = 0,
12244
    CXX11_clang_uninitialized = 1,
12245
  SpellingNotCalculated = 15
12246
 
12247
  };
12248
 
12249
  // Factory methods
12250
  static UninitializedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
12251
  static UninitializedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
12252
  static UninitializedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12253
  static UninitializedAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12254
 
12255
  // Constructors
12256
  UninitializedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
12257
             );
12258
 
12259
  UninitializedAttr *clone(ASTContext &C) const;
12260
  void printPretty(raw_ostream &OS,
12261
                   const PrintingPolicy &Policy) const;
12262
  const char *getSpelling() const;
12263
 
12264
 
12265
  static bool classof(const Attr *A) { return A->getKind() == attr::Uninitialized; }
12266
};
12267
 
12268
class UnlikelyAttr : public StmtAttr {
12269
public:
12270
  enum Spelling {
12271
    CXX11_unlikely = 0,
12272
    C2x_clang_unlikely = 1,
12273
  SpellingNotCalculated = 15
12274
 
12275
  };
12276
 
12277
  // Factory methods
12278
  static UnlikelyAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
12279
  static UnlikelyAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
12280
  static UnlikelyAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12281
  static UnlikelyAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12282
 
12283
  // Constructors
12284
  UnlikelyAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
12285
             );
12286
 
12287
  UnlikelyAttr *clone(ASTContext &C) const;
12288
  void printPretty(raw_ostream &OS,
12289
                   const PrintingPolicy &Policy) const;
12290
  const char *getSpelling() const;
12291
 
12292
 
12293
  static bool classof(const Attr *A) { return A->getKind() == attr::Unlikely; }
12294
};
12295
 
12296
class UnusedAttr : public InheritableAttr {
12297
public:
12298
  enum Spelling {
12299
    CXX11_maybe_unused = 0,
12300
    GNU_unused = 1,
12301
    CXX11_gnu_unused = 2,
12302
    C2x_gnu_unused = 3,
12303
    C2x_maybe_unused = 4,
12304
  SpellingNotCalculated = 15
12305
 
12306
  };
12307
 
12308
  // Factory methods
12309
  static UnusedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
12310
  static UnusedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
12311
  static UnusedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax, UnusedAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
12312
  static UnusedAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax, UnusedAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
12313
 
12314
  // Constructors
12315
  UnusedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
12316
             );
12317
 
12318
  UnusedAttr *clone(ASTContext &C) const;
12319
  void printPretty(raw_ostream &OS,
12320
                   const PrintingPolicy &Policy) const;
12321
  const char *getSpelling() const;
12322
  Spelling getSemanticSpelling() const;
12323
 
12324
 
12325
  static bool classof(const Attr *A) { return A->getKind() == attr::Unused; }
12326
};
12327
 
12328
class UseHandleAttr : public InheritableParamAttr {
12329
unsigned handleTypeLength;
12330
char *handleType;
12331
 
12332
public:
12333
  enum Spelling {
12334
    GNU_use_handle = 0,
12335
    CXX11_clang_use_handle = 1,
12336
    C2x_clang_use_handle = 2,
12337
  SpellingNotCalculated = 15
12338
 
12339
  };
12340
 
12341
  // Factory methods
12342
  static UseHandleAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef HandleType, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
12343
  static UseHandleAttr *Create(ASTContext &Ctx, llvm::StringRef HandleType, const AttributeCommonInfo &CommonInfo);
12344
  static UseHandleAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef HandleType, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12345
  static UseHandleAttr *Create(ASTContext &Ctx, llvm::StringRef HandleType, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12346
 
12347
  // Constructors
12348
  UseHandleAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
12349
              , llvm::StringRef HandleType
12350
             );
12351
 
12352
  UseHandleAttr *clone(ASTContext &C) const;
12353
  void printPretty(raw_ostream &OS,
12354
                   const PrintingPolicy &Policy) const;
12355
  const char *getSpelling() const;
12356
  llvm::StringRef getHandleType() const {
12357
    return llvm::StringRef(handleType, handleTypeLength);
12358
  }
12359
  unsigned getHandleTypeLength() const {
12360
    return handleTypeLength;
12361
  }
12362
  void setHandleType(ASTContext &C, llvm::StringRef S) {
12363
    handleTypeLength = S.size();
12364
    this->handleType = new (C, 1) char [handleTypeLength];
12365
    if (!S.empty())
12366
      std::memcpy(this->handleType, S.data(), handleTypeLength);
12367
  }
12368
 
12369
 
12370
 
12371
  static bool classof(const Attr *A) { return A->getKind() == attr::UseHandle; }
12372
};
12373
 
12374
class UsedAttr : public InheritableAttr {
12375
public:
12376
  enum Spelling {
12377
    GNU_used = 0,
12378
    CXX11_gnu_used = 1,
12379
    C2x_gnu_used = 2,
12380
  SpellingNotCalculated = 15
12381
 
12382
  };
12383
 
12384
  // Factory methods
12385
  static UsedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
12386
  static UsedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
12387
  static UsedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12388
  static UsedAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12389
 
12390
  // Constructors
12391
  UsedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
12392
             );
12393
 
12394
  UsedAttr *clone(ASTContext &C) const;
12395
  void printPretty(raw_ostream &OS,
12396
                   const PrintingPolicy &Policy) const;
12397
  const char *getSpelling() const;
12398
 
12399
 
12400
  static bool classof(const Attr *A) { return A->getKind() == attr::Used; }
12401
};
12402
 
12403
class UsingIfExistsAttr : public InheritableAttr {
12404
public:
12405
  enum Spelling {
12406
    GNU_using_if_exists = 0,
12407
    CXX11_clang_using_if_exists = 1,
12408
  SpellingNotCalculated = 15
12409
 
12410
  };
12411
 
12412
  // Factory methods
12413
  static UsingIfExistsAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
12414
  static UsingIfExistsAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
12415
  static UsingIfExistsAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12416
  static UsingIfExistsAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12417
 
12418
  // Constructors
12419
  UsingIfExistsAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
12420
             );
12421
 
12422
  UsingIfExistsAttr *clone(ASTContext &C) const;
12423
  void printPretty(raw_ostream &OS,
12424
                   const PrintingPolicy &Policy) const;
12425
  const char *getSpelling() const;
12426
 
12427
 
12428
  static bool classof(const Attr *A) { return A->getKind() == attr::UsingIfExists; }
12429
};
12430
 
12431
class UuidAttr : public InheritableAttr {
12432
unsigned guidLength;
12433
char *guid;
12434
 
12435
MSGuidDecl * guidDecl;
12436
 
12437
public:
12438
  enum Spelling {
12439
    Declspec_uuid = 0,
12440
    Microsoft_uuid = 1,
12441
  SpellingNotCalculated = 15
12442
 
12443
  };
12444
 
12445
  // Factory methods
12446
  static UuidAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Guid, MSGuidDecl * GuidDecl, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
12447
  static UuidAttr *Create(ASTContext &Ctx, llvm::StringRef Guid, MSGuidDecl * GuidDecl, const AttributeCommonInfo &CommonInfo);
12448
  static UuidAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Guid, MSGuidDecl * GuidDecl, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12449
  static UuidAttr *Create(ASTContext &Ctx, llvm::StringRef Guid, MSGuidDecl * GuidDecl, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12450
  static UuidAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Guid, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
12451
  static UuidAttr *Create(ASTContext &Ctx, llvm::StringRef Guid, const AttributeCommonInfo &CommonInfo);
12452
  static UuidAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Guid, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12453
  static UuidAttr *Create(ASTContext &Ctx, llvm::StringRef Guid, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12454
 
12455
  // Constructors
12456
  UuidAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
12457
              , llvm::StringRef Guid
12458
              , MSGuidDecl * GuidDecl
12459
             );
12460
  UuidAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
12461
              , llvm::StringRef Guid
12462
             );
12463
 
12464
  UuidAttr *clone(ASTContext &C) const;
12465
  void printPretty(raw_ostream &OS,
12466
                   const PrintingPolicy &Policy) const;
12467
  const char *getSpelling() const;
12468
  llvm::StringRef getGuid() const {
12469
    return llvm::StringRef(guid, guidLength);
12470
  }
12471
  unsigned getGuidLength() const {
12472
    return guidLength;
12473
  }
12474
  void setGuid(ASTContext &C, llvm::StringRef S) {
12475
    guidLength = S.size();
12476
    this->guid = new (C, 1) char [guidLength];
12477
    if (!S.empty())
12478
      std::memcpy(this->guid, S.data(), guidLength);
12479
  }
12480
 
12481
  MSGuidDecl * getGuidDecl() const {
12482
    return guidDecl;
12483
  }
12484
 
12485
 
12486
 
12487
  static bool classof(const Attr *A) { return A->getKind() == attr::Uuid; }
12488
};
12489
 
12490
class VecReturnAttr : public InheritableAttr {
12491
public:
12492
  enum Spelling {
12493
    GNU_vecreturn = 0,
12494
    CXX11_clang_vecreturn = 1,
12495
  SpellingNotCalculated = 15
12496
 
12497
  };
12498
 
12499
  // Factory methods
12500
  static VecReturnAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
12501
  static VecReturnAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
12502
  static VecReturnAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12503
  static VecReturnAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12504
 
12505
  // Constructors
12506
  VecReturnAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
12507
             );
12508
 
12509
  VecReturnAttr *clone(ASTContext &C) const;
12510
  void printPretty(raw_ostream &OS,
12511
                   const PrintingPolicy &Policy) const;
12512
  const char *getSpelling() const;
12513
 
12514
 
12515
  static bool classof(const Attr *A) { return A->getKind() == attr::VecReturn; }
12516
};
12517
 
12518
class VecTypeHintAttr : public InheritableAttr {
12519
TypeSourceInfo * typeHint;
12520
 
12521
public:
12522
  // Factory methods
12523
  static VecTypeHintAttr *CreateImplicit(ASTContext &Ctx, TypeSourceInfo * TypeHint, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
12524
  static VecTypeHintAttr *Create(ASTContext &Ctx, TypeSourceInfo * TypeHint, const AttributeCommonInfo &CommonInfo);
12525
  static VecTypeHintAttr *CreateImplicit(ASTContext &Ctx, TypeSourceInfo * TypeHint, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12526
  static VecTypeHintAttr *Create(ASTContext &Ctx, TypeSourceInfo * TypeHint, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12527
 
12528
  // Constructors
12529
  VecTypeHintAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
12530
              , TypeSourceInfo * TypeHint
12531
             );
12532
 
12533
  VecTypeHintAttr *clone(ASTContext &C) const;
12534
  void printPretty(raw_ostream &OS,
12535
                   const PrintingPolicy &Policy) const;
12536
  const char *getSpelling() const;
12537
  QualType getTypeHint() const {
12538
    return typeHint->getType();
12539
  }  TypeSourceInfo * getTypeHintLoc() const {
12540
    return typeHint;
12541
  }
12542
 
12543
 
12544
 
12545
  static bool classof(const Attr *A) { return A->getKind() == attr::VecTypeHint; }
12546
};
12547
 
12548
class VectorCallAttr : public InheritableAttr {
12549
public:
12550
  enum Spelling {
12551
    GNU_vectorcall = 0,
12552
    CXX11_clang_vectorcall = 1,
12553
    C2x_clang_vectorcall = 2,
12554
    Keyword_vectorcall = 3,
12555
  SpellingNotCalculated = 15
12556
 
12557
  };
12558
 
12559
  // Factory methods
12560
  static VectorCallAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
12561
  static VectorCallAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
12562
  static VectorCallAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12563
  static VectorCallAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12564
 
12565
  // Constructors
12566
  VectorCallAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
12567
             );
12568
 
12569
  VectorCallAttr *clone(ASTContext &C) const;
12570
  void printPretty(raw_ostream &OS,
12571
                   const PrintingPolicy &Policy) const;
12572
  const char *getSpelling() const;
12573
 
12574
 
12575
  static bool classof(const Attr *A) { return A->getKind() == attr::VectorCall; }
12576
};
12577
 
12578
class VisibilityAttr : public InheritableAttr {
12579
public:
12580
  enum VisibilityType {
12581
    Default,
12582
    Hidden,
12583
    Protected
12584
  };
12585
private:
12586
  VisibilityType visibility;
12587
 
12588
public:
12589
  enum Spelling {
12590
    GNU_visibility = 0,
12591
    CXX11_gnu_visibility = 1,
12592
    C2x_gnu_visibility = 2,
12593
  SpellingNotCalculated = 15
12594
 
12595
  };
12596
 
12597
  // Factory methods
12598
  static VisibilityAttr *CreateImplicit(ASTContext &Ctx, VisibilityType Visibility, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
12599
  static VisibilityAttr *Create(ASTContext &Ctx, VisibilityType Visibility, const AttributeCommonInfo &CommonInfo);
12600
  static VisibilityAttr *CreateImplicit(ASTContext &Ctx, VisibilityType Visibility, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12601
  static VisibilityAttr *Create(ASTContext &Ctx, VisibilityType Visibility, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12602
 
12603
  // Constructors
12604
  VisibilityAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
12605
              , VisibilityType Visibility
12606
             );
12607
 
12608
  VisibilityAttr *clone(ASTContext &C) const;
12609
  void printPretty(raw_ostream &OS,
12610
                   const PrintingPolicy &Policy) const;
12611
  const char *getSpelling() const;
12612
  VisibilityType getVisibility() const {
12613
    return visibility;
12614
  }
12615
 
12616
  static bool ConvertStrToVisibilityType(StringRef Val, VisibilityType &Out);
12617
  static const char *ConvertVisibilityTypeToStr(VisibilityType Val);
12618
 
12619
 
12620
  static bool classof(const Attr *A) { return A->getKind() == attr::Visibility; }
12621
};
12622
 
12623
class WarnUnusedAttr : public InheritableAttr {
12624
public:
12625
  enum Spelling {
12626
    GNU_warn_unused = 0,
12627
    CXX11_gnu_warn_unused = 1,
12628
    C2x_gnu_warn_unused = 2,
12629
  SpellingNotCalculated = 15
12630
 
12631
  };
12632
 
12633
  // Factory methods
12634
  static WarnUnusedAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
12635
  static WarnUnusedAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
12636
  static WarnUnusedAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12637
  static WarnUnusedAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12638
 
12639
  // Constructors
12640
  WarnUnusedAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
12641
             );
12642
 
12643
  WarnUnusedAttr *clone(ASTContext &C) const;
12644
  void printPretty(raw_ostream &OS,
12645
                   const PrintingPolicy &Policy) const;
12646
  const char *getSpelling() const;
12647
 
12648
 
12649
  static bool classof(const Attr *A) { return A->getKind() == attr::WarnUnused; }
12650
};
12651
 
12652
class WarnUnusedResultAttr : public InheritableAttr {
12653
unsigned messageLength;
12654
char *message;
12655
 
12656
public:
12657
  enum Spelling {
12658
    CXX11_nodiscard = 0,
12659
    C2x_nodiscard = 1,
12660
    CXX11_clang_warn_unused_result = 2,
12661
    GNU_warn_unused_result = 3,
12662
    CXX11_gnu_warn_unused_result = 4,
12663
    C2x_gnu_warn_unused_result = 5,
12664
  SpellingNotCalculated = 15
12665
 
12666
  };
12667
 
12668
  // Factory methods
12669
  static WarnUnusedResultAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Message, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
12670
  static WarnUnusedResultAttr *Create(ASTContext &Ctx, llvm::StringRef Message, const AttributeCommonInfo &CommonInfo);
12671
  static WarnUnusedResultAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Message, SourceRange Range, AttributeCommonInfo::Syntax Syntax, WarnUnusedResultAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
12672
  static WarnUnusedResultAttr *Create(ASTContext &Ctx, llvm::StringRef Message, SourceRange Range, AttributeCommonInfo::Syntax Syntax, WarnUnusedResultAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
12673
 
12674
  // Constructors
12675
  WarnUnusedResultAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
12676
              , llvm::StringRef Message
12677
             );
12678
  WarnUnusedResultAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
12679
             );
12680
 
12681
  WarnUnusedResultAttr *clone(ASTContext &C) const;
12682
  void printPretty(raw_ostream &OS,
12683
                   const PrintingPolicy &Policy) const;
12684
  const char *getSpelling() const;
12685
  Spelling getSemanticSpelling() const;
12686
  llvm::StringRef getMessage() const {
12687
    return llvm::StringRef(message, messageLength);
12688
  }
12689
  unsigned getMessageLength() const {
12690
    return messageLength;
12691
  }
12692
  void setMessage(ASTContext &C, llvm::StringRef S) {
12693
    messageLength = S.size();
12694
    this->message = new (C, 1) char [messageLength];
12695
    if (!S.empty())
12696
      std::memcpy(this->message, S.data(), messageLength);
12697
  }
12698
 
12699
 
12700
    // Check whether this the C++11 nodiscard version, even in non C++11
12701
    // spellings.
12702
    bool IsCXX11NoDiscard() const {
12703
      return this->getSemanticSpelling() == CXX11_nodiscard;
12704
    }
12705
 
12706
 
12707
  static bool classof(const Attr *A) { return A->getKind() == attr::WarnUnusedResult; }
12708
};
12709
 
12710
class WeakAttr : public InheritableAttr {
12711
public:
12712
  enum Spelling {
12713
    GNU_weak = 0,
12714
    CXX11_gnu_weak = 1,
12715
    C2x_gnu_weak = 2,
12716
  SpellingNotCalculated = 15
12717
 
12718
  };
12719
 
12720
  // Factory methods
12721
  static WeakAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
12722
  static WeakAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
12723
  static WeakAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12724
  static WeakAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12725
 
12726
  // Constructors
12727
  WeakAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
12728
             );
12729
 
12730
  WeakAttr *clone(ASTContext &C) const;
12731
  void printPretty(raw_ostream &OS,
12732
                   const PrintingPolicy &Policy) const;
12733
  const char *getSpelling() const;
12734
 
12735
 
12736
  static bool classof(const Attr *A) { return A->getKind() == attr::Weak; }
12737
};
12738
 
12739
class WeakImportAttr : public InheritableAttr {
12740
public:
12741
  enum Spelling {
12742
    GNU_weak_import = 0,
12743
    CXX11_clang_weak_import = 1,
12744
    C2x_clang_weak_import = 2,
12745
  SpellingNotCalculated = 15
12746
 
12747
  };
12748
 
12749
  // Factory methods
12750
  static WeakImportAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
12751
  static WeakImportAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
12752
  static WeakImportAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12753
  static WeakImportAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12754
 
12755
  // Constructors
12756
  WeakImportAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
12757
             );
12758
 
12759
  WeakImportAttr *clone(ASTContext &C) const;
12760
  void printPretty(raw_ostream &OS,
12761
                   const PrintingPolicy &Policy) const;
12762
  const char *getSpelling() const;
12763
 
12764
 
12765
  static bool classof(const Attr *A) { return A->getKind() == attr::WeakImport; }
12766
};
12767
 
12768
class WeakRefAttr : public InheritableAttr {
12769
unsigned aliaseeLength;
12770
char *aliasee;
12771
 
12772
public:
12773
  enum Spelling {
12774
    GNU_weakref = 0,
12775
    CXX11_gnu_weakref = 1,
12776
    C2x_gnu_weakref = 2,
12777
  SpellingNotCalculated = 15
12778
 
12779
  };
12780
 
12781
  // Factory methods
12782
  static WeakRefAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Aliasee, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
12783
  static WeakRefAttr *Create(ASTContext &Ctx, llvm::StringRef Aliasee, const AttributeCommonInfo &CommonInfo);
12784
  static WeakRefAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef Aliasee, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12785
  static WeakRefAttr *Create(ASTContext &Ctx, llvm::StringRef Aliasee, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12786
 
12787
  // Constructors
12788
  WeakRefAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
12789
              , llvm::StringRef Aliasee
12790
             );
12791
  WeakRefAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
12792
             );
12793
 
12794
  WeakRefAttr *clone(ASTContext &C) const;
12795
  void printPretty(raw_ostream &OS,
12796
                   const PrintingPolicy &Policy) const;
12797
  const char *getSpelling() const;
12798
  llvm::StringRef getAliasee() const {
12799
    return llvm::StringRef(aliasee, aliaseeLength);
12800
  }
12801
  unsigned getAliaseeLength() const {
12802
    return aliaseeLength;
12803
  }
12804
  void setAliasee(ASTContext &C, llvm::StringRef S) {
12805
    aliaseeLength = S.size();
12806
    this->aliasee = new (C, 1) char [aliaseeLength];
12807
    if (!S.empty())
12808
      std::memcpy(this->aliasee, S.data(), aliaseeLength);
12809
  }
12810
 
12811
 
12812
 
12813
  static bool classof(const Attr *A) { return A->getKind() == attr::WeakRef; }
12814
};
12815
 
12816
class WebAssemblyExportNameAttr : public InheritableAttr {
12817
unsigned exportNameLength;
12818
char *exportName;
12819
 
12820
public:
12821
  enum Spelling {
12822
    GNU_export_name = 0,
12823
    CXX11_clang_export_name = 1,
12824
    C2x_clang_export_name = 2,
12825
  SpellingNotCalculated = 15
12826
 
12827
  };
12828
 
12829
  // Factory methods
12830
  static WebAssemblyExportNameAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef ExportName, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
12831
  static WebAssemblyExportNameAttr *Create(ASTContext &Ctx, llvm::StringRef ExportName, const AttributeCommonInfo &CommonInfo);
12832
  static WebAssemblyExportNameAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef ExportName, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12833
  static WebAssemblyExportNameAttr *Create(ASTContext &Ctx, llvm::StringRef ExportName, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12834
 
12835
  // Constructors
12836
  WebAssemblyExportNameAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
12837
              , llvm::StringRef ExportName
12838
             );
12839
 
12840
  WebAssemblyExportNameAttr *clone(ASTContext &C) const;
12841
  void printPretty(raw_ostream &OS,
12842
                   const PrintingPolicy &Policy) const;
12843
  const char *getSpelling() const;
12844
  llvm::StringRef getExportName() const {
12845
    return llvm::StringRef(exportName, exportNameLength);
12846
  }
12847
  unsigned getExportNameLength() const {
12848
    return exportNameLength;
12849
  }
12850
  void setExportName(ASTContext &C, llvm::StringRef S) {
12851
    exportNameLength = S.size();
12852
    this->exportName = new (C, 1) char [exportNameLength];
12853
    if (!S.empty())
12854
      std::memcpy(this->exportName, S.data(), exportNameLength);
12855
  }
12856
 
12857
 
12858
 
12859
  static bool classof(const Attr *A) { return A->getKind() == attr::WebAssemblyExportName; }
12860
};
12861
 
12862
class WebAssemblyImportModuleAttr : public InheritableAttr {
12863
unsigned importModuleLength;
12864
char *importModule;
12865
 
12866
public:
12867
  enum Spelling {
12868
    GNU_import_module = 0,
12869
    CXX11_clang_import_module = 1,
12870
    C2x_clang_import_module = 2,
12871
  SpellingNotCalculated = 15
12872
 
12873
  };
12874
 
12875
  // Factory methods
12876
  static WebAssemblyImportModuleAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef ImportModule, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
12877
  static WebAssemblyImportModuleAttr *Create(ASTContext &Ctx, llvm::StringRef ImportModule, const AttributeCommonInfo &CommonInfo);
12878
  static WebAssemblyImportModuleAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef ImportModule, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12879
  static WebAssemblyImportModuleAttr *Create(ASTContext &Ctx, llvm::StringRef ImportModule, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12880
 
12881
  // Constructors
12882
  WebAssemblyImportModuleAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
12883
              , llvm::StringRef ImportModule
12884
             );
12885
 
12886
  WebAssemblyImportModuleAttr *clone(ASTContext &C) const;
12887
  void printPretty(raw_ostream &OS,
12888
                   const PrintingPolicy &Policy) const;
12889
  const char *getSpelling() const;
12890
  llvm::StringRef getImportModule() const {
12891
    return llvm::StringRef(importModule, importModuleLength);
12892
  }
12893
  unsigned getImportModuleLength() const {
12894
    return importModuleLength;
12895
  }
12896
  void setImportModule(ASTContext &C, llvm::StringRef S) {
12897
    importModuleLength = S.size();
12898
    this->importModule = new (C, 1) char [importModuleLength];
12899
    if (!S.empty())
12900
      std::memcpy(this->importModule, S.data(), importModuleLength);
12901
  }
12902
 
12903
 
12904
 
12905
  static bool classof(const Attr *A) { return A->getKind() == attr::WebAssemblyImportModule; }
12906
};
12907
 
12908
class WebAssemblyImportNameAttr : public InheritableAttr {
12909
unsigned importNameLength;
12910
char *importName;
12911
 
12912
public:
12913
  enum Spelling {
12914
    GNU_import_name = 0,
12915
    CXX11_clang_import_name = 1,
12916
    C2x_clang_import_name = 2,
12917
  SpellingNotCalculated = 15
12918
 
12919
  };
12920
 
12921
  // Factory methods
12922
  static WebAssemblyImportNameAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef ImportName, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
12923
  static WebAssemblyImportNameAttr *Create(ASTContext &Ctx, llvm::StringRef ImportName, const AttributeCommonInfo &CommonInfo);
12924
  static WebAssemblyImportNameAttr *CreateImplicit(ASTContext &Ctx, llvm::StringRef ImportName, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12925
  static WebAssemblyImportNameAttr *Create(ASTContext &Ctx, llvm::StringRef ImportName, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12926
 
12927
  // Constructors
12928
  WebAssemblyImportNameAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
12929
              , llvm::StringRef ImportName
12930
             );
12931
 
12932
  WebAssemblyImportNameAttr *clone(ASTContext &C) const;
12933
  void printPretty(raw_ostream &OS,
12934
                   const PrintingPolicy &Policy) const;
12935
  const char *getSpelling() const;
12936
  llvm::StringRef getImportName() const {
12937
    return llvm::StringRef(importName, importNameLength);
12938
  }
12939
  unsigned getImportNameLength() const {
12940
    return importNameLength;
12941
  }
12942
  void setImportName(ASTContext &C, llvm::StringRef S) {
12943
    importNameLength = S.size();
12944
    this->importName = new (C, 1) char [importNameLength];
12945
    if (!S.empty())
12946
      std::memcpy(this->importName, S.data(), importNameLength);
12947
  }
12948
 
12949
 
12950
 
12951
  static bool classof(const Attr *A) { return A->getKind() == attr::WebAssemblyImportName; }
12952
};
12953
 
12954
class WorkGroupSizeHintAttr : public InheritableAttr {
12955
unsigned xDim;
12956
 
12957
unsigned yDim;
12958
 
12959
unsigned zDim;
12960
 
12961
public:
12962
  // Factory methods
12963
  static WorkGroupSizeHintAttr *CreateImplicit(ASTContext &Ctx, unsigned XDim, unsigned YDim, unsigned ZDim, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
12964
  static WorkGroupSizeHintAttr *Create(ASTContext &Ctx, unsigned XDim, unsigned YDim, unsigned ZDim, const AttributeCommonInfo &CommonInfo);
12965
  static WorkGroupSizeHintAttr *CreateImplicit(ASTContext &Ctx, unsigned XDim, unsigned YDim, unsigned ZDim, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12966
  static WorkGroupSizeHintAttr *Create(ASTContext &Ctx, unsigned XDim, unsigned YDim, unsigned ZDim, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
12967
 
12968
  // Constructors
12969
  WorkGroupSizeHintAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
12970
              , unsigned XDim
12971
              , unsigned YDim
12972
              , unsigned ZDim
12973
             );
12974
 
12975
  WorkGroupSizeHintAttr *clone(ASTContext &C) const;
12976
  void printPretty(raw_ostream &OS,
12977
                   const PrintingPolicy &Policy) const;
12978
  const char *getSpelling() const;
12979
  unsigned getXDim() const {
12980
    return xDim;
12981
  }
12982
 
12983
  unsigned getYDim() const {
12984
    return yDim;
12985
  }
12986
 
12987
  unsigned getZDim() const {
12988
    return zDim;
12989
  }
12990
 
12991
 
12992
 
12993
  static bool classof(const Attr *A) { return A->getKind() == attr::WorkGroupSizeHint; }
12994
};
12995
 
12996
class X86ForceAlignArgPointerAttr : public InheritableAttr {
12997
public:
12998
  enum Spelling {
12999
    GNU_force_align_arg_pointer = 0,
13000
    CXX11_gnu_force_align_arg_pointer = 1,
13001
    C2x_gnu_force_align_arg_pointer = 2,
13002
  SpellingNotCalculated = 15
13003
 
13004
  };
13005
 
13006
  // Factory methods
13007
  static X86ForceAlignArgPointerAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
13008
  static X86ForceAlignArgPointerAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
13009
  static X86ForceAlignArgPointerAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
13010
  static X86ForceAlignArgPointerAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
13011
 
13012
  // Constructors
13013
  X86ForceAlignArgPointerAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
13014
             );
13015
 
13016
  X86ForceAlignArgPointerAttr *clone(ASTContext &C) const;
13017
  void printPretty(raw_ostream &OS,
13018
                   const PrintingPolicy &Policy) const;
13019
  const char *getSpelling() const;
13020
 
13021
 
13022
  static bool classof(const Attr *A) { return A->getKind() == attr::X86ForceAlignArgPointer; }
13023
};
13024
 
13025
class XRayInstrumentAttr : public InheritableAttr {
13026
public:
13027
  enum Spelling {
13028
    GNU_xray_always_instrument = 0,
13029
    CXX11_clang_xray_always_instrument = 1,
13030
    C2x_clang_xray_always_instrument = 2,
13031
    GNU_xray_never_instrument = 3,
13032
    CXX11_clang_xray_never_instrument = 4,
13033
    C2x_clang_xray_never_instrument = 5,
13034
  SpellingNotCalculated = 15
13035
 
13036
  };
13037
 
13038
  // Factory methods
13039
  static XRayInstrumentAttr *CreateImplicit(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
13040
  static XRayInstrumentAttr *Create(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo);
13041
  static XRayInstrumentAttr *CreateImplicit(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax, XRayInstrumentAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
13042
  static XRayInstrumentAttr *Create(ASTContext &Ctx, SourceRange Range, AttributeCommonInfo::Syntax Syntax, XRayInstrumentAttr::Spelling S = static_cast<Spelling>(SpellingNotCalculated));
13043
 
13044
  // Constructors
13045
  XRayInstrumentAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
13046
             );
13047
 
13048
  XRayInstrumentAttr *clone(ASTContext &C) const;
13049
  void printPretty(raw_ostream &OS,
13050
                   const PrintingPolicy &Policy) const;
13051
  const char *getSpelling() const;
13052
  Spelling getSemanticSpelling() const;
13053
  bool alwaysXRayInstrument() const { return getAttributeSpellingListIndex() == 0 ||
13054
    getAttributeSpellingListIndex() == 1 ||
13055
    getAttributeSpellingListIndex() == 2; }
13056
  bool neverXRayInstrument() const { return getAttributeSpellingListIndex() == 3 ||
13057
    getAttributeSpellingListIndex() == 4 ||
13058
    getAttributeSpellingListIndex() == 5; }
13059
 
13060
 
13061
  static bool classof(const Attr *A) { return A->getKind() == attr::XRayInstrument; }
13062
};
13063
 
13064
class XRayLogArgsAttr : public InheritableAttr {
13065
unsigned argumentCount;
13066
 
13067
public:
13068
  enum Spelling {
13069
    GNU_xray_log_args = 0,
13070
    CXX11_clang_xray_log_args = 1,
13071
    C2x_clang_xray_log_args = 2,
13072
  SpellingNotCalculated = 15
13073
 
13074
  };
13075
 
13076
  // Factory methods
13077
  static XRayLogArgsAttr *CreateImplicit(ASTContext &Ctx, unsigned ArgumentCount, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
13078
  static XRayLogArgsAttr *Create(ASTContext &Ctx, unsigned ArgumentCount, const AttributeCommonInfo &CommonInfo);
13079
  static XRayLogArgsAttr *CreateImplicit(ASTContext &Ctx, unsigned ArgumentCount, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
13080
  static XRayLogArgsAttr *Create(ASTContext &Ctx, unsigned ArgumentCount, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
13081
 
13082
  // Constructors
13083
  XRayLogArgsAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
13084
              , unsigned ArgumentCount
13085
             );
13086
 
13087
  XRayLogArgsAttr *clone(ASTContext &C) const;
13088
  void printPretty(raw_ostream &OS,
13089
                   const PrintingPolicy &Policy) const;
13090
  const char *getSpelling() const;
13091
  unsigned getArgumentCount() const {
13092
    return argumentCount;
13093
  }
13094
 
13095
 
13096
 
13097
  static bool classof(const Attr *A) { return A->getKind() == attr::XRayLogArgs; }
13098
};
13099
 
13100
class ZeroCallUsedRegsAttr : public InheritableAttr {
13101
public:
13102
  enum ZeroCallUsedRegsKind {
13103
    Skip,
13104
    UsedGPRArg,
13105
    UsedGPR,
13106
    UsedArg,
13107
    Used,
13108
    AllGPRArg,
13109
    AllGPR,
13110
    AllArg,
13111
    All
13112
  };
13113
private:
13114
  ZeroCallUsedRegsKind zeroCallUsedRegs;
13115
 
13116
public:
13117
  enum Spelling {
13118
    GNU_zero_call_used_regs = 0,
13119
    CXX11_gnu_zero_call_used_regs = 1,
13120
    C2x_gnu_zero_call_used_regs = 2,
13121
  SpellingNotCalculated = 15
13122
 
13123
  };
13124
 
13125
  // Factory methods
13126
  static ZeroCallUsedRegsAttr *CreateImplicit(ASTContext &Ctx, ZeroCallUsedRegsKind ZeroCallUsedRegs, const AttributeCommonInfo &CommonInfo = {SourceRange{}});
13127
  static ZeroCallUsedRegsAttr *Create(ASTContext &Ctx, ZeroCallUsedRegsKind ZeroCallUsedRegs, const AttributeCommonInfo &CommonInfo);
13128
  static ZeroCallUsedRegsAttr *CreateImplicit(ASTContext &Ctx, ZeroCallUsedRegsKind ZeroCallUsedRegs, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
13129
  static ZeroCallUsedRegsAttr *Create(ASTContext &Ctx, ZeroCallUsedRegsKind ZeroCallUsedRegs, SourceRange Range, AttributeCommonInfo::Syntax Syntax);
13130
 
13131
  // Constructors
13132
  ZeroCallUsedRegsAttr(ASTContext &Ctx, const AttributeCommonInfo &CommonInfo
13133
              , ZeroCallUsedRegsKind ZeroCallUsedRegs
13134
             );
13135
 
13136
  ZeroCallUsedRegsAttr *clone(ASTContext &C) const;
13137
  void printPretty(raw_ostream &OS,
13138
                   const PrintingPolicy &Policy) const;
13139
  const char *getSpelling() const;
13140
  ZeroCallUsedRegsKind getZeroCallUsedRegs() const {
13141
    return zeroCallUsedRegs;
13142
  }
13143
 
13144
  static bool ConvertStrToZeroCallUsedRegsKind(StringRef Val, ZeroCallUsedRegsKind &Out);
13145
  static const char *ConvertZeroCallUsedRegsKindToStr(ZeroCallUsedRegsKind Val);
13146
 
13147
 
13148
  static bool classof(const Attr *A) { return A->getKind() == attr::ZeroCallUsedRegs; }
13149
};
13150
 
13151
#endif // LLVM_CLANG_ATTR_CLASSES_INC