HasFunctionProto is a more strict version of FunctionLike. Since attribute subjects are inclusive (passing a single subject test means no subject-related diagnostic will fire), these two subjects should not be combined.
llvm-svn: 199662
This commit is contained in:
parent
9ff54e1fcb
commit
9e013515aa
|
@ -65,6 +65,9 @@ def DeclBase : AttrSubject;
|
|||
def FunctionLike : SubsetSubject<DeclBase,
|
||||
[{S->getFunctionType(false) != NULL}]>;
|
||||
|
||||
// HasFunctionProto is a more strict version of FunctionLike, so it should
|
||||
// never be specified in a Subjects list along with FunctionLike (due to the
|
||||
// inclusive nature of subject testing).
|
||||
def HasFunctionProto : SubsetSubject<DeclBase,
|
||||
[{(S->getFunctionType(true) != NULL &&
|
||||
isa<FunctionProtoType>(S->getFunctionType())) ||
|
||||
|
@ -554,15 +557,15 @@ def Format : InheritableAttr {
|
|||
let Spellings = [GNU<"format">, CXX11<"gnu", "format">];
|
||||
let Args = [IdentifierArgument<"Type">, IntArgument<"FormatIdx">,
|
||||
IntArgument<"FirstArg">];
|
||||
let Subjects = SubjectList<[ObjCMethod, Block, FunctionLike,
|
||||
HasFunctionProto], WarnDiag, "ExpectedFunction">;
|
||||
let Subjects = SubjectList<[ObjCMethod, Block, HasFunctionProto], WarnDiag,
|
||||
"ExpectedFunction">;
|
||||
}
|
||||
|
||||
def FormatArg : InheritableAttr {
|
||||
let Spellings = [GNU<"format_arg">, CXX11<"gnu", "format_arg">];
|
||||
let Args = [IntArgument<"FormatIdx">];
|
||||
let Subjects = SubjectList<[ObjCMethod, FunctionLike, HasFunctionProto],
|
||||
WarnDiag, "ExpectedFunction">;
|
||||
let Subjects = SubjectList<[ObjCMethod, HasFunctionProto], WarnDiag,
|
||||
"ExpectedFunction">;
|
||||
}
|
||||
|
||||
def GNUInline : InheritableAttr {
|
||||
|
@ -679,9 +682,8 @@ def NoMips16 : InheritableAttr, TargetSpecificAttr<TargetMips> {
|
|||
|
||||
def NonNull : InheritableAttr {
|
||||
let Spellings = [GNU<"nonnull">, CXX11<"gnu", "nonnull">];
|
||||
let Subjects = SubjectList<[ObjCMethod, FunctionLike, HasFunctionProto,
|
||||
ParmVar],
|
||||
WarnDiag, "ExpectedFunctionMethodOrParameter">;
|
||||
let Subjects = SubjectList<[ObjCMethod, HasFunctionProto, ParmVar], WarnDiag,
|
||||
"ExpectedFunctionMethodOrParameter">;
|
||||
let Args = [VariadicUnsignedArgument<"Args">];
|
||||
let AdditionalMembers =
|
||||
[{bool isNonNull(unsigned idx) const {
|
||||
|
@ -695,8 +697,8 @@ def NonNull : InheritableAttr {
|
|||
|
||||
def ReturnsNonNull : InheritableAttr {
|
||||
let Spellings = [GNU<"returns_nonnull">];
|
||||
let Subjects = SubjectList<[ObjCMethod, FunctionLike, HasFunctionProto],
|
||||
WarnDiag, "ExpectedFunctionOrMethod">;
|
||||
let Subjects = SubjectList<[ObjCMethod, HasFunctionProto], WarnDiag,
|
||||
"ExpectedFunctionOrMethod">;
|
||||
}
|
||||
|
||||
def NoReturn : InheritableAttr {
|
||||
|
@ -836,8 +838,7 @@ def Ownership : InheritableAttr {
|
|||
}
|
||||
}];
|
||||
let Args = [IdentifierArgument<"Module">, VariadicUnsignedArgument<"Args">];
|
||||
let Subjects = SubjectList<[FunctionLike, HasFunctionProto], WarnDiag,
|
||||
"ExpectedFunction">;
|
||||
let Subjects = SubjectList<[HasFunctionProto], WarnDiag, "ExpectedFunction">;
|
||||
}
|
||||
|
||||
def Packed : InheritableAttr {
|
||||
|
|
Loading…
Reference in New Issue