Remove attribute handling code for simple attributes; NFC

Attributes that set the SimpleHandler flag in Attr.td don't need to be
explicitly handled in SemaDeclAttr.cpp.
This commit is contained in:
Aaron Ballman 2021-04-02 11:33:04 -04:00
parent dd43e13c00
commit 3ebfa363f3
2 changed files with 5 additions and 27 deletions

View File

@ -2113,6 +2113,7 @@ def ObjCNonRuntimeProtocol : Attr {
let Subjects = SubjectList<[ObjCProtocol], ErrorDiag>;
let LangOpts = [ObjC];
let Documentation = [ObjCNonRuntimeProtocolDocs];
let SimpleHandler = 1;
}
def ObjCRuntimeName : Attr {
@ -2247,12 +2248,14 @@ def SwiftBridgedTypedef : InheritableAttr {
let Spellings = [GNU<"swift_bridged_typedef">];
let Subjects = SubjectList<[TypedefName], ErrorDiag>;
let Documentation = [SwiftBridgedTypedefDocs];
let SimpleHandler = 1;
}
def SwiftObjCMembers : Attr {
let Spellings = [GNU<"swift_objc_members">];
let Subjects = SubjectList<[ObjCInterface], ErrorDiag>;
let Documentation = [SwiftObjCMembersDocs];
let SimpleHandler = 1;
}
def SwiftError : InheritableAttr {
@ -2284,6 +2287,7 @@ def SwiftNewType : InheritableAttr {
def SwiftPrivate : InheritableAttr {
let Spellings = [GNU<"swift_private">];
let Documentation = [SwiftPrivateDocs];
let SimpleHandler = 1;
}
def NoDeref : TypeAttr {
@ -3667,6 +3671,7 @@ def LoaderUninitialized : Attr {
let Spellings = [Clang<"loader_uninitialized">];
let Subjects = SubjectList<[GlobalVar]>;
let Documentation = [LoaderUninitializedDocs];
let SimpleHandler = 1;
}
def ObjCExternallyRetained : InheritableAttr {

View File

@ -2650,11 +2650,6 @@ static void handleVisibilityAttr(Sema &S, Decl *D, const ParsedAttr &AL,
D->addAttr(newAttr);
}
static void handleObjCNonRuntimeProtocolAttr(Sema &S, Decl *D,
const ParsedAttr &AL) {
handleSimpleAttribute<ObjCNonRuntimeProtocolAttr>(S, D, AL);
}
static void handleObjCDirectAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
// objc_direct cannot be set on methods declared in the context of a protocol
if (isa<ObjCProtocolDecl>(D->getDeclContext())) {
@ -7957,9 +7952,6 @@ static void ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D,
case ParsedAttr::AT_AnyX86NoCfCheck:
handleNoCfCheckAttr(S, D, AL);
break;
case ParsedAttr::AT_Leaf:
handleSimpleAttribute<LeafAttr>(S, D, AL);
break;
case ParsedAttr::AT_NoThrow:
if (!AL.isUsedAsTypeAttr())
handleSimpleAttribute<NoThrowAttr>(S, D, AL);
@ -8093,9 +8085,6 @@ static void ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D,
case ParsedAttr::AT_ObjCDirect:
handleObjCDirectAttr(S, D, AL);
break;
case ParsedAttr::AT_ObjCNonRuntimeProtocol:
handleObjCNonRuntimeProtocolAttr(S, D, AL);
break;
case ParsedAttr::AT_ObjCDirectMembers:
handleObjCDirectMembersAttr(S, D, AL);
handleSimpleAttribute<ObjCDirectMembersAttr>(S, D, AL);
@ -8114,9 +8103,6 @@ static void ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D,
handleSimpleAttributeWithExclusions<DisableTailCallsAttr, NakedAttr>(S, D,
AL);
break;
case ParsedAttr::AT_NoMerge:
handleSimpleAttribute<NoMergeAttr>(S, D, AL);
break;
case ParsedAttr::AT_Visibility:
handleVisibilityAttr(S, D, AL, false);
break;
@ -8324,9 +8310,6 @@ static void ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D,
case ParsedAttr::AT_SwiftBridge:
handleSwiftBridge(S, D, AL);
break;
case ParsedAttr::AT_SwiftBridgedTypedef:
handleSimpleAttribute<SwiftBridgedTypedefAttr>(S, D, AL);
break;
case ParsedAttr::AT_SwiftError:
handleSwiftError(S, D, AL);
break;
@ -8336,12 +8319,6 @@ static void ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D,
case ParsedAttr::AT_SwiftNewType:
handleSwiftNewType(S, D, AL);
break;
case ParsedAttr::AT_SwiftObjCMembers:
handleSimpleAttribute<SwiftObjCMembersAttr>(S, D, AL);
break;
case ParsedAttr::AT_SwiftPrivate:
handleSimpleAttribute<SwiftPrivateAttr>(S, D, AL);
break;
case ParsedAttr::AT_SwiftAsync:
handleSwiftAsyncAttr(S, D, AL);
break;
@ -8367,10 +8344,6 @@ static void ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D,
handleUninitializedAttr(S, D, AL);
break;
case ParsedAttr::AT_LoaderUninitialized:
handleSimpleAttribute<LoaderUninitializedAttr>(S, D, AL);
break;
case ParsedAttr::AT_ObjCExternallyRetained:
handleObjCExternallyRetainedAttr(S, D, AL);
break;