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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213193 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Aaron Ballman 2014-07-16 20:28:10 +00:00
parent 906f34cfab
commit 7b183ffd3e
2 changed files with 6 additions and 5 deletions

View File

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

View File

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