code AdditionalMembers = [{}];
}
+/// A type attribute is not processed on a declaration or a statement.
+class TypeAttr : Attr {
+ let ASTNode = 0;
+}
+
/// An inheritable attribute is inherited by later redeclarations.
class InheritableAttr : Attr;
+/// A target-specific attribute that is meant to be processed via
+/// TargetAttributesSema::ProcessDeclAttribute. This class is meant to be used
+/// as a mixin with InheritableAttr or Attr depending on the attribute's needs.
+class TargetSpecificAttr;
+
/// An inheritable parameter attribute is inherited by later
/// redeclarations, even when it's written on a parameter.
class InheritableParamAttr : InheritableAttr;
// Attributes begin here
//
-def AddressSpace : Attr {
+def AddressSpace : TypeAttr {
let Spellings = [GNU<"address_space">];
let Args = [IntArgument<"AddressSpace">];
- let ASTNode = 0;
}
def Alias : InheritableAttr {
def AlignMac68k : InheritableAttr {
let Spellings = [];
- let SemaHandler = 0;\r
-}\r
-\r
-def AllocSize : InheritableAttr {\r
- let Spellings = [GNU<"alloc_size">, CXX11<"gnu", "alloc_size">];\r
- let Args = [VariadicUnsignedArgument<"Args">];\r
-}\r
+ let SemaHandler = 0;
+}
+
+def AllocSize : InheritableAttr {
+ let Spellings = [GNU<"alloc_size">, CXX11<"gnu", "alloc_size">];
+ let Args = [VariadicUnsignedArgument<"Args">];
+}
def AlwaysInline : InheritableAttr {
let Spellings = [GNU<"always_inline">, CXX11<"gnu", "always_inline">];
def CXX11NoReturn : InheritableAttr {
let Spellings = [CXX11<"","noreturn">, CXX11<"std","noreturn">];
- let Subjects = [Function];\r
-}\r
-\r
-def OpenCLKernel : InheritableAttr {\r
- let Spellings = [Keyword<"__kernel">, Keyword<"kernel">];\r
-}\r
-\r
-def OpenCLImageAccess : Attr {\r
- let Spellings = [GNU<"opencl_image_access">];\r
- let Args = [IntArgument<"Access">];\r
-}\r
+ let Subjects = [Function];
+}
+
+def OpenCLKernel : InheritableAttr {
+ let Spellings = [Keyword<"__kernel">, Keyword<"kernel">];
+}
+
+def OpenCLImageAccess : Attr {
+ let Spellings = [GNU<"opencl_image_access">];
+ let Args = [IntArgument<"Access">];
+}
def Deprecated : InheritableAttr {
let Spellings = [GNU<"deprecated">, CXX11<"gnu", "deprecated">];
def Destructor : InheritableAttr {
let Spellings = [GNU<"destructor">, CXX11<"gnu", "destructor">];
- let Args = [IntArgument<"Priority">];\r
-}\r
-\r
-def ExtVectorType : Attr {\r
- let Spellings = [GNU<"ext_vector_type">];\r
- let Args = [ExprArgument<"NumElements">];\r
- let ASTNode = 0;\r
+ let Args = [IntArgument<"Priority">];
+}
+
+def ExtVectorType : Attr {
+ let Spellings = [GNU<"ext_vector_type">];
+ let Args = [ExprArgument<"NumElements">];
+ let ASTNode = 0;
}
def FallThrough : Attr {
let Spellings = [GNU<"may_alias">, CXX11<"gnu", "may_alias">];
}
-def MSP430Interrupt : InheritableAttr {
+def MSP430Interrupt : InheritableAttr, TargetSpecificAttr {
let Spellings = [];
let Args = [UnsignedArgument<"Number">];
let SemaHandler = 0;
}
-def Mips16 : InheritableAttr {
+def Mips16 : InheritableAttr, TargetSpecificAttr {
let Spellings = [GNU<"mips16">, CXX11<"gnu", "mips16">];
- let Subjects = [Function];\r
-}\r
-\r
-def Mode : Attr {\r
- let Spellings = [GNU<"mode">, CXX11<"gnu", "mode">];\r
- let Args = [IdentifierArgument<"Mode">];\r
-}\r
+ let Subjects = [Function];
+}
+
+def Mode : Attr {
+ let Spellings = [GNU<"mode">, CXX11<"gnu", "mode">];
+ let Args = [IdentifierArgument<"Mode">];
+}
def Naked : InheritableAttr {
let Spellings = [GNU<"naked">, CXX11<"gnu", "naked">];
}
-def NeonPolyVectorType : Attr {
+def NeonPolyVectorType : TypeAttr {
let Spellings = [GNU<"neon_polyvector_type">];
let Args = [IntArgument<"NumElements">];
- let ASTNode = 0;
}
-def NeonVectorType : Attr {
+def NeonVectorType : TypeAttr {
let Spellings = [GNU<"neon_vector_type">];
let Args = [IntArgument<"NumElements">];
- let ASTNode = 0;
}
def ReturnsTwice : InheritableAttr {
let Spellings = [GNU<"noinline">, CXX11<"gnu", "noinline">];
}
-def NoMips16 : InheritableAttr {
+def NoMips16 : InheritableAttr, TargetSpecificAttr {
let Spellings = [GNU<"nomips16">, CXX11<"gnu", "nomips16">];
let Subjects = [Function];
}
}
def ObjCNSObject : InheritableAttr {
- let Spellings = [GNU<"NSObject">];\r
-}\r
-\r
-def ObjCPreciseLifetime : InheritableAttr {\r
- let Spellings = [GNU<"objc_precise_lifetime">];\r
- let Subjects = [Var];\r
-}\r
-\r
-def ObjCReturnsInnerPointer : InheritableAttr {\r
- let Spellings = [GNU<"objc_returns_inner_pointer">];\r
- let Subjects = [ObjCMethod];\r
-}\r
+ let Spellings = [GNU<"NSObject">];
+}
+
+def ObjCPreciseLifetime : InheritableAttr {
+ let Spellings = [GNU<"objc_precise_lifetime">];
+ let Subjects = [Var];
+}
+
+def ObjCReturnsInnerPointer : InheritableAttr {
+ let Spellings = [GNU<"objc_returns_inner_pointer">];
+ let Subjects = [ObjCMethod];
+}
def ObjCRequiresSuper : InheritableAttr {
let Spellings = [GNU<"objc_requires_super">];
- let Subjects = [ObjCMethod];\r
-}\r
-\r
-def ObjCRootClass : InheritableAttr {\r
- let Spellings = [GNU<"objc_root_class">];\r
- let Subjects = [ObjCInterface];\r
-}\r
+ let Subjects = [ObjCMethod];
+}
+
+def ObjCRootClass : InheritableAttr {
+ let Spellings = [GNU<"objc_root_class">];
+ let Subjects = [ObjCInterface];
+}
def Overloadable : Attr {
let Spellings = [GNU<"overloadable">];
let Subjects = [ObjCInterface];
}
-def ObjCGC : Attr {
+def ObjCGC : TypeAttr {
let Spellings = [GNU<"objc_gc">];
let Args = [IdentifierArgument<"Kind">];
- let ASTNode = 0;\r
-}\r
-\r
-def ObjCOwnership : InheritableAttr {\r
- let Spellings = [GNU<"objc_ownership">];\r
- let Args = [IdentifierArgument<"Kind">];\r
- let ASTNode = 0;\r
+}
+
+def ObjCOwnership : InheritableAttr {
+ let Spellings = [GNU<"objc_ownership">];
+ let Args = [IdentifierArgument<"Kind">];
+ let ASTNode = 0;
}
def ObjCRequiresPropertyDefs : InheritableAttr {
let Subjects = [CXXRecord];
}
-def VectorSize : Attr {
+def VectorSize : TypeAttr {
let Spellings = [GNU<"vector_size">, CXX11<"gnu", "vector_size">];
let Args = [ExprArgument<"NumBytes">];
- let ASTNode = 0;
}
def VecTypeHint : InheritableAttr {
let Spellings = [GNU<"weakref">, CXX11<"gnu", "weakref">];
}
-def X86ForceAlignArgPointer : InheritableAttr {
+def X86ForceAlignArgPointer : InheritableAttr, TargetSpecificAttr {
let Spellings = [];
}
let Spellings = [Declspec<"ms_struct">];
}
-def DLLExport : InheritableAttr {
+def DLLExport : InheritableAttr, TargetSpecificAttr {
let Spellings = [Declspec<"dllexport">];
}
-def DLLImport : InheritableAttr {
+def DLLImport : InheritableAttr, TargetSpecificAttr {
let Spellings = [Declspec<"dllimport">];
}
let Spellings = [Keyword<"__w64">];
}
-def Ptr32 : InheritableAttr {
+def Ptr32 : TypeAttr {
let Spellings = [Keyword<"__ptr32">];
}
-def Ptr64 : InheritableAttr {
+def Ptr64 : TypeAttr {
let Spellings = [Keyword<"__ptr64">];
}
-def SPtr : InheritableAttr {
+def SPtr : TypeAttr {
let Spellings = [Keyword<"__sptr">];
}
-def UPtr : InheritableAttr {
+def UPtr : TypeAttr {
let Spellings = [Keyword<"__uptr">];
}