diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2011-05-02 19:39:53 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2011-05-02 19:39:53 +0000 |
commit | 01af97d3b23bded2b2b21af19bbc6e4cce49e5b3 (patch) | |
tree | 64a10f4c4154739d4a8191d7e1b52ce497f4ebd6 /include/clang/Basic/Attr.td | |
parent | c3b054d250cdca485c71845089c316e10610ebad (diff) | |
download | src-01af97d3b23bded2b2b21af19bbc6e4cce49e5b3.tar.gz src-01af97d3b23bded2b2b21af19bbc6e4cce49e5b3.zip |
Vendor import of clang trunk r130700:vendor/clang/clang-r130700
Notes
Notes:
svn path=/vendor/clang/dist/; revision=221339
svn path=/vendor/clang/clang-r130700/; revision=221340; tag=vendor/clang/clang-r130700
Diffstat (limited to 'include/clang/Basic/Attr.td')
-rw-r--r-- | include/clang/Basic/Attr.td | 55 |
1 files changed, 47 insertions, 8 deletions
diff --git a/include/clang/Basic/Attr.td b/include/clang/Basic/Attr.td index 3e62d411d51a..e4c6722e8378 100644 --- a/include/clang/Basic/Attr.td +++ b/include/clang/Basic/Attr.td @@ -46,6 +46,7 @@ class Argument<string name> { string Name = name; } +class BoolArgument<string name> : Argument<name>; class IdentifierArgument<string name> : Argument<name>; class IntArgument<string name> : Argument<name>; class StringArgument<string name> : Argument<name>; @@ -55,6 +56,9 @@ class TypeArgument<string name> : Argument<name>; class UnsignedArgument<string name> : Argument<name>; class VariadicUnsignedArgument<string name> : Argument<name>; +// A version of the form major.minor[.subminor]. +class VersionArgument<string name> : Argument<name>; + // This one's a doozy, so it gets its own special type // It can be an unsigned integer, or a type. Either can // be dependent. @@ -89,8 +93,13 @@ class Attr { code AdditionalMembers = [{}]; } +/// An inheritable attribute is inherited by later redeclarations. class InheritableAttr : Attr; +/// An inheritable parameter attribute is inherited by later +/// redeclarations, even when it's written on a parameter. +class InheritableParamAttr : InheritableAttr; + // // Attributes begin here // @@ -129,12 +138,26 @@ def AsmLabel : InheritableAttr { let Args = [StringArgument<"Label">]; } +def Availability : InheritableAttr { + let Spellings = ["availability"]; + let Args = [IdentifierArgument<"platform">, VersionArgument<"introduced">, + VersionArgument<"deprecated">, VersionArgument<"obsoleted">, + BoolArgument<"unavailable">]; + let AdditionalMembers = +[{static llvm::StringRef getPrettyPlatformName(llvm::StringRef Platform) { + return llvm::StringSwitch<llvm::StringRef>(Platform) + .Case("ios", "iOS") + .Case("macosx", "Mac OS X") + .Default(llvm::StringRef()); +} }]; +} + def Blocks : InheritableAttr { let Spellings = ["blocks"]; let Args = [EnumArgument<"Type", "BlockType", ["byref"], ["ByRef"]>]; } -def CarriesDependency : InheritableAttr { +def CarriesDependency : InheritableParamAttr { let Spellings = ["carries_dependency"]; let Subjects = [ParmVar, Function]; let Namespaces = ["", "std"]; @@ -154,7 +177,7 @@ def CFReturnsNotRetained : InheritableAttr { let Subjects = [ObjCMethod, Function]; } -def CFConsumed : InheritableAttr { +def CFConsumed : InheritableParamAttr { let Spellings = ["cf_consumed"]; let Subjects = [ParmVar]; } @@ -224,10 +247,6 @@ def DLLImport : InheritableAttr { let Spellings = ["dllimport"]; } -def Explicit : InheritableAttr { - let Spellings = []; -} - def FastCall : InheritableAttr { let Spellings = ["fastcall", "__fastcall"]; } @@ -236,6 +255,10 @@ def Final : InheritableAttr { let Spellings = []; } +def MsStruct : InheritableAttr { + let Spellings = ["__ms_struct__"]; +} + def Format : InheritableAttr { let Spellings = ["format"]; let Args = [StringArgument<"Type">, IntArgument<"FormatIdx">, @@ -261,7 +284,7 @@ def IBOutlet : InheritableAttr { def IBOutletCollection : InheritableAttr { let Spellings = ["iboutletcollection"]; - let Args = [TypeArgument<"Interface">]; + let Args = [TypeArgument<"InterFace">]; } def Malloc : InheritableAttr { @@ -355,7 +378,7 @@ def NSConsumesSelf : InheritableAttr { let Subjects = [ObjCMethod]; } -def NSConsumed : InheritableAttr { +def NSConsumed : InheritableParamAttr { let Spellings = ["ns_consumed"]; let Subjects = [ParmVar]; } @@ -364,6 +387,15 @@ def ObjCException : InheritableAttr { let Spellings = ["objc_exception"]; } +def ObjCMethodFamily : InheritableAttr { + let Spellings = ["objc_method_family"]; + let Subjects = [ObjCMethod]; + let Args = [EnumArgument<"Family", "FamilyKind", + ["none", "alloc", "copy", "init", "mutableCopy", "new"], + ["OMF_None", "OMF_alloc", "OMF_copy", "OMF_init", + "OMF_mutableCopy", "OMF_new"]>]; +} + def ObjCNSObject : InheritableAttr { let Spellings = ["NSObject"]; } @@ -388,6 +420,13 @@ def Packed : InheritableAttr { let Spellings = ["packed"]; } +def Pcs : InheritableAttr { + let Spellings = ["pcs"]; + let Args = [EnumArgument<"PCS", "PCSType", + ["aapcs", "aapcs-vfp"], + ["AAPCS", "AAPCS_VFP"]>]; +} + def Pure : InheritableAttr { let Spellings = ["pure"]; } |