/[llvm-project]/cfe/trunk/include/clang/Basic/Attr.td
ViewVC logotype

Contents of /cfe/trunk/include/clang/Basic/Attr.td

Parent Directory Parent Directory | Revision Log Revision Log


Revision 205810 - (show annotations) (download)
Tue Apr 8 17:30:47 2014 CDT (11 days, 14 hours ago) by whunt
File size: 61139 byte(s)
[MS-ABI] Add support for #pragma section and related pragmas
This patch adds support for the msvc pragmas section, bss_seg, code_seg, 
const_seg and data_seg as well as support for __declspec(allocate()).

Additionally it corrects semantics and adds diagnostics for 
__attribute__((section())) and the interaction between the attribute 
and the msvc pragmas and declspec.  In general conflicts should now be 
well diganosed within and among these features.

In supporting the pragmas new machinery for uniform lexing for 
msvc pragmas was introduced.  The new machinery always lexes the 
entire pragma and stores it on an annotation token.  The parser 
is responsible for parsing the pragma when the handling the 
annotation token.

There is a known outstanding bug in this implementation in C mode.  
Because these attributes and pragmas apply _only_ to definitions, we 
process them at the time we detect a definition.  Due to tentative 
definitions in C, we end up processing the definition late.  This means 
that in C mode, everything that ends up in a BSS section will end up in 
the _last_ BSS section rather than the one that was live at the time of 
tentative definition, even if that turns out to be the point of actual 
definition.  This issue is not known to impact anything as of yet 
because we are not aware of a clear use or use case for #pragma bss_seg 
but should be fixed at some point.

