Index: include/clang/Basic/Attr.td =================================================================== --- include/clang/Basic/Attr.td +++ include/clang/Basic/Attr.td @@ -545,7 +545,6 @@ let ASTNode = 0; let SemaHandler = 0; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } // @@ -564,7 +563,6 @@ let Spellings = [Clang<"address_space">]; let Args = [IntArgument<"AddressSpace">]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def Alias : Attr { @@ -572,7 +570,6 @@ let Args = [StringArgument<"Aliasee">]; let Subjects = SubjectList<[Function, GlobalVar], ErrorDiag>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def Aligned : InheritableAttr { @@ -585,7 +582,6 @@ Keyword<"_Alignas">]>, Accessor<"isDeclspec",[Declspec<"align">]>]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def AlignValue : Attr { @@ -613,14 +609,12 @@ let Spellings = []; let SemaHandler = 0; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def AlwaysInline : InheritableAttr { let Spellings = [GCC<"always_inline">, Keyword<"__forceinline">]; let Subjects = SubjectList<[Function]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def Artificial : InheritableAttr { @@ -665,8 +659,8 @@ // vendor namespace, or should it use a vendor namespace specific to the // analyzer? let Spellings = [GNU<"analyzer_noreturn">]; + // TODO: Add subject list. let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def Annotate : InheritableParamAttr { @@ -709,7 +703,6 @@ let Args = [StringArgument<"Label">]; let SemaHandler = 0; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def Availability : InheritableAttr { @@ -776,7 +769,6 @@ let Spellings = [Clang<"blocks">]; let Args = [EnumArgument<"Type", "BlockType", ["byref"], ["ByRef"]>]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def Bounded : IgnoredAttr { @@ -795,7 +787,6 @@ let Spellings = [GCC<"cdecl">, Keyword<"__cdecl">, Keyword<"_cdecl">]; // let Subjects = [Function, ObjCMethod]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } // cf_audited_transfer indicates that the given function has been @@ -806,7 +797,6 @@ let Spellings = [Clang<"cf_audited_transfer">]; let Subjects = SubjectList<[Function], ErrorDiag>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } // cf_unknown_transfer is an explicit opt-out of cf_audited_transfer. @@ -816,28 +806,24 @@ let Spellings = [Clang<"cf_unknown_transfer">]; let Subjects = SubjectList<[Function], ErrorDiag>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def CFReturnsRetained : InheritableAttr { let Spellings = [Clang<"cf_returns_retained">]; // let Subjects = SubjectList<[ObjCMethod, ObjCProperty, Function]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def CFReturnsNotRetained : InheritableAttr { let Spellings = [Clang<"cf_returns_not_retained">]; // let Subjects = SubjectList<[ObjCMethod, ObjCProperty, Function]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def CFConsumed : InheritableParamAttr { let Spellings = [Clang<"cf_consumed">]; let Subjects = SubjectList<[ParmVar]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def Cleanup : InheritableAttr { @@ -845,27 +831,23 @@ let Args = [FunctionArgument<"FunctionDecl">]; let Subjects = SubjectList<[LocalVar]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def Cold : InheritableAttr { let Spellings = [GCC<"cold">]; let Subjects = SubjectList<[Function]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def Common : InheritableAttr { let Spellings = [GCC<"common">]; let Subjects = SubjectList<[Var]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def Const : InheritableAttr { let Spellings = [GCC<"const">, GCC<"__const">]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def Constructor : InheritableAttr { @@ -873,7 +855,6 @@ let Args = [DefaultIntArgument<"Priority", 65535>]; let Subjects = SubjectList<[Function]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def CPUSpecific : InheritableAttr { @@ -904,7 +885,6 @@ let Subjects = SubjectList<[Var]>; let LangOpts = [CUDA]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def CUDACudartBuiltin : IgnoredAttr { @@ -917,7 +897,6 @@ let Subjects = SubjectList<[Function, Var]>; let LangOpts = [CUDA]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def CUDADeviceBuiltin : IgnoredAttr { @@ -942,7 +921,6 @@ let Subjects = SubjectList<[Function]>; let LangOpts = [CUDA]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def CUDAHost : InheritableAttr { @@ -950,7 +928,6 @@ let Subjects = SubjectList<[Function]>; let LangOpts = [CUDA]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def CUDAInvalidTarget : InheritableAttr { @@ -958,7 +935,6 @@ let Subjects = SubjectList<[Function]>; let LangOpts = [CUDA]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def CUDALaunchBounds : InheritableAttr { @@ -970,7 +946,6 @@ // of the compiler. However, this node needs to exist in the AST because // non-LLVM backends may be relying on the attribute's presence. let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def CUDAShared : InheritableAttr { @@ -978,7 +953,6 @@ let Subjects = SubjectList<[Var]>; let LangOpts = [CUDA]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def C11NoReturn : InheritableAttr { @@ -1000,7 +974,6 @@ let Spellings = [Keyword<"__kernel">, Keyword<"kernel">]; let Subjects = SubjectList<[Function], ErrorDiag>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def OpenCLUnrollHint : InheritableAttr { @@ -1088,7 +1061,6 @@ let Args = [DefaultIntArgument<"Priority", 65535>]; let Subjects = SubjectList<[Function]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def EmptyBases : InheritableAttr, TargetSpecificAttr { @@ -1120,10 +1092,13 @@ def ExtVectorType : Attr { // This is an OpenCL-related attribute and does not receive a [[]] spelling. let Spellings = [GNU<"ext_vector_type">]; + // FIXME: This subject list is wrong; this is a type attribute. let Subjects = SubjectList<[TypedefName], ErrorDiag>; let Args = [ExprArgument<"NumElements">]; let ASTNode = 0; let Documentation = [Undocumented]; + // This is a type attribute with an incorrect subject list, so should not be + // permitted by #pragma clang attribute. let PragmaAttributeSupport = 0; } @@ -1151,14 +1126,12 @@ let Accessors = [Accessor<"isSpelledAsSealed", [Keyword<"sealed">]>]; let SemaHandler = 0; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def MinSize : InheritableAttr { let Spellings = [Clang<"minsize">]; let Subjects = SubjectList<[Function, ObjCMethod], ErrorDiag>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def FlagEnum : InheritableAttr { @@ -1194,7 +1167,6 @@ let Args = [ParamIdxArgument<"FormatIdx">]; let Subjects = SubjectList<[ObjCMethod, HasFunctionProto]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def GNUInline : InheritableAttr { @@ -1209,7 +1181,6 @@ // An AST node is created for this attribute, but not actually used beyond // semantic checking for mutual exclusion with the Cold attribute. let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def IBAction : InheritableAttr { @@ -1219,14 +1190,12 @@ // of the compiler. However, this node needs to exist in the AST because // external tools rely on it. let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def IBOutlet : InheritableAttr { let Spellings = [Clang<"iboutlet">]; // let Subjects = [ObjCIvar, ObjCProperty]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def IBOutletCollection : InheritableAttr { @@ -1234,7 +1203,6 @@ let Args = [TypeArgument<"Interface", 1>]; // let Subjects = [ObjCIvar, ObjCProperty]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def IFunc : Attr, TargetSpecificAttr { @@ -1248,7 +1216,6 @@ let Spellings = [Declspec<"restrict">, GCC<"malloc">]; let Subjects = SubjectList<[Function]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def LayoutVersion : InheritableAttr, TargetSpecificAttr { @@ -1280,14 +1247,12 @@ let Args = [UnsignedArgument<"Alignment">]; let SemaHandler = 0; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def MayAlias : InheritableAttr { // FIXME: this is a type attribute in GCC, but a declaration attribute here. let Spellings = [GCC<"may_alias">]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def MSABI : DeclOrTypeAttr { @@ -1304,14 +1269,12 @@ let ParseKind = "Interrupt"; let HasCustomParsing = 1; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def Mips16 : InheritableAttr, TargetSpecificAttr { let Spellings = [GCC<"mips16">]; let Subjects = SubjectList<[Function], ErrorDiag>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def MipsInterrupt : InheritableAttr, TargetSpecificAttr { @@ -1353,6 +1316,8 @@ let Subjects = SubjectList<[Var, Enum, TypedefName, Field], ErrorDiag>; let Args = [IdentifierArgument<"Mode">]; let Documentation = [Undocumented]; + // This is notionally a type attribute, which #pragma clang attribute + // generally does not support. let PragmaAttributeSupport = 0; } @@ -1360,14 +1325,12 @@ let Spellings = [GCC<"naked">, Declspec<"naked">]; let Subjects = SubjectList<[Function]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def NeonPolyVectorType : TypeAttr { let Spellings = [Clang<"neon_polyvector_type">]; let Args = [IntArgument<"NumElements">]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; // Represented as VectorType instead. let ASTNode = 0; } @@ -1376,7 +1339,6 @@ let Spellings = [Clang<"neon_vector_type">]; let Args = [IntArgument<"NumElements">]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; // Represented as VectorType instead. let ASTNode = 0; } @@ -1385,7 +1347,6 @@ let Spellings = [GCC<"returns_twice">]; let Subjects = SubjectList<[Function]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def DisableTailCalls : InheritableAttr { @@ -1404,7 +1365,6 @@ let Spellings = [GCC<"nocommon">]; let Subjects = SubjectList<[Var]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def NoDebug : InheritableAttr { @@ -1429,14 +1389,12 @@ let Spellings = [GCC<"noinline">, Declspec<"noinline">]; let Subjects = SubjectList<[Function]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def NoMips16 : InheritableAttr, TargetSpecificAttr { let Spellings = [GCC<"nomips16">]; let Subjects = SubjectList<[Function], ErrorDiag>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def NoMicroMips : InheritableAttr, TargetSpecificAttr { @@ -1563,13 +1521,11 @@ def ObjCInertUnsafeUnretained : TypeAttr { let Spellings = [Keyword<"__unsafe_unretained">]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def ObjCKindOf : TypeAttr { let Spellings = [Keyword<"__kindof">]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def NoEscape : Attr { @@ -1596,14 +1552,12 @@ let Spellings = [GCC<"noreturn">, Declspec<"noreturn">]; // FIXME: Does GCC allow this on the function instead? let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def NoInstrumentFunction : InheritableAttr { let Spellings = [GCC<"no_instrument_function">]; let Subjects = SubjectList<[Function]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def NotTailCalled : InheritableAttr { @@ -1637,7 +1591,6 @@ let Subjects = SubjectList<[Record, TypedefName], ErrorDiag>; let Args = [IdentifierArgument<"BridgedType">]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def ObjCBridgeMutable : InheritableAttr { @@ -1645,7 +1598,6 @@ let Subjects = SubjectList<[Record], ErrorDiag>; let Args = [IdentifierArgument<"BridgedType">]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def ObjCBridgeRelated : InheritableAttr { @@ -1656,49 +1608,42 @@ IdentifierArgument<"InstanceMethod">]; let HasCustomParsing = 1; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def NSReturnsRetained : DeclOrTypeAttr { let Spellings = [Clang<"ns_returns_retained">]; // let Subjects = SubjectList<[ObjCMethod, ObjCProperty, Function]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def NSReturnsNotRetained : InheritableAttr { let Spellings = [Clang<"ns_returns_not_retained">]; // let Subjects = SubjectList<[ObjCMethod, ObjCProperty, Function]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def NSReturnsAutoreleased : InheritableAttr { let Spellings = [Clang<"ns_returns_autoreleased">]; // let Subjects = SubjectList<[ObjCMethod, ObjCProperty, Function]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def NSConsumesSelf : InheritableAttr { let Spellings = [Clang<"ns_consumes_self">]; let Subjects = SubjectList<[ObjCMethod]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def NSConsumed : InheritableParamAttr { let Spellings = [Clang<"ns_consumed">]; let Subjects = SubjectList<[ParmVar]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def ObjCException : InheritableAttr { let Spellings = [Clang<"objc_exception">]; let Subjects = SubjectList<[ObjCInterface], ErrorDiag>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def ObjCMethodFamily : InheritableAttr { @@ -1714,27 +1659,23 @@ def ObjCNSObject : InheritableAttr { let Spellings = [Clang<"NSObject">]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def ObjCIndependentClass : InheritableAttr { let Spellings = [Clang<"objc_independent_class">]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def ObjCPreciseLifetime : InheritableAttr { let Spellings = [Clang<"objc_precise_lifetime">]; let Subjects = SubjectList<[Var], ErrorDiag>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def ObjCReturnsInnerPointer : InheritableAttr { let Spellings = [Clang<"objc_returns_inner_pointer">]; let Subjects = SubjectList<[ObjCMethod, ObjCProperty], ErrorDiag>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def ObjCRequiresSuper : InheritableAttr { @@ -1747,7 +1688,6 @@ let Spellings = [Clang<"objc_root_class">]; let Subjects = SubjectList<[ObjCInterface], ErrorDiag>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def ObjCSubclassingRestricted : InheritableAttr { @@ -1760,14 +1700,12 @@ let Spellings = [Clang<"objc_protocol_requires_explicit_implementation">]; let Subjects = SubjectList<[ObjCProtocol], ErrorDiag>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def ObjCDesignatedInitializer : Attr { let Spellings = [Clang<"objc_designated_initializer">]; let Subjects = SubjectList<[ObjCInterfaceDeclInitMethod], ErrorDiag>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def ObjCRuntimeName : Attr { @@ -1805,7 +1743,6 @@ let Spellings = [Keyword<"override">]; let SemaHandler = 0; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def Ownership : InheritableAttr { @@ -1826,21 +1763,18 @@ VariadicParamIdxArgument<"Args">]; let Subjects = SubjectList<[HasFunctionProto]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def Packed : InheritableAttr { let Spellings = [GCC<"packed">]; // let Subjects = [Tag, Field]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def IntelOclBicc : DeclOrTypeAttr { let Spellings = [Clang<"intel_ocl_bicc", 0>]; // let Subjects = [Function, ObjCMethod]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def Pcs : DeclOrTypeAttr { @@ -1855,7 +1789,6 @@ def Pure : InheritableAttr { let Spellings = [GCC<"pure">]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def Regparm : TypeAttr { @@ -1873,7 +1806,6 @@ UnsignedArgument<"ZDim">]; let Subjects = SubjectList<[Function], ErrorDiag>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def RequireConstantInit : InheritableAttr { @@ -1893,7 +1825,6 @@ UnsignedArgument<"ZDim">]; let Subjects = SubjectList<[Function], ErrorDiag>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def InitPriority : InheritableAttr { @@ -1901,7 +1832,6 @@ let Args = [UnsignedArgument<"Priority">]; let Subjects = SubjectList<[Var], ErrorDiag>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def Section : InheritableAttr { @@ -1925,7 +1855,6 @@ let Args = [StringArgument<"Name">]; let Subjects = SubjectList<[GlobalVar], ErrorDiag>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def PragmaClangDataSection : InheritableAttr { @@ -1934,7 +1863,6 @@ let Args = [StringArgument<"Name">]; let Subjects = SubjectList<[GlobalVar], ErrorDiag>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def PragmaClangRodataSection : InheritableAttr { @@ -1943,7 +1871,6 @@ let Args = [StringArgument<"Name">]; let Subjects = SubjectList<[GlobalVar], ErrorDiag>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def PragmaClangTextSection : InheritableAttr { @@ -1952,7 +1879,6 @@ let Args = [StringArgument<"Name">]; let Subjects = SubjectList<[Function], ErrorDiag>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def Sentinel : InheritableAttr { @@ -1961,7 +1887,6 @@ DefaultIntArgument<"NullPos", 0>]; // let Subjects = SubjectList<[Function, ObjCMethod, Block, Var]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def StdCall : DeclOrTypeAttr { @@ -2001,7 +1926,6 @@ let Spellings = [GCC<"sysv_abi">]; // let Subjects = [Function, ObjCMethod]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def ThisCall : DeclOrTypeAttr { @@ -2022,7 +1946,6 @@ let Spellings = [Clang<"pascal">, Keyword<"__pascal">, Keyword<"_pascal">]; // let Subjects = [Function, ObjCMethod]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def PreserveMost : DeclOrTypeAttr { @@ -2125,7 +2048,6 @@ "IR_ARCInitReturnsUnrelated", "IR_ARCFieldWithOwnership"], 1, /*fake*/ 1>]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def DiagnoseIf : InheritableAttr { @@ -2155,28 +2077,24 @@ let Spellings = [Clang<"objc_arc_weak_reference_unavailable">]; let Subjects = SubjectList<[ObjCInterface], ErrorDiag>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def ObjCGC : TypeAttr { let Spellings = [Clang<"objc_gc">]; let Args = [IdentifierArgument<"Kind">]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def ObjCOwnership : DeclOrTypeAttr { let Spellings = [Clang<"objc_ownership">]; let Args = [IdentifierArgument<"Kind">]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def ObjCRequiresPropertyDefs : InheritableAttr { let Spellings = [Clang<"objc_requires_property_definitions">]; let Subjects = SubjectList<[ObjCInterface], ErrorDiag>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def Unused : InheritableAttr { @@ -2191,7 +2109,6 @@ let Spellings = [GCC<"used">]; let Subjects = SubjectList<[NonLocalVar, Function, ObjCMethod]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def Uuid : InheritableAttr { @@ -2202,14 +2119,12 @@ // CPlusPlus && (MicrosoftExt || Borland) let LangOpts = [MicrosoftExt, Borland]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def VectorSize : TypeAttr { let Spellings = [GCC<"vector_size">]; let Args = [ExprArgument<"NumBytes">]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; // Represented as VectorType instead. let ASTNode = 0; } @@ -2220,7 +2135,6 @@ let Args = [TypeArgument<"TypeHint">]; let Subjects = SubjectList<[Function], ErrorDiag>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def Visibility : InheritableAttr { @@ -2231,7 +2145,6 @@ ["Default", "Hidden", "Hidden", "Protected"]>]; let MeaningfulToClassTemplateDefinition = 1; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def TypeVisibility : InheritableAttr { @@ -2242,7 +2155,6 @@ ["Default", "Hidden", "Hidden", "Protected"]>]; // let Subjects = [Tag, ObjCInterface, Namespace]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def VecReturn : InheritableAttr { @@ -2252,14 +2164,12 @@ let Spellings = [Clang<"vecreturn", 0>]; let Subjects = SubjectList<[CXXRecord], ErrorDiag>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def WarnUnused : InheritableAttr { let Spellings = [GCC<"warn_unused">]; let Subjects = SubjectList<[Record]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def WarnUnusedResult : InheritableAttr { @@ -2274,13 +2184,11 @@ let Spellings = [GCC<"weak">]; let Subjects = SubjectList<[Var, Function, CXXRecord]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def WeakImport : InheritableAttr { let Spellings = [Clang<"weak_import">]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def WeakRef : InheritableAttr { @@ -2289,7 +2197,6 @@ let Args = [StringArgument<"Aliasee", 1>]; let Subjects = SubjectList<[Var, Function], ErrorDiag>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def LTOVisibilityPublic : InheritableAttr { @@ -2306,7 +2213,6 @@ let ParseKind = "Interrupt"; let HasCustomParsing = 1; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def AnyX86NoCallerSavedRegisters : InheritableAttr, @@ -2370,21 +2276,18 @@ let Spellings = [Clang<"guarded_var", 0>]; let Subjects = SubjectList<[Field, SharedVar]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def PtGuardedVar : InheritableAttr { let Spellings = [Clang<"pt_guarded_var", 0>]; let Subjects = SubjectList<[Field, SharedVar]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def Lockable : InheritableAttr { let Spellings = [GNU<"lockable">]; let Subjects = SubjectList<[Record]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; let ASTNode = 0; // Replaced by Capability } @@ -2392,7 +2295,6 @@ let Spellings = [Clang<"scoped_lockable", 0>]; let Subjects = SubjectList<[Record]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def Capability : InheritableAttr { @@ -2402,7 +2304,6 @@ let Accessors = [Accessor<"isShared", [Clang<"shared_capability", 0>]>]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; let AdditionalMembers = [{ bool isMutex() const { return getName().equals_lower("mutex"); } bool isRole() const { return getName().equals_lower("role"); } @@ -2488,14 +2389,12 @@ let Accessors = [Accessor<"isShared", [Clang<"requires_shared_capability", 0>, Clang<"shared_locks_required", 0>]>]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def NoThreadSafetyAnalysis : InheritableAttr { let Spellings = [Clang<"no_thread_safety_analysis">]; let Subjects = SubjectList<[Function]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def GuardedBy : InheritableAttr { @@ -2507,7 +2406,6 @@ let InheritEvenIfAlreadyPresent = 1; let Subjects = SubjectList<[Field, SharedVar]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def PtGuardedBy : InheritableAttr { @@ -2519,7 +2417,6 @@ let InheritEvenIfAlreadyPresent = 1; let Subjects = SubjectList<[Field, SharedVar]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def AcquiredAfter : InheritableAttr { @@ -2531,7 +2428,6 @@ let InheritEvenIfAlreadyPresent = 1; let Subjects = SubjectList<[Field, SharedVar]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def AcquiredBefore : InheritableAttr { @@ -2543,7 +2439,6 @@ let InheritEvenIfAlreadyPresent = 1; let Subjects = SubjectList<[Field, SharedVar]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def AssertExclusiveLock : InheritableAttr { @@ -2555,7 +2450,6 @@ let InheritEvenIfAlreadyPresent = 1; let Subjects = SubjectList<[Function]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def AssertSharedLock : InheritableAttr { @@ -2567,7 +2461,6 @@ let InheritEvenIfAlreadyPresent = 1; let Subjects = SubjectList<[Function]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } // The first argument is an integer or boolean value specifying the return value @@ -2581,7 +2474,6 @@ let InheritEvenIfAlreadyPresent = 1; let Subjects = SubjectList<[Function]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } // The first argument is an integer or boolean value specifying the return value @@ -2595,7 +2487,6 @@ let InheritEvenIfAlreadyPresent = 1; let Subjects = SubjectList<[Function]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def LockReturned : InheritableAttr { @@ -2606,7 +2497,6 @@ let ParseArgumentsAsUnevaluated = 1; let Subjects = SubjectList<[Function]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def LocksExcluded : InheritableAttr { @@ -2618,7 +2508,6 @@ let InheritEvenIfAlreadyPresent = 1; let Subjects = SubjectList<[Function]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } // C/C++ consumed attributes. @@ -2642,7 +2531,6 @@ let Spellings = [Clang<"consumable_auto_cast_state", 0>]; let Subjects = SubjectList<[CXXRecord]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def ConsumableSetOnRead : InheritableAttr { @@ -2652,7 +2540,6 @@ let Spellings = [Clang<"consumable_set_state_on_read", 0>]; let Subjects = SubjectList<[CXXRecord]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def CallableWhen : InheritableAttr { @@ -2755,7 +2642,6 @@ let Spellings = [GCC<"ms_struct">]; let Subjects = SubjectList<[Record]>; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def DLLExport : InheritableAttr, TargetSpecificAttr { @@ -2800,25 +2686,21 @@ def Ptr32 : TypeAttr { let Spellings = [Keyword<"__ptr32">]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def Ptr64 : TypeAttr { let Spellings = [Keyword<"__ptr64">]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def SPtr : TypeAttr { let Spellings = [Keyword<"__sptr">]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def UPtr : TypeAttr { let Spellings = [Keyword<"__uptr">]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def MSInheritance : InheritableAttr { @@ -2869,7 +2751,6 @@ Mode getVtorDispMode() const { return Mode(vdm); } }]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def InitSeg : Attr { @@ -2995,7 +2876,6 @@ let Spellings = []; let SemaHandler = 0; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def OMPThreadPrivateDecl : InheritableAttr { @@ -3003,7 +2883,6 @@ let Spellings = []; let SemaHandler = 0; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def OMPCaptureNoInit : InheritableAttr { @@ -3011,7 +2890,6 @@ let Spellings = []; let SemaHandler = 0; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def OMPCaptureKind : Attr { @@ -3020,7 +2898,6 @@ let SemaHandler = 0; let Args = [UnsignedArgument<"CaptureKind">]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def OMPReferencedVar : Attr { @@ -3029,7 +2906,6 @@ let SemaHandler = 0; let Args = [ExprArgument<"Ref">]; let Documentation = [Undocumented]; - let PragmaAttributeSupport = 0; } def OMPDeclareSimdDecl : Attr { Index: test/Misc/pragma-attribute-supported-attributes-list.test =================================================================== --- test/Misc/pragma-attribute-supported-attributes-list.test +++ test/Misc/pragma-attribute-supported-attributes-list.test @@ -2,29 +2,48 @@ // The number of supported attributes should never go down! -// CHECK: #pragma clang attribute supports 75 attributes: +// CHECK: #pragma clang attribute supports 128 attributes: // CHECK-NEXT: AMDGPUFlatWorkGroupSize (SubjectMatchRule_function) // CHECK-NEXT: AMDGPUNumSGPR (SubjectMatchRule_function) // CHECK-NEXT: AMDGPUNumVGPR (SubjectMatchRule_function) // CHECK-NEXT: AMDGPUWavesPerEU (SubjectMatchRule_function) // CHECK-NEXT: AVRSignal (SubjectMatchRule_function) // CHECK-NEXT: AbiTag (SubjectMatchRule_record_not_is_union, SubjectMatchRule_variable, SubjectMatchRule_function, SubjectMatchRule_namespace) +// CHECK-NEXT: Alias (SubjectMatchRule_function, SubjectMatchRule_variable_is_global) // CHECK-NEXT: AlignValue (SubjectMatchRule_variable, SubjectMatchRule_type_alias) // CHECK-NEXT: AllocSize (SubjectMatchRule_function) // CHECK-NEXT: AlwaysDestroy (SubjectMatchRule_variable) +// CHECK-NEXT: AlwaysInline (SubjectMatchRule_function) // CHECK-NEXT: Annotate () // CHECK-NEXT: AnyX86NoCfCheck (SubjectMatchRule_hasType_functionType) +// CHECK-NEXT: ArcWeakrefUnavailable (SubjectMatchRule_objc_interface) // CHECK-NEXT: AssumeAligned (SubjectMatchRule_objc_method, SubjectMatchRule_function) // CHECK-NEXT: Availability ((SubjectMatchRule_record, SubjectMatchRule_enum, SubjectMatchRule_enum_constant, SubjectMatchRule_field, SubjectMatchRule_function, SubjectMatchRule_namespace, SubjectMatchRule_objc_category, SubjectMatchRule_objc_interface, SubjectMatchRule_objc_method, SubjectMatchRule_objc_property, SubjectMatchRule_objc_protocol, SubjectMatchRule_record, SubjectMatchRule_type_alias, SubjectMatchRule_variable)) +// CHECK-NEXT: CFAuditedTransfer (SubjectMatchRule_function) +// CHECK-NEXT: CFConsumed (SubjectMatchRule_variable_is_parameter) +// CHECK-NEXT: CFUnknownTransfer (SubjectMatchRule_function) // CHECK-NEXT: CPUDispatch (SubjectMatchRule_function) // CHECK-NEXT: CPUSpecific (SubjectMatchRule_function) +// CHECK-NEXT: CUDAConstant (SubjectMatchRule_variable) +// CHECK-NEXT: CUDADevice (SubjectMatchRule_function, SubjectMatchRule_variable) +// CHECK-NEXT: CUDAGlobal (SubjectMatchRule_function) +// CHECK-NEXT: CUDAHost (SubjectMatchRule_function) +// CHECK-NEXT: CUDALaunchBounds (SubjectMatchRule_objc_method, SubjectMatchRule_hasType_functionType) +// CHECK-NEXT: CUDAShared (SubjectMatchRule_variable) // CHECK-NEXT: CXX11NoReturn (SubjectMatchRule_function) // CHECK-NEXT: CallableWhen (SubjectMatchRule_function_is_member) +// CHECK-NEXT: Capability (SubjectMatchRule_record, SubjectMatchRule_type_alias) // CHECK-NEXT: CarriesDependency (SubjectMatchRule_variable_is_parameter, SubjectMatchRule_objc_method, SubjectMatchRule_function) +// CHECK-NEXT: Cold (SubjectMatchRule_function) +// CHECK-NEXT: Common (SubjectMatchRule_variable) +// CHECK-NEXT: Constructor (SubjectMatchRule_function) // CHECK-NEXT: Consumable (SubjectMatchRule_record) +// CHECK-NEXT: ConsumableAutoCast (SubjectMatchRule_record) +// CHECK-NEXT: ConsumableSetOnRead (SubjectMatchRule_record) // CHECK-NEXT: Convergent (SubjectMatchRule_function) // CHECK-NEXT: DLLExport (SubjectMatchRule_function, SubjectMatchRule_variable, SubjectMatchRule_record, SubjectMatchRule_objc_interface) // CHECK-NEXT: DLLImport (SubjectMatchRule_function, SubjectMatchRule_variable, SubjectMatchRule_record, SubjectMatchRule_objc_interface) +// CHECK-NEXT: Destructor (SubjectMatchRule_function) // CHECK-NEXT: DisableTailCalls (SubjectMatchRule_function, SubjectMatchRule_objc_method) // CHECK-NEXT: EnableIf (SubjectMatchRule_function) // CHECK-NEXT: EnumExtensibility (SubjectMatchRule_enum) @@ -32,27 +51,51 @@ // CHECK-NEXT: FlagEnum (SubjectMatchRule_enum) // CHECK-NEXT: Flatten (SubjectMatchRule_function) // CHECK-NEXT: GNUInline (SubjectMatchRule_function) +// CHECK-NEXT: Hot (SubjectMatchRule_function) +// CHECK-NEXT: IBAction (SubjectMatchRule_objc_method_is_instance) // CHECK-NEXT: IFunc (SubjectMatchRule_function) +// CHECK-NEXT: InitPriority (SubjectMatchRule_variable) // CHECK-NEXT: InternalLinkage (SubjectMatchRule_variable, SubjectMatchRule_function, SubjectMatchRule_record) // CHECK-NEXT: LTOVisibilityPublic (SubjectMatchRule_record) +// CHECK-NEXT: Lockable (SubjectMatchRule_record) +// CHECK-NEXT: MSStruct (SubjectMatchRule_record) // CHECK-NEXT: MicroMips (SubjectMatchRule_function) +// CHECK-NEXT: MinSize (SubjectMatchRule_function, SubjectMatchRule_objc_method) // CHECK-NEXT: MinVectorWidth (SubjectMatchRule_function) +// CHECK-NEXT: Mips16 (SubjectMatchRule_function) // CHECK-NEXT: MipsLongCall (SubjectMatchRule_function) // CHECK-NEXT: MipsShortCall (SubjectMatchRule_function) +// CHECK-NEXT: NSConsumed (SubjectMatchRule_variable_is_parameter) +// CHECK-NEXT: NSConsumesSelf (SubjectMatchRule_objc_method) +// CHECK-NEXT: Naked (SubjectMatchRule_function) +// CHECK-NEXT: NoCommon (SubjectMatchRule_variable) // CHECK-NEXT: NoDebug (SubjectMatchRule_hasType_functionType, SubjectMatchRule_objc_method, SubjectMatchRule_variable_not_is_parameter) // CHECK-NEXT: NoDestroy (SubjectMatchRule_variable) // CHECK-NEXT: NoDuplicate (SubjectMatchRule_function) // CHECK-NEXT: NoEscape (SubjectMatchRule_variable_is_parameter) +// CHECK-NEXT: NoInline (SubjectMatchRule_function) +// CHECK-NEXT: NoInstrumentFunction (SubjectMatchRule_function) // CHECK-NEXT: NoMicroMips (SubjectMatchRule_function) +// CHECK-NEXT: NoMips16 (SubjectMatchRule_function) // CHECK-NEXT: NoSanitize (SubjectMatchRule_function, SubjectMatchRule_objc_method, SubjectMatchRule_variable_is_global) // CHECK-NEXT: NoSanitizeSpecific (SubjectMatchRule_function, SubjectMatchRule_variable_is_global) // CHECK-NEXT: NoSplitStack (SubjectMatchRule_function) // CHECK-NEXT: NoStackProtector (SubjectMatchRule_function) +// CHECK-NEXT: NoThreadSafetyAnalysis (SubjectMatchRule_function) // CHECK-NEXT: NoThrow (SubjectMatchRule_function) // CHECK-NEXT: NotTailCalled (SubjectMatchRule_function) // CHECK-NEXT: ObjCBoxable (SubjectMatchRule_record) +// CHECK-NEXT: ObjCBridge (SubjectMatchRule_record, SubjectMatchRule_type_alias) +// CHECK-NEXT: ObjCBridgeMutable (SubjectMatchRule_record) +// CHECK-NEXT: ObjCBridgeRelated (SubjectMatchRule_record) +// CHECK-NEXT: ObjCException (SubjectMatchRule_objc_interface) +// CHECK-NEXT: ObjCExplicitProtocolImpl (SubjectMatchRule_objc_protocol) // CHECK-NEXT: ObjCMethodFamily (SubjectMatchRule_objc_method) +// CHECK-NEXT: ObjCPreciseLifetime (SubjectMatchRule_variable) +// CHECK-NEXT: ObjCRequiresPropertyDefs (SubjectMatchRule_objc_interface) // CHECK-NEXT: ObjCRequiresSuper (SubjectMatchRule_objc_method) +// CHECK-NEXT: ObjCReturnsInnerPointer (SubjectMatchRule_objc_method, SubjectMatchRule_objc_property) +// CHECK-NEXT: ObjCRootClass (SubjectMatchRule_objc_interface) // CHECK-NEXT: ObjCRuntimeName (SubjectMatchRule_objc_interface, SubjectMatchRule_objc_protocol) // CHECK-NEXT: ObjCRuntimeVisible (SubjectMatchRule_objc_interface) // CHECK-NEXT: ObjCSubclassingRestricted (SubjectMatchRule_objc_interface) @@ -63,9 +106,13 @@ // CHECK-NEXT: ParamTypestate (SubjectMatchRule_variable_is_parameter) // CHECK-NEXT: PassObjectSize (SubjectMatchRule_variable_is_parameter) // CHECK-NEXT: RenderScriptKernel (SubjectMatchRule_function) +// CHECK-NEXT: ReqdWorkGroupSize (SubjectMatchRule_function) // CHECK-NEXT: RequireConstantInit (SubjectMatchRule_variable_is_global) +// CHECK-NEXT: Restrict (SubjectMatchRule_function) // CHECK-NEXT: ReturnTypestate (SubjectMatchRule_function, SubjectMatchRule_variable_is_parameter) // CHECK-NEXT: ReturnsNonNull (SubjectMatchRule_objc_method, SubjectMatchRule_function) +// CHECK-NEXT: ReturnsTwice (SubjectMatchRule_function) +// CHECK-NEXT: ScopedLockable (SubjectMatchRule_record) // CHECK-NEXT: Section (SubjectMatchRule_function, SubjectMatchRule_variable_is_global, SubjectMatchRule_objc_method, SubjectMatchRule_objc_property) // CHECK-NEXT: SetTypestate (SubjectMatchRule_function_is_member) // CHECK-NEXT: SwiftContext (SubjectMatchRule_variable_is_parameter) @@ -75,6 +122,12 @@ // CHECK-NEXT: Target (SubjectMatchRule_function) // CHECK-NEXT: TestTypestate (SubjectMatchRule_function_is_member) // CHECK-NEXT: TrivialABI (SubjectMatchRule_record) +// CHECK-NEXT: VecReturn (SubjectMatchRule_record) +// CHECK-NEXT: VecTypeHint (SubjectMatchRule_function) +// CHECK-NEXT: WarnUnused (SubjectMatchRule_record) // CHECK-NEXT: WarnUnusedResult (SubjectMatchRule_objc_method, SubjectMatchRule_enum, SubjectMatchRule_record, SubjectMatchRule_hasType_functionType) +// CHECK-NEXT: Weak (SubjectMatchRule_variable, SubjectMatchRule_function, SubjectMatchRule_record) +// CHECK-NEXT: WeakRef (SubjectMatchRule_variable, SubjectMatchRule_function) +// CHECK-NEXT: WorkGroupSizeHint (SubjectMatchRule_function) // CHECK-NEXT: XRayInstrument (SubjectMatchRule_function, SubjectMatchRule_objc_method) // CHECK-NEXT: XRayLogArgs (SubjectMatchRule_function, SubjectMatchRule_objc_method) Index: test/Parser/pragma-attribute.cpp =================================================================== --- test/Parser/pragma-attribute.cpp +++ test/Parser/pragma-attribute.cpp @@ -123,7 +123,9 @@ #pragma clang attribute push (__attribute__((annotate)), apply_to=function foo) // expected-error {{extra tokens after attribute in a '#pragma clang attribute push'}} #pragma clang attribute push (__attribute__((objc_bridge_related)), apply_to=function) -// expected-error@-1 {{attribute 'objc_bridge_related' is not supported by '#pragma clang attribute'}} +// expected-error@-1 {{attribute 'objc_bridge_related' can't be applied to 'function'}} +#pragma clang attribute pop + #pragma clang attribute push (__attribute__((objc_bridge_related(1))), apply_to=function) // expected-error {{expected a related ObjectiveC class name, e.g., 'NSColor'}} #pragma clang attribute push (__attribute__((used)), apply_to=function) // expected-error {{attribute 'used' is not supported by '#pragma clang attribute'}}