Specifying the diagnostic argument through the attribute table generator instead of having to enter it manually as part of the attribute subject list. This only affects attributes appertaining to ObjC interfaces and protocols.

No new tests required as this is covered by existing tests.

llvm-svn: 213193
This commit is contained in:
Aaron Ballman 2014-07-16 20:28:10 +00:00
parent 1e7facdf20
commit 173361e7e0
2 changed files with 6 additions and 5 deletions

View File

@ -990,11 +990,10 @@ def ObjCDesignatedInitializer : Attr {
}
def ObjCRuntimeName : Attr {
let Spellings = [GNU<"objc_runtime_name">];
let Subjects = SubjectList<[ObjCInterface, ObjCProtocol], ErrorDiag,
"ExpectedObjectiveCInterfaceOrProtocol">;
let Args = [StringArgument<"MetadataName">];
let Documentation = [ObjCRuntimeNameDocs];
let Spellings = [GNU<"objc_runtime_name">];
let Subjects = SubjectList<[ObjCInterface, ObjCProtocol], ErrorDiag>;
let Args = [StringArgument<"MetadataName">];
let Documentation = [ObjCRuntimeNameDocs];
}
def OptimizeNone : InheritableAttr {

View File

@ -2154,6 +2154,8 @@ static std::string CalculateDiagnostic(const Record &S) {
"ExpectedVariableOrFunction)";
case ObjCMethod | ObjCProp: return "ExpectedMethodOrProperty";
case ObjCProtocol | ObjCInterface:
return "ExpectedObjectiveCInterfaceOrProtocol";
case Field | Var: return "ExpectedFieldOrGlobalVar";
}