Differential Revision=http://reviews.llvm.org/D3065#inline-16241 
1 //==--- Attr.td - attribute definitions -----------------------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 // The documentation is organized by category. Attributes can have category-
11 // specific documentation that is collated within the larger document.
12 class DocumentationCategory<string name> {
13 string Name = name;
14 code Content = [{}];
15 }
16 def DocCatFunction : DocumentationCategory<"Function Attributes">;
17 def DocCatVariable : DocumentationCategory<"Variable Attributes">;
18 def DocCatType : DocumentationCategory<"Type Attributes">;
19 def DocCatStmt : DocumentationCategory<"Statement Attributes">;
20 // Attributes listed under the Undocumented category do not generate any public
21 // documentation. Ideally, this category should be used for internal-only
22 // attributes which contain no spellings.
23 def DocCatUndocumented : DocumentationCategory<"Undocumented">;
24
25 class DocDeprecated<string replacement = ""> {
26 // If the Replacement field is empty, no replacement will be listed with the
27 // documentation. Otherwise, the documentation will specify the attribute has
28 // been superseded by this replacement.
29 string Replacement = replacement;
30 }
31
32 // Specifies the documentation to be associated with the given category.
33 class Documentation {
34 DocumentationCategory Category;
35 code Content;
36
37 // If the heading is empty, one may be picked automatically. If the attribute
38 // only has one spelling, no heading is required as the attribute's sole
39 // spelling is sufficient. If all spellings are semantically common, the
40 // heading will be the semantic spelling. If the spellings are not
41 // semantically common and no heading is provided, an error will be emitted.
42 string Heading = "";
43
44 // When set, specifies that the attribute is deprecated and can optionally
45 // specify a replacement attribute.
46 DocDeprecated Deprecated;
47 }
48
49 // Specifies that the attribute is explicitly undocumented. This can be a
50 // helpful placeholder for the attribute while working on the implementation,
51 // but should not be used once feature work has been completed.
52 def Undocumented : Documentation {
53 let Category = DocCatUndocumented;
54 }
55
56 include "clang/Basic/AttrDocs.td"
57
58 // An attribute's subject is whatever it appertains to. In this file, it is
59 // more accurately a list of things that an attribute can appertain to. All
60 // Decls and Stmts are possibly AttrSubjects (even though the syntax may not
61 // allow attributes on a given Decl or Stmt).
62 class AttrSubject;
63
64 include "clang/Basic/DeclNodes.td"
65 include "clang/Basic/StmtNodes.td"
66
67 // A subset-subject is an AttrSubject constrained to operate only on some subset
68 // of that subject.
69 //
70 // The code fragment is a boolean expression that will confirm that the subject
71 // meets the requirements; the subject will have the name S, and will have the
72 // type specified by the base. It should be a simple boolean expression.
73 class SubsetSubject<AttrSubject base, code check> : AttrSubject {
74 AttrSubject Base = base;
75 code CheckCode = check;
76 }
77
78 // This is the type of a variable which C++11 allows alignas(...) to appertain
79 // to.
80 def NormalVar : SubsetSubject<Var,
81 [{S->getStorageClass() != VarDecl::Register &&
82 S->getKind() != Decl::ImplicitParam &&
83 S->getKind() != Decl::ParmVar &&
84 S->getKind() != Decl::NonTypeTemplateParm}]>;
85 def NonBitField : SubsetSubject<Field,
86 [{!S->isBitField()}]>;
87
88 def ObjCInstanceMethod : SubsetSubject<ObjCMethod,
89 [{S->isInstanceMethod()}]>;
90
91 def ObjCInterfaceDeclInitMethod : SubsetSubject<ObjCMethod,
92 [{S->getMethodFamily() == OMF_init &&
93 (isa<ObjCInterfaceDecl>(S->getDeclContext()) ||
94 (isa<ObjCCategoryDecl>(S->getDeclContext()) &&
95 cast<ObjCCategoryDecl>(S->getDeclContext())->IsClassExtension()))}]>;
96
97 def Struct : SubsetSubject<Record,
98 [{!S->isUnion()}]>;
99
100 def TLSVar : SubsetSubject<Var,
101 [{S->getTLSKind() != 0}]>;
102
103 def SharedVar : SubsetSubject<Var,
104 [{S->hasGlobalStorage() && !S->getTLSKind()}]>;
105
106 def GlobalVar : SubsetSubject<Var,
107 [{S->hasGlobalStorage()}]>;
108
109 // FIXME: this hack is needed because DeclNodes.td defines the base Decl node
110 // type to be a class, not a definition. This makes it impossible to create an
111 // attribute subject which accepts a Decl. Normally, this is not a problem,
112 // because the attribute can have no Subjects clause to accomplish this. But in
113 // the case of a SubsetSubject, there's no way to express it without this hack.
114 def DeclBase : AttrSubject;
115 def FunctionLike : SubsetSubject<DeclBase,
116 [{S->getFunctionType(false) != NULL}]>;
117
118 // HasFunctionProto is a more strict version of FunctionLike, so it should
119 // never be specified in a Subjects list along with FunctionLike (due to the
120 // inclusive nature of subject testing).
121 def HasFunctionProto : SubsetSubject<DeclBase,
122 [{(S->getFunctionType(true) != NULL &&
123 isa<FunctionProtoType>(S->getFunctionType())) ||
124 isa<ObjCMethodDecl>(S) ||
125 isa<BlockDecl>(S)}]>;
126
127 // A single argument to an attribute
128 class Argument<string name, bit optional> {
129 string Name = name;
130 bit Optional = optional;
131 }
132
133 class BoolArgument<string name, bit opt = 0> : Argument<name, opt>;
134 class IdentifierArgument<string name, bit opt = 0> : Argument<name, opt>;
135 class IntArgument<string name, bit opt = 0> : Argument<name, opt>;
136 class StringArgument<string name, bit opt = 0> : Argument<name, opt>;
137 class ExprArgument<string name, bit opt = 0> : Argument<name, opt>;
138 class FunctionArgument<string name, bit opt = 0> : Argument<name, opt>;
139 class TypeArgument<string name, bit opt = 0> : Argument<name, opt>;
140 class UnsignedArgument<string name, bit opt = 0> : Argument<name, opt>;
141 class VariadicUnsignedArgument<string name> : Argument<name, 1>;
142 class VariadicExprArgument<string name> : Argument<name, 1>;
143
144 // A version of the form major.minor[.subminor].
145 class VersionArgument<string name, bit opt = 0> : Argument<name, opt>;
146
147 // This one's a doozy, so it gets its own special type
148 // It can be an unsigned integer, or a type. Either can
149 // be dependent.
150 class AlignedArgument<string name, bit opt = 0> : Argument<name, opt>;
151
152 // A bool argument with a default value
153 class DefaultBoolArgument<string name, bit default> : BoolArgument<name, 1> {
154 bit Default = default;
155 }
156
157 // An integer argument with a default value
158 class DefaultIntArgument<string name, int default> : IntArgument<name, 1> {
159 int Default = default;
160 }
161
162 // This argument is more complex, it includes the enumerator type name,
163 // a list of strings to accept, and a list of enumerators to map them to.
164 class EnumArgument<string name, string type, list<string> values,
165 list<string> enums, bit opt = 0> : Argument<name, opt> {
166 string Type = type;
167 list<string> Values = values;
168 list<string> Enums = enums;
169 }
170
171 // FIXME: There should be a VariadicArgument type that takes any other type
172 // of argument and generates the appropriate type.
173 class VariadicEnumArgument<string name, string type, list<string> values,
174 list<string> enums> : Argument<name, 1> {
175 string Type = type;
176 list<string> Values = values;
177 list<string> Enums = enums;
178 }
179
180 // This handles one spelling of an attribute.
181 class Spelling<string name, string variety> {
182 string Name = name;
183 string Variety = variety;
184 bit KnownToGCC;
185 }
186
187 class GNU<string name> : Spelling<name, "GNU">;
188 class Declspec<string name> : Spelling<name, "Declspec">;
189 class CXX11<string namespace, string name> : Spelling<name, "CXX11"> {
190 string Namespace = namespace;
191 }
192 class Keyword<string name> : Spelling<name, "Keyword">;
193
194 // The GCC spelling implies GNU<name, "GNU"> and CXX11<"gnu", name> and also
195 // sets KnownToGCC to 1. This spelling should be used for any GCC-compatible
196 // attributes.
197 class GCC<string name> : Spelling<name, "GCC"> {
198 let KnownToGCC = 1;
199 }
200
201 class Accessor<string name, list<Spelling> spellings> {
202 string Name = name;
203 list<Spelling> Spellings = spellings;
204 }
205
206 class SubjectDiag<bit warn> {
207 bit Warn = warn;
208 }
209 def WarnDiag : SubjectDiag<1>;
210 def ErrorDiag : SubjectDiag<0>;
211
212 class SubjectList<list<AttrSubject> subjects, SubjectDiag diag = WarnDiag,
213 string customDiag = ""> {
214 list<AttrSubject> Subjects = subjects;
215 SubjectDiag Diag = diag;
216 string CustomDiag = customDiag;
217 }
218
219 class LangOpt<string name> {
220 string Name = name;
221 }
222 def MicrosoftExt : LangOpt<"MicrosoftExt">;
223 def Borland : LangOpt<"Borland">;
224 def CUDA : LangOpt<"CUDA">;
225
226 // Defines targets for target-specific attributes. The list of strings should
227 // specify architectures for which the target applies, based off the ArchType
228 // enumeration in Triple.h.
229 class TargetArch<list<string> arches> {
230 list<string> Arches = arches;
231 list<string> OSes;
232 }
233 def TargetARM : TargetArch<["arm", "thumb"]>;
234 def TargetMSP430 : TargetArch<["msp430"]>;
235 def TargetX86 : TargetArch<["x86"]>;
236 def TargetX86Win : TargetArch<["x86", "x86_64"]> {
237 let OSes = ["Win32"];
238 }
239 def TargetMips : TargetArch<["mips", "mipsel"]>;
240
241 class Attr {
242 // The various ways in which an attribute can be spelled in source
243 list<Spelling> Spellings;
244 // The things to which an attribute can appertain
245 SubjectList Subjects;
246 // The arguments allowed on an attribute
247 list<Argument> Args = [];
248 // Accessors which should be generated for the attribute.
249 list<Accessor> Accessors = [];
250 // Set to true for attributes with arguments which require delayed parsing.
251 bit LateParsed = 0;
252 // Set to false to prevent an attribute from being propagated from a template
253 // to the instantiation.
254 bit Clone = 1;
255 // Set to true for attributes which must be instantiated within templates
256 bit TemplateDependent = 0;
257 // Set to true for attributes that have a corresponding AST node.
258 bit ASTNode = 1;
259 // Set to true for attributes which have handler in Sema.
260 bit SemaHandler = 1;
261 // Set to true for attributes that are completely ignored.
262 bit Ignored = 0;
263 // Set to true if the attribute's parsing does not match its semantic
264 // content. Eg) It parses 3 args, but semantically takes 4 args. Opts out of
265 // common attribute error checking.
266 bit HasCustomParsing = 0;
267 // Set to true if all of the attribute's arguments should be parsed in an
268 // unevaluated context.
269 bit ParseArgumentsAsUnevaluated = 0;
270 // Set to true if this attribute can be duplicated on a subject when merging
271 // attributes. By default, attributes are not merged.
272 bit DuplicatesAllowedWhileMerging = 0;
273 // Lists language options, one of which is required to be true for the
274 // attribute to be applicable. If empty, no language options are required.
275 list<LangOpt> LangOpts = [];
276 // Any additional text that should be included verbatim in the class.
277 code AdditionalMembers = [{}];
278 // Any documentation that should be associated with the attribute. Since an
279 // attribute may be documented under multiple categories, more than one
280 // Documentation entry may be listed.
281 list<Documentation> Documentation;
282 }
283
284 /// A type attribute is not processed on a declaration or a statement.
285 class TypeAttr : Attr {
286 // By default, type attributes do not get an AST node.
287 let ASTNode = 0;
288 }
289
290 /// An inheritable attribute is inherited by later redeclarations.
291 class InheritableAttr : Attr;
292
293 /// A target-specific attribute. This class is meant to be used as a mixin
294 /// with InheritableAttr or Attr depending on the attribute's needs.
295 class TargetSpecificAttr<TargetArch target> {
296 TargetArch Target = target;
297 // Attributes are generally required to have unique spellings for their names
298 // so that the parser can determine what kind of attribute it has parsed.
299 // However, target-specific attributes are special in that the attribute only
300 // "exists" for a given target. So two target-specific attributes can share
301 // the same name when they exist in different targets. To support this, a
302 // Kind can be explicitly specified for a target-specific attribute. This
303 // corresponds to the AttributeList::AT_* enum that is generated and it
304 // should contain a shared value between the attributes.
305 //
306 // Target-specific attributes which use this feature should ensure that the
307 // spellings match exactly betweeen the attributes, and if the arguments or
308 // subjects differ, should specify HasCustomParsing = 1 and implement their
309 // own parsing and semantic handling requirements as-needed.
310 string ParseKind;
311 }
312
313 /// An inheritable parameter attribute is inherited by later
314 /// redeclarations, even when it's written on a parameter.
315 class InheritableParamAttr : InheritableAttr;
316
317 /// An ignored attribute, which we parse but discard with no checking.
318 class IgnoredAttr : Attr {
319 let Ignored = 1;
320 let ASTNode = 0;
321 let SemaHandler = 0;
322 let Documentation = [Undocumented];
323 }
324
325 //
326 // Attributes begin here
327 //
328
329 def AddressSpace : TypeAttr {
330 let Spellings = [GNU<"address_space">];
331 let Args = [IntArgument<"AddressSpace">];
332 let Documentation = [Undocumented];
333 }
334
335 def Alias : Attr {
336 let Spellings = [GCC<"alias">];
337 let Args = [StringArgument<"Aliasee">];
338 let Documentation = [Undocumented];
339 }
340
341 def Aligned : InheritableAttr {
342 let Spellings = [GCC<"aligned">, Declspec<"align">, Keyword<"alignas">,
343 Keyword<"_Alignas">];
344 // let Subjects = SubjectList<[NonBitField, NormalVar, Tag]>;
345 let Args = [AlignedArgument<"Alignment", 1>];
346 let Accessors = [Accessor<"isGNU", [GCC<"aligned">]>,
347 Accessor<"isC11", [Keyword<"_Alignas">]>,
348 Accessor<"isAlignas", [Keyword<"alignas">,
349 Keyword<"_Alignas">]>,
350 Accessor<"isDeclspec",[Declspec<"align">]>];
351 let Documentation = [Undocumented];
352 }
353
354 def AlignMac68k : InheritableAttr {
355 // This attribute has no spellings as it is only ever created implicitly.
356 let Spellings = [];
357 let SemaHandler = 0;
358 let Documentation = [Undocumented];
359 }
360
361 def AlwaysInline : InheritableAttr {
362 let Spellings = [GCC<"always_inline">, Keyword<"__forceinline">];
363 let Subjects = SubjectList<[Function]>;
364 let Documentation = [Undocumented];
365 }
366
367 def TLSModel : InheritableAttr {
368 let Spellings = [GCC<"tls_model">];
369 let Subjects = SubjectList<[TLSVar], ErrorDiag, "ExpectedTLSVar">;
370 let Args = [StringArgument<"Model">];
371 let Documentation = [TLSModelDocs];
372 }
373
374 def AnalyzerNoReturn : InheritableAttr {
375 let Spellings = [GNU<"analyzer_noreturn">];
376 let Documentation = [Undocumented];
377 }
378
379 def Annotate : InheritableParamAttr {
380 let Spellings = [GNU<"annotate">];
381 let Args = [StringArgument<"Annotation">];
382 let Documentation = [Undocumented];
383 }
384
385 def ARMInterrupt : InheritableAttr, TargetSpecificAttr<TargetARM> {
386 // NOTE: If you add any additional spellings, MSP430Interrupt's spellings
387 // must match.
388 let Spellings = [GNU<"interrupt">];
389 let Args = [EnumArgument<"Interrupt", "InterruptType",
390 ["IRQ", "FIQ", "SWI", "ABORT", "UNDEF", ""],
391 ["IRQ", "FIQ", "SWI", "ABORT", "UNDEF", "Generic"],
392 1>];
393 let ParseKind = "Interrupt";
394 let HasCustomParsing = 1;
395 let Documentation = [ARMInterruptDocs];
396 }
397
398 def AsmLabel : InheritableAttr {
399 let Spellings = [Keyword<"asm">, Keyword<"__asm__">];
400 let Args = [StringArgument<"Label">];
401 let SemaHandler = 0;
402 let Documentation = [Undocumented];
403 }
404
405 def Availability : InheritableAttr {
406 let Spellings = [GNU<"availability">];
407 let Args = [IdentifierArgument<"platform">, VersionArgument<"introduced">,
408 VersionArgument<"deprecated">, VersionArgument<"obsoleted">,
409 BoolArgument<"unavailable">, StringArgument<"message">];
410 let AdditionalMembers =
411 [{static llvm::StringRef getPrettyPlatformName(llvm::StringRef Platform) {
412 return llvm::StringSwitch<llvm::StringRef>(Platform)
413 .Case("ios", "iOS")
414 .Case("macosx", "OS X")
415 .Default(llvm::StringRef());
416 } }];
417 let HasCustomParsing = 1;
418 let DuplicatesAllowedWhileMerging = 1;
419 // let Subjects = SubjectList<[Named]>;
420 let Documentation = [AvailabilityDocs];
421 }
422
423 def Blocks : InheritableAttr {
424 let Spellings = [GNU<"blocks">];
425 let Args = [EnumArgument<"Type", "BlockType", ["byref"], ["ByRef"]>];
426 let Documentation = [Undocumented];
427 }
428
429 def Bounded : IgnoredAttr {
430 let Spellings = [GNU<"bounded">];
431 }
432
433 def CarriesDependency : InheritableParamAttr {
434 let Spellings = [GNU<"carries_dependency">, CXX11<"","carries_dependency">];
435 let Subjects = SubjectList<[ParmVar, ObjCMethod, Function], ErrorDiag>;
436 let Documentation = [CarriesDependencyDocs];
437 }
438
439 def CDecl : InheritableAttr {
440 let Spellings = [GCC<"cdecl">, Keyword<"__cdecl">, Keyword<"_cdecl">];
441 // let Subjects = [Function, ObjCMethod];
442 let Documentation = [Undocumented];
443 }
444
445 // cf_audited_transfer indicates that the given function has been
446 // audited and has been marked with the appropriate cf_consumed and
447 // cf_returns_retained attributes. It is generally applied by
448 // '#pragma clang arc_cf_code_audited' rather than explicitly.
449 def CFAuditedTransfer : InheritableAttr {
450 let Spellings = [GNU<"cf_audited_transfer">];
451 let Subjects = SubjectList<[Function], ErrorDiag>;
452 let Documentation = [Undocumented];
453 }
454
455 // cf_unknown_transfer is an explicit opt-out of cf_audited_transfer.
456 // It indicates that the function has unknown or unautomatable
457 // transfer semantics.
458 def CFUnknownTransfer : InheritableAttr {
459 let Spellings = [GNU<"cf_unknown_transfer">];
460 let Subjects = SubjectList<[Function], ErrorDiag>;
461 let Documentation = [Undocumented];
462 }
463
464 def CFReturnsRetained : InheritableAttr {
465 let Spellings = [GNU<"cf_returns_retained">];
466 // let Subjects = SubjectList<[ObjCMethod, ObjCProperty, Function]>;
467 let Documentation = [Undocumented];
468 }
469
470 def CFReturnsNotRetained : InheritableAttr {
471 let Spellings = [GNU<"cf_returns_not_retained">];
472 // let Subjects = SubjectList<[ObjCMethod, ObjCProperty, Function]>;
473 let Documentation = [Undocumented];
474 }
475
476 def CFConsumed : InheritableParamAttr {
477 let Spellings = [GNU<"cf_consumed">];
478 let Subjects = SubjectList<[ParmVar]>;
479 let Documentation = [Undocumented];
480 }
481
482 def Cleanup : InheritableAttr {
483 let Spellings = [GCC<"cleanup">];
484 let Args = [FunctionArgument<"FunctionDecl">];
485 let Subjects = SubjectList<[Var]>;
486 let Documentation = [Undocumented];
487 }
488
489 def Cold : InheritableAttr {
490 let Spellings = [GCC<"cold">];
491 let Subjects = SubjectList<[Function]>;
492 let Documentation = [Undocumented];
493 }
494
495 def Common : InheritableAttr {
496 let Spellings = [GCC<"common">];
497 let Subjects = SubjectList<[Var]>;
498 let Documentation = [Undocumented];
499 }
500
501 def Const : InheritableAttr {
502 let Spellings = [GCC<"const">, GCC<"__const">];
503 let Documentation = [Undocumented];
504 }
505
506 def Constructor : InheritableAttr {
507 let Spellings = [GCC<"constructor">];
508 let Args = [DefaultIntArgument<"Priority", 65535>];
509 let Subjects = SubjectList<[Function]>;
510 let Documentation = [Undocumented];
511 }
512
513 def CUDAConstant : InheritableAttr {
514 let Spellings = [GNU<"constant">];
515 let Subjects = SubjectList<[Var]>;
516 let LangOpts = [CUDA];
517 let Documentation = [Undocumented];
518 }
519
520 def CUDADevice : InheritableAttr {
521 let Spellings = [GNU<"device">];
522 let Subjects = SubjectList<[Function, Var]>;
523 let LangOpts = [CUDA];
524 let Documentation = [Undocumented];
525 }
526
527 def CUDAGlobal : InheritableAttr {
528 let Spellings = [GNU<"global">];
529 let Subjects = SubjectList<[Function]>;
530 let LangOpts = [CUDA];
531 let Documentation = [Undocumented];
532 }
533
534 def CUDAHost : InheritableAttr {
535 let Spellings = [GNU<"host">];
536 let Subjects = SubjectList<[Function]>;
537 let LangOpts = [CUDA];
538 let Documentation = [Undocumented];
539 }
540
541 def CUDALaunchBounds : InheritableAttr {
542 let Spellings = [GNU<"launch_bounds">];
543 let Args = [IntArgument<"MaxThreads">, DefaultIntArgument<"MinBlocks", 0>];
544 let LangOpts = [CUDA];
545 let Subjects = SubjectList<[ObjCMethod, FunctionLike], WarnDiag,
546 "ExpectedFunctionOrMethod">;
547 // An AST node is created for this attribute, but is not used by other parts
548 // of the compiler. However, this node needs to exist in the AST because
549 // non-LLVM backends may be relying on the attribute's presence.
550 let Documentation = [Undocumented];
551 }
552
553 def CUDAShared : InheritableAttr {
554 let Spellings = [GNU<"shared">];
555 let Subjects = SubjectList<[Var]>;
556 let LangOpts = [CUDA];
557 let Documentation = [Undocumented];
558 }
559
560 def C11NoReturn : InheritableAttr {
561 let Spellings = [Keyword<"_Noreturn">];
562 let Subjects = SubjectList<[Function], ErrorDiag>;
563 let SemaHandler = 0;
564 let Documentation = [C11NoReturnDocs];
565 }
566
567 def CXX11NoReturn : InheritableAttr {
568 let Spellings = [CXX11<"","noreturn">];
569 let Subjects = SubjectList<[Function], ErrorDiag>;
570 let Documentation = [CXX11NoReturnDocs];
571 }
572
573 def OpenCLKernel : InheritableAttr {
574 let Spellings = [Keyword<"__kernel">, Keyword<"kernel">];
575 let Subjects = SubjectList<[Function], ErrorDiag>;
576 let Documentation = [Undocumented];
577 }
578
579 // This attribute is both a type attribute, and a declaration attribute (for
580 // parameter variables).
581 def OpenCLImageAccess : Attr {
582 let Spellings = [Keyword<"__read_only">, Keyword<"read_only">,
583 Keyword<"__write_only">, Keyword<"write_only">,
584 Keyword<"__read_write">, Keyword<"read_write">];
585 let Subjects = SubjectList<[ParmVar], ErrorDiag>;
586 let Accessors = [Accessor<"isReadOnly", [Keyword<"__read_only">,
587 Keyword<"read_only">]>,
588 Accessor<"isReadWrite", [Keyword<"__read_write">,
589 Keyword<"read_write">]>,
590 Accessor<"isWriteOnly", [Keyword<"__write_only">,
591 Keyword<"write_only">]>];
592 let Documentation = [Undocumented];
593 }
594
595 def OpenCLPrivateAddressSpace : TypeAttr {
596 let Spellings = [Keyword<"__private">, Keyword<"private">];
597 let Documentation = [Undocumented];
598 }
599
600 def OpenCLGlobalAddressSpace : TypeAttr {
601 let Spellings = [Keyword<"__global">, Keyword<"global">];
602 let Documentation = [Undocumented];
603 }
604
605 def OpenCLLocalAddressSpace : TypeAttr {
606 let Spellings = [Keyword<"__local">, Keyword<"local">];
607 let Documentation = [Undocumented];
608 }
609
610 def OpenCLConstantAddressSpace : TypeAttr {
611 let Spellings = [Keyword<"__constant">, Keyword<"constant">];
612 let Documentation = [Undocumented];
613 }
614
615 def Deprecated : InheritableAttr {
616 let Spellings = [GCC<"deprecated">, Declspec<"deprecated">,
617 CXX11<"","deprecated">];
618 let Args = [StringArgument<"Message", 1>];
619 let Documentation = [Undocumented];
620 }
621
622 def Destructor : InheritableAttr {
623 let Spellings = [GCC<"destructor">];
624 let Args = [DefaultIntArgument<"Priority", 65535>];
625 let Subjects = SubjectList<[Function]>;
626 let Documentation = [Undocumented];
627 }
628
629 def EnableIf : InheritableAttr {
630 let Spellings = [GNU<"enable_if">];
631 let Subjects = SubjectList<[Function]>;
632 let Args = [ExprArgument<"Cond">, StringArgument<"Message">];
633 let TemplateDependent = 1;
634 let Documentation = [EnableIfDocs];
635 }
636
637 def ExtVectorType : Attr {
638 let Spellings = [GNU<"ext_vector_type">];
639 let Subjects = SubjectList<[TypedefName], ErrorDiag>;
640 let Args = [ExprArgument<"NumElements">];
641 let ASTNode = 0;
642 let Documentation = [Undocumented];
643 }
644
645 def FallThrough : Attr {
646 let Spellings = [CXX11<"clang", "fallthrough">];
647 // let Subjects = [NullStmt];
648 let Documentation = [FallthroughDocs];
649 }
650
651 def FastCall : InheritableAttr {
652 let Spellings = [GCC<"fastcall">, Keyword<"__fastcall">,
653 Keyword<"_fastcall">];
654 // let Subjects = [Function, ObjCMethod];
655 let Documentation = [Undocumented];
656 }
657
658 def Final : InheritableAttr {
659 let Spellings = [Keyword<"final">, Keyword<"sealed">];
660 let Accessors = [Accessor<"isSpelledAsSealed", [Keyword<"sealed">]>];
661 let SemaHandler = 0;
662 let Documentation = [Undocumented];
663 }
664
665 def MinSize : InheritableAttr {
666 let Spellings = [GNU<"minsize">];
667 let Subjects = SubjectList<[Function, ObjCMethod], ErrorDiag>;
668 let Documentation = [Undocumented];
669 }
670
671 def Format : InheritableAttr {
672 let Spellings = [GCC<"format">];
673 let Args = [IdentifierArgument<"Type">, IntArgument<"FormatIdx">,
674 IntArgument<"FirstArg">];
675 let Subjects = SubjectList<[ObjCMethod, Block, HasFunctionProto], WarnDiag,
676 "ExpectedFunction">;
677 let Documentation = [FormatDocs];
678 }
679
680 def FormatArg : InheritableAttr {
681 let Spellings = [GCC<"format_arg">];
682 let Args = [IntArgument<"FormatIdx">];
683 let Subjects = SubjectList<[ObjCMethod, HasFunctionProto], WarnDiag,
684 "ExpectedFunction">;
685 let Documentation = [Undocumented];
686 }
687
688 def GNUInline : InheritableAttr {
689 let Spellings = [GCC<"gnu_inline">];
690 let Subjects = SubjectList<[Function]>;
691 let Documentation = [Undocumented];
692 }
693
694 def Hot : InheritableAttr {
695 let Spellings = [GCC<"hot">];
696 let Subjects = SubjectList<[Function]>;
697 // An AST node is created for this attribute, but not actually used beyond
698 // semantic checking for mutual exclusion with the Cold attribute.
699 let Documentation = [Undocumented];
700 }
701
702 def IBAction : InheritableAttr {
703 let Spellings = [GNU<"ibaction">];
704 let Subjects = SubjectList<[ObjCInstanceMethod], WarnDiag,
705 "ExpectedObjCInstanceMethod">;
706 // An AST node is created for this attribute, but is not used by other parts
707 // of the compiler. However, this node needs to exist in the AST because
708 // external tools rely on it.
709 let Documentation = [Undocumented];
710 }
711
712 def IBOutlet : InheritableAttr {
713 let Spellings = [GNU<"iboutlet">];
714 // let Subjects = [ObjCIvar, ObjCProperty];
715 let Documentation = [Undocumented];
716 }
717
718 def IBOutletCollection : InheritableAttr {
719 let Spellings = [GNU<"iboutletcollection">];
720 let Args = [TypeArgument<"Interface", 1>];
721 // let Subjects = [ObjCIvar, ObjCProperty];
722 let Documentation = [Undocumented];
723 }
724
725 def Malloc : InheritableAttr {
726 let Spellings = [GCC<"malloc">];
727 // let Subjects = [Function];
728 let Documentation = [Undocumented];
729 }
730
731 def MaxFieldAlignment : InheritableAttr {
732 // This attribute has no spellings as it is only ever created implicitly.
733 let Spellings = [];
734 let Args = [UnsignedArgument<"Alignment">];
735 let SemaHandler = 0;
736 let Documentation = [Undocumented];
737 }
738
739 def MayAlias : InheritableAttr {
740 // FIXME: this is a type attribute in GCC, but a declaration attribute here.
741 let Spellings = [GCC<"may_alias">];
742 let Documentation = [Undocumented];
743 }
744
745 def MSABI : InheritableAttr {
746 let Spellings = [GCC<"ms_abi">];
747 // let Subjects = [Function, ObjCMethod];
748 let Documentation = [Undocumented];
749 }
750
751 def MSP430Interrupt : InheritableAttr, TargetSpecificAttr<TargetMSP430> {
752 // NOTE: If you add any additional spellings, ARMInterrupt's spellings must
753 // match.
754 let Spellings = [GNU<"interrupt">];
755 let Args = [UnsignedArgument<"Number">];
756 let ParseKind = "Interrupt";
757 let HasCustomParsing = 1;
758 let Documentation = [Undocumented];
759 }
760
761 def Mips16 : InheritableAttr, TargetSpecificAttr<TargetMips> {
762 let Spellings = [GCC<"mips16">];
763 let Subjects = SubjectList<[Function], ErrorDiag>;
764 let Documentation = [Undocumented];
765 }
766
767 def Mode : Attr {
768 let Spellings = [GCC<"mode">];
769 let Args = [IdentifierArgument<"Mode">];
770 let Documentation = [Undocumented];
771 }
772
773 def Naked : InheritableAttr {
774 let Spellings = [GCC<"naked">, Declspec<"naked">];
775 let Subjects = SubjectList<[Function]>;
776 let Documentation = [Undocumented];
777 }
778
779 def NeonPolyVectorType : TypeAttr {
780 let Spellings = [GNU<"neon_polyvector_type">];
781 let Args = [IntArgument<"NumElements">];
782 let Documentation = [Undocumented];
783 }
784
785 def NeonVectorType : TypeAttr {
786 let Spellings = [GNU<"neon_vector_type">];
787 let Args = [IntArgument<"NumElements">];
788 let Documentation = [Undocumented];
789 }
790
791 def ReturnsTwice : InheritableAttr {
792 let Spellings = [GCC<"returns_twice">];
793 let Subjects = SubjectList<[Function]>;
794 let Documentation = [Undocumented];
795 }
796
797 def NoCommon : InheritableAttr {
798 let Spellings = [GCC<"nocommon">];
799 let Subjects = SubjectList<[Var]>;
800 let Documentation = [Undocumented];
801 }
802
803 def NoDebug : InheritableAttr {
804 let Spellings = [GNU<"nodebug">];
805 let Documentation = [Undocumented];
806 }
807
808 def NoDuplicate : InheritableAttr {
809 let Spellings = [GNU<"noduplicate">, CXX11<"clang", "noduplicate">];
810 let Subjects = SubjectList<[Function]>;
811 let Documentation = [NoDuplicateDocs];
812 }
813
814 def NoInline : InheritableAttr {
815 let Spellings = [GCC<"noinline">, Declspec<"noinline">];
816 let Subjects = SubjectList<[Function]>;
817 let Documentation = [Undocumented];
818 }
819
820 def NoMips16 : InheritableAttr, TargetSpecificAttr<TargetMips> {
821 let Spellings = [GCC<"nomips16">];
822 let Subjects = SubjectList<[Function], ErrorDiag>;
823 let Documentation = [Undocumented];
824 }
825
826 def NonNull : InheritableAttr {
827 let Spellings = [GCC<"nonnull">];
828 let Subjects = SubjectList<[ObjCMethod, HasFunctionProto, ParmVar], WarnDiag,
829 "ExpectedFunctionMethodOrParameter">;
830 let Args = [VariadicUnsignedArgument<"Args">];
831 let AdditionalMembers =
832 [{bool isNonNull(unsigned idx) const {
833 for (args_iterator i = args_begin(), e = args_end();
834 i != e; ++i)
835 if (*i == idx)
836 return true;
837 return false;
838 } }];
839 let Documentation = [Undocumented];
840 }
841
842 def ReturnsNonNull : InheritableAttr {
843 let Spellings = [GCC<"returns_nonnull">];
844 let Subjects = SubjectList<[ObjCMethod, HasFunctionProto], WarnDiag,
845 "ExpectedFunctionOrMethod">;
846 let Documentation = [Undocumented];
847 }
848
849 def NoReturn : InheritableAttr {
850 let Spellings = [GCC<"noreturn">, Declspec<"noreturn">];
851 // FIXME: Does GCC allow this on the function instead?
852 let Documentation = [Undocumented];
853 }
854
855 def NoInstrumentFunction : InheritableAttr {
856 let Spellings = [GCC<"no_instrument_function">];
857 let Subjects = SubjectList<[Function]>;
858 let Documentation = [Undocumented];
859 }
860
861 def NoThrow : InheritableAttr {
862 let Spellings = [GCC<"nothrow">, Declspec<"nothrow">];
863 let Documentation = [Undocumented];
864 }
865
866 def ObjCBridge : InheritableAttr {
867 let Spellings = [GNU<"objc_bridge">];
868 let Subjects = SubjectList<[Record], ErrorDiag>;
869 let Args = [IdentifierArgument<"BridgedType">];
870 let Documentation = [Undocumented];
871 }
872
873 def ObjCBridgeMutable : InheritableAttr {
874 let Spellings = [GNU<"objc_bridge_mutable">];
875 let Subjects = SubjectList<[Record], ErrorDiag>;
876 let Args = [IdentifierArgument<"BridgedType">];
877 let Documentation = [Undocumented];
878 }
879
880 def ObjCBridgeRelated : InheritableAttr {
881 let Spellings = [GNU<"objc_bridge_related">];
882 let Subjects = SubjectList<[Record], ErrorDiag>;
883 let Args = [IdentifierArgument<"RelatedClass">,
884 IdentifierArgument<"ClassMethod">,
885 IdentifierArgument<"InstanceMethod">];
886 let HasCustomParsing = 1;
887 let Documentation = [Undocumented];
888 }
889
890 def NSReturnsRetained : InheritableAttr {
891 let Spellings = [GNU<"ns_returns_retained">];
892 // let Subjects = SubjectList<[ObjCMethod, ObjCProperty, Function]>;
893 let Documentation = [Undocumented];
894 }
895
896 def NSReturnsNotRetained : InheritableAttr {
897 let Spellings = [GNU<"ns_returns_not_retained">];
898 // let Subjects = SubjectList<[ObjCMethod, ObjCProperty, Function]>;
899 let Documentation = [Undocumented];
900 }
901
902 def NSReturnsAutoreleased : InheritableAttr {
903 let Spellings = [GNU<"ns_returns_autoreleased">];
904 // let Subjects = SubjectList<[ObjCMethod, ObjCProperty, Function]>;
905 let Documentation = [Undocumented];
906 }
907
908 def NSConsumesSelf : InheritableAttr {
909 let Spellings = [GNU<"ns_consumes_self">];
910 let Subjects = SubjectList<[ObjCMethod]>;
911 let Documentation = [Undocumented];
912 }
913
914 def NSConsumed : InheritableParamAttr {
915 let Spellings = [GNU<"ns_consumed">];
916 let Subjects = SubjectList<[ParmVar]>;
917 let Documentation = [Undocumented];
918 }
919
920 def ObjCException : InheritableAttr {
921 let Spellings = [GNU<"objc_exception">];
922 let Subjects = SubjectList<[ObjCInterface], ErrorDiag>;
923 let Documentation = [Undocumented];
924 }
925
926 def ObjCMethodFamily : InheritableAttr {
927 let Spellings = [GNU<"objc_method_family">];
928 let Subjects = SubjectList<[ObjCMethod], ErrorDiag>;
929 let Args = [EnumArgument<"Family", "FamilyKind",
930 ["none", "alloc", "copy", "init", "mutableCopy", "new"],
931 ["OMF_None", "OMF_alloc", "OMF_copy", "OMF_init",
932 "OMF_mutableCopy", "OMF_new"]>];
933 let Documentation = [ObjCMethodFamilyDocs];
934 }
935
936 def ObjCNSObject : InheritableAttr {
937 let Spellings = [GNU<"NSObject">];
938 let Documentation = [Undocumented];
939 }
940
941 def ObjCPreciseLifetime : InheritableAttr {
942 let Spellings = [GNU<"objc_precise_lifetime">];
943 let Subjects = SubjectList<[Var], ErrorDiag>;
944 let Documentation = [Undocumented];
945 }
946
947 def ObjCReturnsInnerPointer : InheritableAttr {
948 let Spellings = [GNU<"objc_returns_inner_pointer">];
949 let Subjects = SubjectList<[ObjCMethod, ObjCProperty], ErrorDiag>;
950 let Documentation = [Undocumented];
951 }
952
953 def ObjCRequiresSuper : InheritableAttr {
954 let Spellings = [GNU<"objc_requires_super">];
955 let Subjects = SubjectList<[ObjCMethod], ErrorDiag>;
956 let Documentation = [ObjCRequiresSuperDocs];
957 }
958
959 def ObjCRootClass : InheritableAttr {
960 let Spellings = [GNU<"objc_root_class">];
961 let Subjects = SubjectList<[ObjCInterface], ErrorDiag>;
962 let Documentation = [Undocumented];
963 }
964
965 def ObjCExplicitProtocolImpl : InheritableAttr {
966 let Spellings = [GNU<"objc_protocol_requires_explicit_implementation">];
967 let Subjects = SubjectList<[ObjCProtocol], ErrorDiag>;
968 let Documentation = [Undocumented];
969 }
970
971 def ObjCDesignatedInitializer : Attr {
972 let Spellings = [GNU<"objc_designated_initializer">];
973 let Subjects = SubjectList<[ObjCInterfaceDeclInitMethod], ErrorDiag,
974 "ExpectedObjCInterfaceDeclInitMethod">;
975 let Documentation = [Undocumented];
976 }
977
978 def OptimizeNone : InheritableAttr {
979 let Spellings = [GNU<"optnone">, CXX11<"clang", "optnone">];
980 let Subjects = SubjectList<[Function, ObjCMethod]>;
981 let Documentation = [OptnoneDocs];
982 }
983
984 def Overloadable : Attr {
985 let Spellings = [GNU<"overloadable">];
986 let Subjects = SubjectList<[Function], ErrorDiag>;
987 let Documentation = [OverloadableDocs];
988 }
989
990 def Override : InheritableAttr {
991 let Spellings = [Keyword<"override">];
992 let SemaHandler = 0;
993 let Documentation = [Undocumented];
994 }
995
996 def Ownership : InheritableAttr {
997 let Spellings = [GNU<"ownership_holds">, GNU<"ownership_returns">,
998 GNU<"ownership_takes">];
999 let Accessors = [Accessor<"isHolds", [GNU<"ownership_holds">]>,
1000 Accessor<"isReturns", [GNU<"ownership_returns">]>,
1001 Accessor<"isTakes", [GNU<"ownership_takes">]>];
1002 let AdditionalMembers = [{
1003 enum OwnershipKind { Holds, Returns, Takes };
1004 OwnershipKind getOwnKind() const {
1005 return isHolds() ? Holds :
1006 isTakes() ? Takes :
1007 Returns;
1008 }
1009 }];
1010 let Args = [IdentifierArgument<"Module">, VariadicUnsignedArgument<"Args">];
1011 let Subjects = SubjectList<[HasFunctionProto], WarnDiag, "ExpectedFunction">;
1012 let Documentation = [Undocumented];
1013 }
1014
1015 def Packed : InheritableAttr {
1016 let Spellings = [GCC<"packed">];
1017 // let Subjects = [Tag, Field];
1018 let Documentation = [Undocumented];
1019 }
1020
1021 def PnaclCall : InheritableAttr {
1022 let Spellings = [GNU<"pnaclcall">];
1023 // let Subjects = [Function, ObjCMethod];
1024 let Documentation = [Undocumented];
1025 }
1026
1027 def IntelOclBicc : InheritableAttr {
1028 let Spellings = [GNU<"intel_ocl_bicc">];
1029 // let Subjects = [Function, ObjCMethod];
1030 let Documentation = [Undocumented];
1031 }
1032
1033 def Pcs : InheritableAttr {
1034 let Spellings = [GCC<"pcs">];
1035 let Args = [EnumArgument<"PCS", "PCSType",
1036 ["aapcs", "aapcs-vfp"],
1037 ["AAPCS", "AAPCS_VFP"]>];
1038 // let Subjects = [Function, ObjCMethod];
1039 let Documentation = [PcsDocs];
1040 }
1041
1042 def Pure : InheritableAttr {
1043 let Spellings = [GCC<"pure">];
1044 let Documentation = [Undocumented];
1045 }
1046
1047 def Regparm : TypeAttr {
1048 let Spellings = [GCC<"regparm">];
1049 let Args = [UnsignedArgument<"NumParams">];
1050 let Documentation = [Undocumented];
1051 }
1052
1053 def ReqdWorkGroupSize : InheritableAttr {
1054 let Spellings = [GNU<"reqd_work_group_size">];
1055 let Args = [UnsignedArgument<"XDim">, UnsignedArgument<"YDim">,
1056 UnsignedArgument<"ZDim">];
1057 let Subjects = SubjectList<[Function], ErrorDiag>;
1058 let Documentation = [Undocumented];
1059 }
1060
1061 def WorkGroupSizeHint : InheritableAttr {
1062 let Spellings = [GNU<"work_group_size_hint">];
1063 let Args = [UnsignedArgument<"XDim">,
1064 UnsignedArgument<"YDim">,
1065 UnsignedArgument<"ZDim">];
1066 let Subjects = SubjectList<[Function], ErrorDiag>;
1067 let Documentation = [Undocumented];
1068 }
1069
1070 def InitPriority : InheritableAttr {
1071 let Spellings = [GNU<"init_priority">];
1072 let Args = [UnsignedArgument<"Priority">];
1073 let Subjects = SubjectList<[Var], ErrorDiag>;
1074 let Documentation = [Undocumented];
1075 }
1076
1077 def Section : InheritableAttr {
1078 let Spellings = [GCC<"section">, Declspec<"allocate">];
1079 let Args = [StringArgument<"Name">];
1080 let Subjects = SubjectList<[Function, GlobalVar,
1081 ObjCMethod, ObjCProperty], ErrorDiag,
1082 "ExpectedFunctionGlobalVarMethodOrProperty">;
1083 let Documentation = [Undocumented];
1084 }
1085
1086 def Sentinel : InheritableAttr {
1087 let Spellings = [GCC<"sentinel">];
1088 let Args = [DefaultIntArgument<"Sentinel", 0>,
1089 DefaultIntArgument<"NullPos", 0>];
1090 // let Subjects = SubjectList<[Function, ObjCMethod, Block, Var]>;
1091 let Documentation = [Undocumented];
1092 }
1093
1094 def StdCall : InheritableAttr {
1095 let Spellings = [GCC<"stdcall">, Keyword<"__stdcall">, Keyword<"_stdcall">];
1096 // let Subjects = [Function, ObjCMethod];
1097 let Documentation = [Undocumented];
1098 }
1099
1100 def SysVABI : InheritableAttr {
1101 let Spellings = [GCC<"sysv_abi">];
1102 // let Subjects = [Function, ObjCMethod];
1103 let Documentation = [Undocumented];
1104 }
1105
1106 def ThisCall : InheritableAttr {
1107 let Spellings = [GCC<"thiscall">, Keyword<"__thiscall">,
1108 Keyword<"_thiscall">];
1109 // let Subjects = [Function, ObjCMethod];
1110 let Documentation = [Undocumented];
1111 }
1112
1113 def Pascal : InheritableAttr {
1114 let Spellings = [GNU<"pascal">, Keyword<"__pascal">, Keyword<"_pascal">];
1115 // let Subjects = [Function, ObjCMethod];
1116 let Documentation = [Undocumented];
1117 }
1118
1119 def TransparentUnion : InheritableAttr {
1120 let Spellings = [GCC<"transparent_union">];
1121 // let Subjects = SubjectList<[Record, TypedefName]>;
1122 let Documentation = [Undocumented];
1123 }
1124
1125 def Unavailable : InheritableAttr {
1126 let Spellings = [GNU<"unavailable">];
1127 let Args = [StringArgument<"Message", 1>];
1128 let Documentation = [Undocumented];
1129 }
1130
1131 def ArcWeakrefUnavailable : InheritableAttr {
1132 let Spellings = [GNU<"objc_arc_weak_reference_unavailable">];
1133 let Subjects = SubjectList<[ObjCInterface], ErrorDiag>;
1134 let Documentation = [Undocumented];
1135 }
1136
1137 def ObjCGC : TypeAttr {
1138 let Spellings = [GNU<"objc_gc">];
1139 let Args = [IdentifierArgument<"Kind">];
1140 let Documentation = [Undocumented];
1141 }
1142
1143 def ObjCOwnership : InheritableAttr {
1144 let Spellings = [GNU<"objc_ownership">];
1145 let Args = [IdentifierArgument<"Kind">];
1146 let ASTNode = 0;
1147 let Documentation = [Undocumented];
1148 }
1149
1150 def ObjCRequiresPropertyDefs : InheritableAttr {
1151 let Spellings = [GNU<"objc_requires_property_definitions">];
1152 let Subjects = SubjectList<[ObjCInterface], ErrorDiag>;
1153 let Documentation = [Undocumented];
1154 }
1155
1156 def Unused : InheritableAttr {
1157 let Spellings = [GCC<"unused">];
1158 let Subjects = SubjectList<[Var, ObjCIvar, Type, Label, Field, ObjCMethod,
1159 FunctionLike], WarnDiag,
1160 "ExpectedVariableFunctionOrLabel">;
1161 let Documentation = [Undocumented];
1162 }
1163
1164 def Used : InheritableAttr {
1165 let Spellings = [GCC<"used">];
1166 let Documentation = [Undocumented];
1167 }
1168
1169 def Uuid : InheritableAttr {
1170 let Spellings = [Declspec<"uuid">];
1171 let Args = [StringArgument<"Guid">];
1172 // let Subjects = SubjectList<[CXXRecord]>;
1173 let LangOpts = [MicrosoftExt, Borland];
1174 let Documentation = [Undocumented];
1175 }
1176
1177 def VectorSize : TypeAttr {
1178 let Spellings = [GCC<"vector_size">];
1179 let Args = [ExprArgument<"NumBytes">];
1180 let Documentation = [Undocumented];
1181 }
1182
1183 def VecTypeHint : InheritableAttr {
1184 let Spellings = [GNU<"vec_type_hint">];
1185 let Args = [TypeArgument<"TypeHint">];
1186 let Subjects = SubjectList<[Function], ErrorDiag>;
1187 let Documentation = [Undocumented];
1188 }
1189
1190 def Visibility : InheritableAttr {
1191 let Clone = 0;
1192 let Spellings = [GCC<"visibility">];
1193 let Args = [EnumArgument<"Visibility", "VisibilityType",
1194 ["default", "hidden", "internal", "protected"],
1195 ["Default", "Hidden", "Hidden", "Protected"]>];
1196 let Documentation = [Undocumented];
1197 }
1198
1199 def TypeVisibility : InheritableAttr {
1200 let Clone = 0;
1201 let Spellings = [GNU<"type_visibility">, CXX11<"clang", "type_visibility">];
1202 let Args = [EnumArgument<"Visibility", "VisibilityType",
1203 ["default", "hidden", "internal", "protected"],
1204 ["Default", "Hidden", "Hidden", "Protected"]>];
1205 // let Subjects = [Tag, ObjCInterface, Namespace];
1206 let Documentation = [Undocumented];
1207 }
1208
1209 def VecReturn : InheritableAttr {
1210 let Spellings = [GNU<"vecreturn">];
1211 let Subjects = SubjectList<[CXXRecord], ErrorDiag>;
1212 let Documentation = [Undocumented];
1213 }
1214
1215 def WarnUnused : InheritableAttr {
1216 let Spellings = [GNU<"warn_unused">];
1217 let Subjects = SubjectList<[Record]>;
1218 let Documentation = [Undocumented];
1219 }
1220
1221 def WarnUnusedResult : InheritableAttr {
1222 let Spellings = [GCC<"warn_unused_result">,
1223 CXX11<"clang", "warn_unused_result">];
1224 let Subjects = SubjectList<[ObjCMethod, CXXRecord, FunctionLike], WarnDiag,
1225 "ExpectedFunctionMethodOrClass">;
1226 let Documentation = [Undocumented];
1227 }
1228
1229 def Weak : InheritableAttr {
1230 let Spellings = [GCC<"weak">];
1231 let Subjects = SubjectList<[Var, Function, CXXRecord]>;
1232 let Documentation = [Undocumented];
1233 }
1234
1235 def WeakImport : InheritableAttr {
1236 let Spellings = [GNU<"weak_import">];
1237 let Documentation = [Undocumented];
1238 }
1239
1240 def WeakRef : InheritableAttr {
1241 let Spellings = [GCC<"weakref">];
1242 // A WeakRef that has an argument is treated as being an AliasAttr
1243 let Args = [StringArgument<"Aliasee", 1>];
1244 let Subjects = SubjectList<[Var, Function], ErrorDiag>;
1245 let Documentation = [Undocumented];
1246 }
1247
1248 def X86ForceAlignArgPointer : InheritableAttr, TargetSpecificAttr<TargetX86> {
1249 let Spellings = [GNU<"force_align_arg_pointer">];
1250 // Technically, this appertains to a FunctionDecl, but the target-specific
1251 // code silently allows anything function-like (such as typedefs or function
1252 // pointers), but does not apply the attribute to them.
1253 let Documentation = [Undocumented];
1254 }
1255
1256 // Attribute to disable AddressSanitizer (or equivalent) checks.
1257 def NoSanitizeAddress : InheritableAttr {
1258 let Spellings = [GCC<"no_address_safety_analysis">,
1259 GCC<"no_sanitize_address">];
1260 let Subjects = SubjectList<[Function, FunctionTemplate], ErrorDiag>;
1261 let Documentation = [NoSanitizeAddressDocs];
1262 }
1263
1264 // Attribute to disable ThreadSanitizer checks.
1265 def NoSanitizeThread : InheritableAttr {
1266 let Spellings = [GNU<"no_sanitize_thread">];
1267 let Subjects = SubjectList<[Function, FunctionTemplate], ErrorDiag>;
1268 let Documentation = [NoSanitizeThreadDocs];
1269 }
1270
1271 // Attribute to disable MemorySanitizer checks.
1272 def NoSanitizeMemory : InheritableAttr {
1273 let Spellings = [GNU<"no_sanitize_memory">];
1274 let Subjects = SubjectList<[Function, FunctionTemplate], ErrorDiag>;
1275 let Documentation = [NoSanitizeMemoryDocs];
1276 }
1277
1278 // C/C++ Thread safety attributes (e.g. for deadlock, data race checking)
1279
1280 def GuardedVar : InheritableAttr {
1281 let Spellings = [GNU<"guarded_var">];
1282 let Subjects = SubjectList<[Field, SharedVar], WarnDiag,
1283 "ExpectedFieldOrGlobalVar">;
1284 let Documentation = [Undocumented];
1285 }
1286
1287 def PtGuardedVar : InheritableAttr {
1288 let Spellings = [GNU<"pt_guarded_var">];
1289 let Subjects = SubjectList<[Field, SharedVar], WarnDiag,
1290 "ExpectedFieldOrGlobalVar">;
1291 let Documentation = [Undocumented];
1292 }
1293
1294 def Lockable : InheritableAttr {
1295 let Spellings = [GNU<"lockable">];
1296 let Subjects = SubjectList<[Record]>;
1297 let Documentation = [Undocumented];
1298 let ASTNode = 0; // Replaced by Capability
1299 }
1300
1301 def ScopedLockable : InheritableAttr {
1302 let Spellings = [GNU<"scoped_lockable">];
1303 let Subjects = SubjectList<[Record]>;
1304 let Documentation = [Undocumented];
1305 }
1306
1307 def Capability : InheritableAttr {
1308 let Spellings = [GNU<"capability">, CXX11<"clang", "capability">,
1309 GNU<"shared_capability">,
1310 CXX11<"clang", "shared_capability">];
1311 let Subjects = SubjectList<[Struct, TypedefName], ErrorDiag,
1312 "ExpectedStructOrTypedef">;
1313 let Args = [StringArgument<"Name">];
1314 let Accessors = [Accessor<"isShared",
1315 [GNU<"shared_capability">,
1316 CXX11<"clang","shared_capability">]>];
1317 let Documentation = [Undocumented];
1318 let AdditionalMembers = [{
1319 bool isMutex() const { return getName().equals_lower("mutex"); }
1320 bool isRole() const { return getName().equals_lower("role"); }
1321 }];
1322 }
1323
1324 def AssertCapability : InheritableAttr {
1325 let Spellings = [GNU<"assert_capability">,
1326 CXX11<"clang", "assert_capability">,
1327 GNU<"assert_shared_capability">,
1328 CXX11<"clang", "assert_shared_capability">];
1329 let Subjects = SubjectList<[Function, FunctionTemplate]>;
1330 let LateParsed = 1;
1331 let TemplateDependent = 1;
1332 let ParseArgumentsAsUnevaluated = 1;
1333 let DuplicatesAllowedWhileMerging = 1;
1334 let Args = [ExprArgument<"Expr">];
1335 let Accessors = [Accessor<"isShared",
1336 [GNU<"assert_shared_capability">,
1337 CXX11<"clang", "assert_shared_capability">]>];
1338 let Documentation = [AssertCapabilityDocs];
1339 }
1340
1341 def AcquireCapability : InheritableAttr {
1342 let Spellings = [GNU<"acquire_capability">,
1343 CXX11<"clang", "acquire_capability">,
1344 GNU<"acquire_shared_capability">,
1345 CXX11<"clang", "acquire_shared_capability">,
1346 GNU<"exclusive_lock_function">,
1347 GNU<"shared_lock_function">];
1348 let Subjects = SubjectList<[Function, FunctionTemplate]>;
1349 let LateParsed = 1;
1350 let TemplateDependent = 1;
1351 let ParseArgumentsAsUnevaluated = 1;
1352 let DuplicatesAllowedWhileMerging = 1;
1353 let Args = [VariadicExprArgument<"Args">];
1354 let Accessors = [Accessor<"isShared",
1355 [GNU<"acquire_shared_capability">,
1356 CXX11<"clang", "acquire_shared_capability">,
1357 GNU<"shared_lock_function">]>];
1358 let Documentation = [AcquireCapabilityDocs];
1359 }
1360
1361 def TryAcquireCapability : InheritableAttr {
1362 let Spellings = [GNU<"try_acquire_capability">,
1363 CXX11<"clang", "try_acquire_capability">,
1364 GNU<"try_acquire_shared_capability">,
1365 CXX11<"clang", "try_acquire_shared_capability">];
1366 let Subjects = SubjectList<[Function, FunctionTemplate],
1367 ErrorDiag>;
1368 let LateParsed = 1;
1369 let TemplateDependent = 1;
1370 let ParseArgumentsAsUnevaluated = 1;
1371 let DuplicatesAllowedWhileMerging = 1;
1372 let Args = [ExprArgument<"SuccessValue">, VariadicExprArgument<"Args">];
1373 let Accessors = [Accessor<"isShared",
1374 [GNU<"try_acquire_shared_capability">,
1375 CXX11<"clang", "try_acquire_shared_capability">]>];
1376 let Documentation = [TryAcquireCapabilityDocs];
1377 }
1378
1379 def ReleaseCapability : InheritableAttr {
1380 let Spellings = [GNU<"release_capability">,
1381 CXX11<"clang", "release_capability">,
1382 GNU<"release_shared_capability">,
1383 CXX11<"clang", "release_shared_capability">,
1384 GNU<"release_generic_capability">,
1385 CXX11<"clang", "release_generic_capability">,
1386 GNU<"unlock_function">];
1387 let Subjects = SubjectList<[Function, FunctionTemplate]>;
1388 let LateParsed = 1;
1389 let TemplateDependent = 1;
1390 let ParseArgumentsAsUnevaluated = 1;
1391 let DuplicatesAllowedWhileMerging = 1;
1392 let Args = [VariadicExprArgument<"Args">];
1393 let Accessors = [Accessor<"isShared",
1394 [GNU<"release_shared_capability">,
1395 CXX11<"clang", "release_shared_capability">]>,
1396 Accessor<"isGeneric",
1397 [GNU<"release_generic_capability">,
1398 CXX11<"clang", "release_generic_capability">,
1399 GNU<"unlock_function">]>];
1400 let Documentation = [ReleaseCapabilityDocs];
1401 }
1402
1403 def RequiresCapability : InheritableAttr {
1404 let Spellings = [GNU<"requires_capability">,
1405 CXX11<"clang", "requires_capability">,
1406 GNU<"exclusive_locks_required">,
1407 GNU<"requires_shared_capability">,
1408 CXX11<"clang", "requires_shared_capability">,
1409 GNU<"shared_locks_required">];
1410 let Args = [VariadicExprArgument<"Args">];
1411 let LateParsed = 1;
1412 let TemplateDependent = 1;
1413 let ParseArgumentsAsUnevaluated = 1;
1414 let DuplicatesAllowedWhileMerging = 1;
1415 let Subjects = SubjectList<[Function, FunctionTemplate]>;
1416 let Accessors = [Accessor<"isShared", [GNU<"requires_shared_capability">,
1417 GNU<"shared_locks_required">,
1418 CXX11<"clang","requires_shared_capability">]>];
1419 let Documentation = [Undocumented];
1420 }
1421
1422 def NoThreadSafetyAnalysis : InheritableAttr {
1423 let Spellings = [GNU<"no_thread_safety_analysis">];
1424 let Subjects = SubjectList<[Function, FunctionTemplate]>;
1425 let Documentation = [Undocumented];
1426 }
1427
1428 def GuardedBy : InheritableAttr {
1429 let Spellings = [GNU<"guarded_by">];
1430 let Args = [ExprArgument<"Arg">];
1431 let LateParsed = 1;
1432 let TemplateDependent = 1;
1433 let ParseArgumentsAsUnevaluated = 1;
1434 let DuplicatesAllowedWhileMerging = 1;
1435 let Subjects = SubjectList<[Field, SharedVar], WarnDiag,
1436 "ExpectedFieldOrGlobalVar">;
1437 let Documentation = [Undocumented];
1438 }
1439
1440 def PtGuardedBy : InheritableAttr {
1441 let Spellings = [GNU<"pt_guarded_by">];
1442 let Args = [ExprArgument<"Arg">];
1443 let LateParsed = 1;
1444 let TemplateDependent = 1;
1445 let ParseArgumentsAsUnevaluated = 1;
1446 let DuplicatesAllowedWhileMerging = 1;
1447 let Subjects = SubjectList<[Field, SharedVar], WarnDiag,
1448 "ExpectedFieldOrGlobalVar">;
1449 let Documentation = [Undocumented];
1450 }
1451
1452 def AcquiredAfter : InheritableAttr {
1453 let Spellings = [GNU<"acquired_after">];
1454 let Args = [VariadicExprArgument<"Args">];
1455 let LateParsed = 1;
1456 let TemplateDependent = 1;
1457 let ParseArgumentsAsUnevaluated = 1;
1458 let DuplicatesAllowedWhileMerging = 1;
1459 let Subjects = SubjectList<[Field, SharedVar], WarnDiag,
1460 "ExpectedFieldOrGlobalVar">;
1461 let Documentation = [Undocumented];
1462 }
1463
1464 def AcquiredBefore : InheritableAttr {
1465 let Spellings = [GNU<"acquired_before">];
1466 let Args = [VariadicExprArgument<"Args">];
1467 let LateParsed = 1;
1468 let TemplateDependent = 1;
1469 let ParseArgumentsAsUnevaluated = 1;
1470 let DuplicatesAllowedWhileMerging = 1;
1471 let Subjects = SubjectList<[Field, SharedVar], WarnDiag,
1472 "ExpectedFieldOrGlobalVar">;
1473 let Documentation = [Undocumented];
1474 }
1475
1476 def AssertExclusiveLock : InheritableAttr {
1477 let Spellings = [GNU<"assert_exclusive_lock">];
1478 let Args = [VariadicExprArgument<"Args">];
1479 let LateParsed = 1;
1480 let TemplateDependent = 1;
1481 let ParseArgumentsAsUnevaluated = 1;
1482 let DuplicatesAllowedWhileMerging = 1;
1483 let Subjects = SubjectList<[Function, FunctionTemplate]>;
1484 let Documentation = [Undocumented];
1485 }
1486
1487 def AssertSharedLock : InheritableAttr {
1488 let Spellings = [GNU<"assert_shared_lock">];
1489 let Args = [VariadicExprArgument<"Args">];
1490 let LateParsed = 1;
1491 let TemplateDependent = 1;
1492 let ParseArgumentsAsUnevaluated = 1;
1493 let DuplicatesAllowedWhileMerging = 1;
1494 let Subjects = SubjectList<[Function, FunctionTemplate]>;
1495 let Documentation = [Undocumented];
1496 }
1497
1498 // The first argument is an integer or boolean value specifying the return value
1499 // of a successful lock acquisition.
1500 def ExclusiveTrylockFunction : InheritableAttr {
1501 let Spellings = [GNU<"exclusive_trylock_function">];
1502 let Args = [ExprArgument<"SuccessValue">, VariadicExprArgument<"Args">];
1503 let LateParsed = 1;
1504 let TemplateDependent = 1;
1505 let ParseArgumentsAsUnevaluated = 1;
1506 let DuplicatesAllowedWhileMerging = 1;
1507 let Subjects = SubjectList<[Function, FunctionTemplate]>;
1508 let Documentation = [Undocumented];
1509 }
1510
1511 // The first argument is an integer or boolean value specifying the return value
1512 // of a successful lock acquisition.
1513 def SharedTrylockFunction : InheritableAttr {
1514 let Spellings = [GNU<"shared_trylock_function">];
1515 let Args = [ExprArgument<"SuccessValue">, VariadicExprArgument<"Args">];
1516 let LateParsed = 1;
1517 let TemplateDependent = 1;
1518 let ParseArgumentsAsUnevaluated = 1;
1519 let DuplicatesAllowedWhileMerging = 1;
1520 let Subjects = SubjectList<[Function, FunctionTemplate]>;
1521 let Documentation = [Undocumented];
1522 }
1523
1524 def LockReturned : InheritableAttr {
1525 let Spellings = [GNU<"lock_returned">];
1526 let Args = [ExprArgument<"Arg">];
1527 let LateParsed = 1;
1528 let TemplateDependent = 1;
1529 let ParseArgumentsAsUnevaluated = 1;
1530 let Subjects = SubjectList<[Function, FunctionTemplate]>;
1531 let Documentation = [Undocumented];
1532 }
1533
1534 def LocksExcluded : InheritableAttr {
1535 let Spellings = [GNU<"locks_excluded">];
1536 let Args = [VariadicExprArgument<"Args">];
1537 let LateParsed = 1;
1538 let TemplateDependent = 1;
1539 let ParseArgumentsAsUnevaluated = 1;
1540 let DuplicatesAllowedWhileMerging = 1;
1541 let Subjects = SubjectList<[Function, FunctionTemplate]>;
1542 let Documentation = [Undocumented];
1543 }
1544
1545 // C/C++ consumed attributes.
1546
1547 def Consumable : InheritableAttr {
1548 let Spellings = [GNU<"consumable">];
1549 let Subjects = SubjectList<[CXXRecord]>;
1550 let Args = [EnumArgument<"DefaultState", "ConsumedState",
1551 ["unknown", "consumed", "unconsumed"],
1552 ["Unknown", "Consumed", "Unconsumed"]>];
1553 let Documentation = [ConsumableDocs];
1554 }
1555
1556 def ConsumableAutoCast : InheritableAttr {
1557 let Spellings = [GNU<"consumable_auto_cast_state">];
1558 let Subjects = SubjectList<[CXXRecord]>;
1559 let Documentation = [Undocumented];
1560 }
1561
1562 def ConsumableSetOnRead : InheritableAttr {
1563 let Spellings = [GNU<"consumable_set_state_on_read">];
1564 let Subjects = SubjectList<[CXXRecord]>;
1565 let Documentation = [Undocumented];
1566 }
1567
1568 def CallableWhen : InheritableAttr {
1569 let Spellings = [GNU<"callable_when">];
1570 let Subjects = SubjectList<[CXXMethod]>;
1571 let Args = [VariadicEnumArgument<"CallableState", "ConsumedState",
1572 ["unknown", "consumed", "unconsumed"],
1573 ["Unknown", "Consumed", "Unconsumed"]>];
1574 let Documentation = [CallableWhenDocs];
1575 }
1576
1577 def ParamTypestate : InheritableAttr {
1578 let Spellings = [GNU<"param_typestate">];
1579 let Subjects = SubjectList<[ParmVar]>;
1580 let Args = [EnumArgument<"ParamState", "ConsumedState",
1581 ["unknown", "consumed", "unconsumed"],
1582 ["Unknown", "Consumed", "Unconsumed"]>];
1583 let Documentation = [ParamTypestateDocs];
1584 }
1585
1586 def ReturnTypestate : InheritableAttr {
1587 let Spellings = [GNU<"return_typestate">];
1588 let Subjects = SubjectList<[Function, ParmVar]>;
1589 let Args = [EnumArgument<"State", "ConsumedState",
1590 ["unknown", "consumed", "unconsumed"],
1591 ["Unknown", "Consumed", "Unconsumed"]>];
1592 let Documentation = [ReturnTypestateDocs];
1593 }
1594
1595 def SetTypestate : InheritableAttr {
1596 let Spellings = [GNU<"set_typestate">];
1597 let Subjects = SubjectList<[CXXMethod]>;
1598 let Args = [EnumArgument<"NewState", "ConsumedState",
1599 ["unknown", "consumed", "unconsumed"],
1600 ["Unknown", "Consumed", "Unconsumed"]>];
1601 let Documentation = [SetTypestateDocs];
1602 }
1603
1604 def TestTypestate : InheritableAttr {
1605 let Spellings = [GNU<"test_typestate">];
1606 let Subjects = SubjectList<[CXXMethod]>;
1607 let Args = [EnumArgument<"TestState", "ConsumedState",
1608 ["consumed", "unconsumed"],
1609 ["Consumed", "Unconsumed"]>];
1610 let Documentation = [TestTypestateDocs];
1611 }
1612
1613 // Type safety attributes for `void *' pointers and type tags.
1614
1615 def ArgumentWithTypeTag : InheritableAttr {
1616 let Spellings = [GNU<"argument_with_type_tag">,
1617 GNU<"pointer_with_type_tag">];
1618 let Args = [IdentifierArgument<"ArgumentKind">,
1619 UnsignedArgument<"ArgumentIdx">,
1620 UnsignedArgument<"TypeTagIdx">,
1621 BoolArgument<"IsPointer">];
1622 let HasCustomParsing = 1;
1623 let Documentation = [ArgumentWithTypeTagDocs, PointerWithTypeTagDocs];
1624 }
1625
1626 def TypeTagForDatatype : InheritableAttr {
1627 let Spellings = [GNU<"type_tag_for_datatype">];
1628 let Args = [IdentifierArgument<"ArgumentKind">,
1629 TypeArgument<"MatchingCType">,
1630 BoolArgument<"LayoutCompatible">,
1631 BoolArgument<"MustBeNull">];
1632 // let Subjects = SubjectList<[Var], ErrorDiag>;
1633 let HasCustomParsing = 1;
1634 let Documentation = [TypeTagForDatatypeDocs];
1635 }
1636
1637 // Microsoft-related attributes
1638
1639 def MsProperty : IgnoredAttr {
1640 let Spellings = [Declspec<"property">];
1641 }
1642
1643 def MsStruct : InheritableAttr {
1644 let Spellings = [GCC<"ms_struct">];
1645 let Subjects = SubjectList<[Record]>;
1646 let Documentation = [Undocumented];
1647 }
1648
1649 def DLLExport : InheritableAttr, TargetSpecificAttr<TargetX86Win> {
1650 let Spellings = [Declspec<"dllexport">, GCC<"dllexport">];
1651 let Subjects = SubjectList<[Function, Var]>;
1652 let Documentation = [Undocumented];
1653 }
1654
1655 def DLLImport : InheritableAttr, TargetSpecificAttr<TargetX86Win> {
1656 let Spellings = [Declspec<"dllimport">, GCC<"dllimport">];
1657 // Technically, the subjects for DllImport are Function and Var, but there is
1658 // custom semantic handling required when MicrosoftExt is true.
1659 let Documentation = [Undocumented];
1660 }
1661
1662 def SelectAny : InheritableAttr {
1663 let Spellings = [Declspec<"selectany">];
1664 let LangOpts = [MicrosoftExt];
1665 let Documentation = [Undocumented];
1666 }
1667
1668 def Win64 : IgnoredAttr {
1669 let Spellings = [Keyword<"__w64">];
1670 let LangOpts = [MicrosoftExt];
1671 }
1672
1673 def Ptr32 : TypeAttr {
1674 let Spellings = [Keyword<"__ptr32">];
1675 let Documentation = [Undocumented];
1676 }
1677
1678 def Ptr64 : TypeAttr {
1679 let Spellings = [Keyword<"__ptr64">];
1680 let Documentation = [Undocumented];
1681 }
1682
1683 def SPtr : TypeAttr {
1684 let Spellings = [Keyword<"__sptr">];
1685 let Documentation = [Undocumented];
1686 }
1687
1688 def UPtr : TypeAttr {
1689 let Spellings = [Keyword<"__uptr">];
1690 let Documentation = [Undocumented];
1691 }
1692
1693 def MSInheritance : InheritableAttr {
1694 let LangOpts = [MicrosoftExt];
1695 let Args = [DefaultBoolArgument<"BestCase", 1>];
1696 let Spellings = [Keyword<"__single_inheritance">,
1697 Keyword<"__multiple_inheritance">,
1698 Keyword<"__virtual_inheritance">,
1699 Keyword<"__unspecified_inheritance">];
1700 let Documentation = [SectionDocs];
1701 let AdditionalMembers = [{
1702 static bool hasVBPtrOffsetField(Spelling Inheritance) {
1703 return Inheritance == Keyword_unspecified_inheritance;
1704 }
1705
1706 // Only member pointers to functions need a this adjustment, since it can be
1707 // combined with the field offset for data pointers.
1708 static bool hasNVOffsetField(bool IsMemberFunction, Spelling Inheritance) {
1709 return IsMemberFunction && Inheritance >= Keyword_multiple_inheritance;
1710 }
1711
1712 static bool hasVBTableOffsetField(Spelling Inheritance) {
1713 return Inheritance >= Keyword_virtual_inheritance;
1714 }
1715
1716 static bool hasOnlyOneField(bool IsMemberFunction,
1717 Spelling Inheritance) {
1718 if (IsMemberFunction)
1719 return Inheritance <= Keyword_single_inheritance;
1720 return Inheritance <= Keyword_multiple_inheritance;
1721 }
1722 }];
1723 let Documentation = [MSInheritanceDocs];
1724 }
1725
1726 def MSVtorDisp : InheritableAttr {
1727 // This attribute has no spellings as it is only ever created implicitly.
1728 let Spellings = [];
1729 let Args = [UnsignedArgument<"vdm">];
1730 let SemaHandler = 0;
1731
1732 let AdditionalMembers = [{
1733 enum Mode {
1734 Never,
1735 ForVBaseOverride,
1736 ForVFTable
1737 };
1738
1739 Mode getVtorDispMode() const { return Mode(vdm); }
1740 }];
1741 let Documentation = [Undocumented];
1742 }
1743
1744 def Unaligned : IgnoredAttr {
1745 let Spellings = [Keyword<"__unaligned">];
1746 }

llvm-admin@cs.uiuc.edu
ViewVC Help
Powered by ViewVC 1.1.5