diff options
author | Alex Lorenz <arphaman@gmail.com> | 2017-04-18 10:46:41 +0000 |
---|---|---|
committer | Alex Lorenz <arphaman@gmail.com> | 2017-04-18 10:46:41 +0000 |
commit | 7844d0af188cb376ec177cb1fb4bcb24272dc32b (patch) | |
tree | c6c244c42a2d72b62f4085cb2d7e1bc5ddcb48d4 /include/clang/Basic/Attr.td | |
parent | df381a38cfc0018e459897639364fcfe7adf7d11 (diff) |
Revert r300539 - Add #pragma clang attribute
Some tests fail on the Windows buildbots. I will have to investigate more.
This commit reverts r300539, r300540 and r300542.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300543 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/Attr.td')
-rw-r--r-- | include/clang/Basic/Attr.td | 109 |
1 files changed, 0 insertions, 109 deletions
diff --git a/include/clang/Basic/Attr.td b/include/clang/Basic/Attr.td index bf62408db2..c5d2c7fc61 100644 --- a/include/clang/Basic/Attr.td +++ b/include/clang/Basic/Attr.td @@ -248,8 +248,6 @@ def COnly : LangOpt<"CPlusPlus", 1>; def CPlusPlus : LangOpt<"CPlusPlus">; def OpenCL : LangOpt<"OpenCL">; def RenderScript : LangOpt<"RenderScript">; -def ObjC : LangOpt<"ObjC1">; -def BlocksSupported : LangOpt<"Blocks">; // Defines targets for target-specific attributes. The list of strings should // specify architectures for which the target applies, based off the ArchType @@ -272,102 +270,6 @@ def TargetMicrosoftCXXABI : TargetArch<["x86", "x86_64", "arm", "thumb"]> { let CXXABIs = ["Microsoft"]; } -// Attribute subject match rules that are used for #pragma clang attribute. -// -// A instance of AttrSubjectMatcherRule represents an individual match rule. -// An individual match rule can correspond to a number of different attribute -// subjects, e.g. "record" matching rule corresponds to the Record and -// CXXRecord attribute subjects. -// -// Match rules are used in the subject list of the #pragma clang attribute. -// Match rules can have sub-match rules that are instances of -// AttrSubjectMatcherSubRule. A sub-match rule can correspond to a number -// of different attribute subjects, and it can have a negated spelling as well. -// For example, "variable(unless(is_parameter))" matching rule corresponds to -// the NonParmVar attribute subject. -class AttrSubjectMatcherSubRule<string name, list<AttrSubject> subjects, - bit negated = 0> { - string Name = name; - list<AttrSubject> Subjects = subjects; - bit Negated = negated; - // Lists language options, one of which is required to be true for the - // attribute to be applicable. If empty, the language options are taken - // from the parent matcher rule. - list<LangOpt> LangOpts = []; -} -class AttrSubjectMatcherRule<string name, list<AttrSubject> subjects, - list<AttrSubjectMatcherSubRule> subrules = []> { - string Name = name; - list<AttrSubject> Subjects = subjects; - list<AttrSubjectMatcherSubRule> Constraints = subrules; - // Lists language options, one of which is required to be true for the - // attribute to be applicable. If empty, no language options are required. - list<LangOpt> LangOpts = []; -} - -// function(is_member) -def SubRuleForCXXMethod : AttrSubjectMatcherSubRule<"is_member", [CXXMethod]> { - let LangOpts = [CPlusPlus]; -} -def SubjectMatcherForFunction : AttrSubjectMatcherRule<"function", [Function], [ - SubRuleForCXXMethod -]>; -// hasType is abstract, it should be used with one of the sub-rules. -def SubjectMatcherForType : AttrSubjectMatcherRule<"hasType", [], [ - AttrSubjectMatcherSubRule<"functionType", [FunctionLike]> - - // FIXME: There's a matcher ambiguity with objc methods and blocks since - // functionType excludes them but functionProtoType includes them. - // AttrSubjectMatcherSubRule<"functionProtoType", [HasFunctionProto]> -]>; -def SubjectMatcherForTypedef : AttrSubjectMatcherRule<"type_alias", - [TypedefName]>; -def SubjectMatcherForRecord : AttrSubjectMatcherRule<"record", [Record, - CXXRecord], [ - // unless(is_union) - AttrSubjectMatcherSubRule<"is_union", [Struct], 1> -]>; -def SubjectMatcherForEnum : AttrSubjectMatcherRule<"enum", [Enum]>; -def SubjectMatcherForEnumConstant : AttrSubjectMatcherRule<"enum_constant", - [EnumConstant]>; -def SubjectMatcherForVar : AttrSubjectMatcherRule<"variable", [Var], [ - AttrSubjectMatcherSubRule<"is_thread_local", [TLSVar]>, - AttrSubjectMatcherSubRule<"is_global", [GlobalVar]>, - AttrSubjectMatcherSubRule<"is_parameter", [ParmVar]>, - // unless(is_parameter) - AttrSubjectMatcherSubRule<"is_parameter", [NonParmVar], 1> -]>; -def SubjectMatcherForField : AttrSubjectMatcherRule<"field", [Field]>; -def SubjectMatcherForNamespace : AttrSubjectMatcherRule<"namespace", - [Namespace]> { - let LangOpts = [CPlusPlus]; -} -def SubjectMatcherForObjCInterface : AttrSubjectMatcherRule<"objc_interface", - [ObjCInterface]> { - let LangOpts = [ObjC]; -} -def SubjectMatcherForObjCProtocol : AttrSubjectMatcherRule<"objc_protocol", - [ObjCProtocol]> { - let LangOpts = [ObjC]; -} -def SubjectMatcherForObjCCategory : AttrSubjectMatcherRule<"objc_category", - [ObjCCategory]> { - let LangOpts = [ObjC]; -} -def SubjectMatcherForObjCMethod : AttrSubjectMatcherRule<"objc_method", - [ObjCMethod], [ - AttrSubjectMatcherSubRule<"is_instance", [ObjCInstanceMethod]> -]> { - let LangOpts = [ObjC]; -} -def SubjectMatcherForObjCProperty : AttrSubjectMatcherRule<"objc_property", - [ObjCProperty]> { - let LangOpts = [ObjC]; -} -def SubjectMatcherForBlock : AttrSubjectMatcherRule<"block", [Block]> { - let LangOpts = [BlocksSupported]; -} - class Attr { // The various ways in which an attribute can be spelled in source list<Spelling> Spellings; @@ -403,14 +305,6 @@ class Attr { // Set to true if this attribute meaningful when applied to or inherited // in a class template definition. bit MeaningfulToClassTemplateDefinition = 0; - // Set to true if this attribute can be used with '#pragma clang attribute'. - // By default, when this value is false, an attribute is supported by the - // '#pragma clang attribute' only when: - // - It has documentation. - // - It has a subject list whose subjects can be represented using subject - // match rules. - // - It has GNU/CXX11 spelling and doesn't require delayed parsing. - bit ForcePragmaAttributeSupport = 0; // Lists language options, one of which is required to be true for the // attribute to be applicable. If empty, no language options are required. list<LangOpt> LangOpts = []; @@ -584,9 +478,6 @@ def AnalyzerNoReturn : InheritableAttr { def Annotate : InheritableParamAttr { let Spellings = [GNU<"annotate">]; let Args = [StringArgument<"Annotation">]; - // Ensure that the annotate attribute can be used with - // '#pragma clang attribute' even though it has no subject list. - let ForcePragmaAttributeSupport = 1; let Documentation = [Undocumented]; } |