From f881267db9a9bfb13a9690323e46873b4e902b37 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Fri, 2 Dec 2016 22:38:31 +0000 Subject: [PATCH] Mass-rename the handful of error_* diagnostics to err_*. llvm-svn: 288545 --- clang/include/clang/Basic/DiagnosticParseKinds.td | 4 +- clang/include/clang/Basic/DiagnosticSemaKinds.td | 72 +++++++++++------------ clang/lib/Parse/ParseDecl.cpp | 2 +- clang/lib/Sema/SemaCast.cpp | 2 +- clang/lib/Sema/SemaDeclObjC.cpp | 6 +- clang/lib/Sema/SemaExpr.cpp | 10 ++-- clang/lib/Sema/SemaExprMember.cpp | 6 +- clang/lib/Sema/SemaExprObjC.cpp | 8 +-- clang/lib/Sema/SemaObjCProperty.cpp | 42 ++++++------- clang/lib/Sema/SemaPseudoObject.cpp | 6 +- clang/lib/Sema/SemaStmt.cpp | 10 ++-- 11 files changed, 84 insertions(+), 84 deletions(-) diff --git a/clang/include/clang/Basic/DiagnosticParseKinds.td b/clang/include/clang/Basic/DiagnosticParseKinds.td index b5b90559..4bcc0b5 100644 --- a/clang/include/clang/Basic/DiagnosticParseKinds.td +++ b/clang/include/clang/Basic/DiagnosticParseKinds.td @@ -63,7 +63,7 @@ def ext_nullability : Extension< "type nullability specifier %0 is a Clang extension">, InGroup>; -def error_empty_enum : Error<"use of empty enum">; +def err_empty_enum : Error<"use of empty enum">; def ext_ident_list_in_param : Extension< "type-less parameter names in function declaration">; @@ -421,7 +421,7 @@ def err_unexpected_protocol_qualifier : Error< "@implementation declaration cannot be protocol qualified">; def err_objc_unexpected_atend : Error< "'@end' appears where closing brace '}' is expected">; -def error_property_ivar_decl : Error< +def err_property_ivar_decl : Error< "property synthesize requires specification of an ivar">; def err_synthesized_property_name : Error< "expected a property name in @synthesize">; diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index b223b51..a266cb4 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -922,7 +922,7 @@ def warn_objc_cdirective_format_string : InGroup, DefaultIgnore; def err_objc_var_decl_inclass : Error<"cannot declare variable inside @interface or @protocol">; -def error_missing_method_context : Error< +def err_missing_method_context : Error< "missing context for method declaration">; def err_objc_property_attr_mutually_exclusive : Error< "property attributes '%0' and '%1' are mutually exclusive">; @@ -1013,7 +1013,7 @@ def warn_property_getter_owning_mismatch : Warning< def warn_property_redecl_getter_mismatch : Warning< "getter name mismatch between property redeclaration (%1) and its original " "declaration (%0)">, InGroup; -def error_property_setter_ambiguous_use : Error< +def err_property_setter_ambiguous_use : Error< "synthesized properties %0 and %1 both claim setter %2 -" " use of this setter will cause unexpected behavior">; def warn_default_atomic_custom_getter_setter : Warning< @@ -1032,12 +1032,12 @@ def err_use_continuation_class_redeclaration_readwrite : Error< "'readonly' public property?)">; def err_continuation_class : Error<"class extension has no primary class">; def err_property_type : Error<"property cannot have array or function type %0">; -def error_missing_property_context : Error< +def err_missing_property_context : Error< "missing context for property implementation declaration">; -def error_bad_property_decl : Error< +def err_bad_property_decl : Error< "property implementation must have its declaration in interface %0 or one of " "its extensions">; -def error_category_property : Error< +def err_category_property : Error< "property declared in category %0 cannot be implemented in " "class implementation">; def note_property_declare : Note< @@ -1046,19 +1046,19 @@ def note_protocol_property_declare : Note< "it could also be property of type %0 declared here">; def note_property_synthesize : Note< "property synthesized here">; -def error_synthesize_category_decl : Error< +def err_synthesize_category_decl : Error< "@synthesize not allowed in a category's implementation">; -def error_synthesize_on_class_property : Error< +def err_synthesize_on_class_property : Error< "@synthesize not allowed on a class property %0">; -def error_reference_property : Error< +def err_reference_property : Error< "property of reference type is not supported">; -def error_missing_property_interface : Error< +def err_missing_property_interface : Error< "property implementation in a category with no category declaration">; -def error_bad_category_property_decl : Error< +def err_bad_category_property_decl : Error< "property implementation must have its declaration in the category %0">; -def error_bad_property_context : Error< +def err_bad_property_context : Error< "property implementation must be in a class or category implementation">; -def error_missing_property_ivar_decl : Error< +def err_missing_property_ivar_decl : Error< "synthesized property %0 must either be named the same as a compatible" " instance variable or must explicitly name an instance variable">; def err_arc_perform_selector_retains : Error< @@ -1092,25 +1092,25 @@ def note_arc_weak_also_accessed_here : Note< def err_incomplete_synthesized_property : Error< "cannot synthesize property %0 with incomplete type %1">; -def error_property_ivar_type : Error< +def err_property_ivar_type : Error< "type of property %0 (%1) does not match type of instance variable %2 (%3)">; -def error_property_accessor_type : Error< +def err_property_accessor_type : Error< "type of property %0 (%1) does not match type of accessor %2 (%3)">; -def error_ivar_in_superclass_use : Error< +def err_ivar_in_superclass_use : Error< "property %0 attempting to use instance variable %1 declared in super class %2">; -def error_weak_property : Error< +def err_weak_property : Error< "existing instance variable %1 for __weak property %0 must be __weak">; -def error_strong_property : Error< +def err_strong_property : Error< "existing instance variable %1 for strong property %0 may not be __weak">; -def error_dynamic_property_ivar_decl : Error< +def err_dynamic_property_ivar_decl : Error< "dynamic property cannot have instance variable specification">; -def error_duplicate_ivar_use : Error< +def err_duplicate_ivar_use : Error< "synthesized properties %0 and %1 both claim instance variable %2">; -def error_property_implemented : Error<"property %0 is already implemented">; +def err_property_implemented : Error<"property %0 is already implemented">; def warn_objc_missing_super_call : Warning< "method possibly missing a [super %0] call">, InGroup; -def error_dealloc_bad_result_type : Error< +def err_dealloc_bad_result_type : Error< "dealloc return type must be correctly specified as 'void' under ARC, " "instead of %0">; def warn_undeclared_selector : Warning< @@ -2448,7 +2448,7 @@ def err_property_is_variably_modified : Error< "property %0 has a variably modified type">; def err_no_accessor_for_property : Error< "no %select{getter|setter}0 defined for property %1">; -def error_cannot_find_suitable_accessor : Error< +def err_cannot_find_suitable_accessor : Error< "cannot find suitable %select{getter|setter}0 for property %1">; def warn_alloca_align_alignof : Warning< @@ -5373,7 +5373,7 @@ def err_typecheck_member_reference_struct_union : Error< "member reference base type %0 is not a structure or union">; def err_typecheck_member_reference_ivar : Error< "%0 does not have a member named %1">; -def error_arc_weak_ivar_access : Error< +def err_arc_weak_ivar_access : Error< "dereferencing a __weak pointer is not allowed due to possible " "null value caused by race condition, assign it to strong variable first">; def err_typecheck_member_reference_arrow : Error< @@ -5775,7 +5775,7 @@ def ext_gnu_ptr_func_arith : Extension< "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 function " "type%select{|s}2 %1%select{| and %3}2 is a GNU extension">, InGroup; -def error_readonly_message_assignment : Error< +def err_readonly_message_assignment : Error< "assigning to 'readonly' return result of an Objective-C message not allowed">; def ext_integer_increment_complex : Extension< "ISO C does not support '++'/'--' on complex integer type %0">; @@ -5791,7 +5791,7 @@ def err_nogetter_property_compound_assignment : Error< "a getter method is needed to perform a compound assignment on a property">; def err_nogetter_property_incdec : Error< "no getter method %1 for %select{increment|decrement}0 of property">; -def error_no_subobject_property_setting : Error< +def err_no_subobject_property_setting : Error< "expression is not assignable">; def err_qualified_objc_access : Error< "%select{property|instance variable}0 access cannot be qualified with '%1'">; @@ -5821,12 +5821,12 @@ def warn_instance_method_not_found_with_typo : Warning< def warn_class_method_not_found_with_typo : Warning< "class method %objcclass0 not found (return type defaults to 'id')" "; did you mean %objcclass2?">, InGroup; -def error_method_not_found_with_typo : Error< +def err_method_not_found_with_typo : Error< "%select{instance|class}1 method %0 not found " "; did you mean %2?">; -def error_no_super_class_message : Error< +def err_no_super_class_message : Error< "no @interface declaration found in class messaging of %0">; -def error_root_class_cannot_use_super : Error< +def err_root_class_cannot_use_super : Error< "%0 cannot use 'super' because it is a root class">; def err_invalid_receiver_to_message_super : Error< "'super' is only valid in a method body">; @@ -5841,11 +5841,11 @@ def err_bad_receiver_type : Error<"bad receiver type %0">; def err_incomplete_receiver_type : Error<"incomplete receiver type %0">; def err_unknown_receiver_suggest : Error< "unknown receiver %0; did you mean %1?">; -def error_objc_throw_expects_object : Error< +def err_objc_throw_expects_object : Error< "@throw requires an Objective-C object type (%0 invalid)">; -def error_objc_synchronized_expects_object : Error< +def err_objc_synchronized_expects_object : Error< "@synchronized requires an Objective-C object type (%0 invalid)">; -def error_rethrow_used_outside_catch : Error< +def err_rethrow_used_outside_catch : Error< "@throw (rethrow) used outside of a @catch block">; def err_attribute_multiple_objc_gc : Error< "multiple garbage collection attributes specified for type">; @@ -7941,13 +7941,13 @@ def warn_direct_super_initialize_call : Warning< "explicit call to [super initialize] should only be in implementation " "of +initialize">, InGroup; -def error_ivar_use_in_class_method : Error< +def err_ivar_use_in_class_method : Error< "instance variable %0 accessed in class method">; -def error_implicit_ivar_access : Error< +def err_implicit_ivar_access : Error< "instance variable %0 cannot be accessed because 'self' has been redeclared">; -def error_private_ivar_access : Error<"instance variable %0 is private">, +def err_private_ivar_access : Error<"instance variable %0 is private">, AccessControl; -def error_protected_ivar_access : Error<"instance variable %0 is protected">, +def err_protected_ivar_access : Error<"instance variable %0 is protected">, AccessControl; def warn_maynot_respond : Warning<"%0 may not respond to %1">; def ext_typecheck_base_super : Warning< @@ -8091,7 +8091,7 @@ def err_sampler_argument_required : Error< "sampler_t variable required - got %0">; def err_wrong_sampler_addressspace: Error< "sampler type cannot be used with the __local and __global address space qualifiers">; -def error_opencl_cast_non_zero_to_event_t : Error< +def err_opencl_cast_non_zero_to_event_t : Error< "cannot cast non-zero value '%0' to 'event_t'">; def err_opencl_global_invalid_addr_space : Error< "%select{program scope|static local|extern}0 variable must reside in %1 address space">; diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index 9184f01..d15e41d 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -4192,7 +4192,7 @@ void Parser::ParseEnumBody(SourceLocation StartLoc, Decl *EnumDecl) { // C does not allow an empty enumerator-list, C++ does [dcl.enum]. if (Tok.is(tok::r_brace) && !getLangOpts().CPlusPlus) - Diag(Tok, diag::error_empty_enum); + Diag(Tok, diag::err_empty_enum); SmallVector EnumConstantDecls; SmallVector EnumAvailabilityDiags; diff --git a/clang/lib/Sema/SemaCast.cpp b/clang/lib/Sema/SemaCast.cpp index 18210093..f4810fb 100644 --- a/clang/lib/Sema/SemaCast.cpp +++ b/clang/lib/Sema/SemaCast.cpp @@ -2441,7 +2441,7 @@ void CastOperation::CheckCStyleCast() { return; } Self.Diag(OpRange.getBegin(), - diag::error_opencl_cast_non_zero_to_event_t) + diag::err_opencl_cast_non_zero_to_event_t) << CastInt.toString(10) << SrcExpr.get()->getSourceRange(); SrcExpr = ExprError(); return; diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp index 17e7141..d172c95 100644 --- a/clang/lib/Sema/SemaDeclObjC.cpp +++ b/clang/lib/Sema/SemaDeclObjC.cpp @@ -209,11 +209,11 @@ bool Sema::CheckARCMethodDecl(ObjCMethodDecl *method) { if (!Context.hasSameType(method->getReturnType(), Context.VoidTy)) { SourceRange ResultTypeRange = method->getReturnTypeSourceRange(); if (ResultTypeRange.isInvalid()) - Diag(method->getLocation(), diag::error_dealloc_bad_result_type) + Diag(method->getLocation(), diag::err_dealloc_bad_result_type) << method->getReturnType() << FixItHint::CreateInsertion(method->getSelectorLoc(0), "(void)"); else - Diag(method->getLocation(), diag::error_dealloc_bad_result_type) + Diag(method->getLocation(), diag::err_dealloc_bad_result_type) << method->getReturnType() << FixItHint::CreateReplacement(ResultTypeRange, "void"); return true; @@ -4317,7 +4317,7 @@ Decl *Sema::ActOnMethodDeclaration( bool isVariadic, bool MethodDefinition) { // Make sure we can establish a context for the method. if (!CurContext->isObjCContainer()) { - Diag(MethodLoc, diag::error_missing_method_context); + Diag(MethodLoc, diag::err_missing_method_context); return nullptr; } ObjCContainerDecl *OCD = dyn_cast(CurContext); diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index d2bfb37..00b15f4 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -2452,7 +2452,7 @@ Sema::LookupInObjCMethod(LookupResult &Lookup, Scope *S, if (IFace && (IV = IFace->lookupInstanceVariable(II, ClassDeclared))) { // Diagnose using an ivar in a class method. if (IsClassMethod) - return ExprError(Diag(Loc, diag::error_ivar_use_in_class_method) + return ExprError(Diag(Loc, diag::err_ivar_use_in_class_method) << IV->getDeclName()); // If we're referencing an invalid decl, just return this as a silent @@ -2468,7 +2468,7 @@ Sema::LookupInObjCMethod(LookupResult &Lookup, Scope *S, if (IV->getAccessControl() == ObjCIvarDecl::Private && !declaresSameEntity(ClassDeclared, IFace) && !getLangOpts().DebuggerSupport) - Diag(Loc, diag::error_private_ivar_access) << IV->getDeclName(); + Diag(Loc, diag::err_private_ivar_access) << IV->getDeclName(); // FIXME: This should use a new expr for a direct reference, don't // turn this into Self->ivar, just return a BareIVarExpr or something. @@ -2524,7 +2524,7 @@ Sema::LookupInObjCMethod(LookupResult &Lookup, Scope *S, Lookup.getFoundDecl()->isDefinedOutsideFunctionOrMethod()) { // If accessing a stand-alone ivar in a class method, this is an error. if (const ObjCIvarDecl *IV = dyn_cast(Lookup.getFoundDecl())) - return ExprError(Diag(Loc, diag::error_ivar_use_in_class_method) + return ExprError(Diag(Loc, diag::err_ivar_use_in_class_method) << IV->getDeclName()); } @@ -10092,10 +10092,10 @@ static bool CheckForModifiableLvalue(Expr *E, SourceLocation Loc, Sema &S) { case Expr::MLV_NoSetterProperty: llvm_unreachable("readonly properties should be processed differently"); case Expr::MLV_InvalidMessageExpression: - DiagID = diag::error_readonly_message_assignment; + DiagID = diag::err_readonly_message_assignment; break; case Expr::MLV_SubObjCPropertySetting: - DiagID = diag::error_no_subobject_property_setting; + DiagID = diag::err_no_subobject_property_setting; break; } diff --git a/clang/lib/Sema/SemaExprMember.cpp b/clang/lib/Sema/SemaExprMember.cpp index 1cc76ba..eddf0d6 100644 --- a/clang/lib/Sema/SemaExprMember.cpp +++ b/clang/lib/Sema/SemaExprMember.cpp @@ -1456,11 +1456,11 @@ static ExprResult LookupMemberExpr(Sema &S, LookupResult &R, if (IV->getAccessControl() == ObjCIvarDecl::Private) { if (!declaresSameEntity(ClassDeclared, IDecl) || !declaresSameEntity(ClassOfMethodDecl, ClassDeclared)) - S.Diag(MemberLoc, diag::error_private_ivar_access) + S.Diag(MemberLoc, diag::err_private_ivar_access) << IV->getDeclName(); } else if (!IDecl->isSuperClassOf(ClassOfMethodDecl)) // @protected - S.Diag(MemberLoc, diag::error_protected_ivar_access) + S.Diag(MemberLoc, diag::err_protected_ivar_access) << IV->getDeclName(); } } @@ -1473,7 +1473,7 @@ static ExprResult LookupMemberExpr(Sema &S, LookupResult &R, if (DeclRefExpr *DE = dyn_cast(BaseExp)) if (DE->getType().getObjCLifetime() == Qualifiers::OCL_Weak) { - S.Diag(DE->getLocation(), diag::error_arc_weak_ivar_access); + S.Diag(DE->getLocation(), diag::err_arc_weak_ivar_access); warn = false; } } diff --git a/clang/lib/Sema/SemaExprObjC.cpp b/clang/lib/Sema/SemaExprObjC.cpp index e7d0d2f..b37c3fd 100644 --- a/clang/lib/Sema/SemaExprObjC.cpp +++ b/clang/lib/Sema/SemaExprObjC.cpp @@ -1534,7 +1534,7 @@ bool Sema::CheckMessageArgumentTypes(QualType ReceiverType, const ObjCMethodDecl *OMD = SelectorsForTypoCorrection(Sel, ReceiverType); if (OMD && !OMD->isInvalidDecl()) { if (getLangOpts().ObjCAutoRefCount) - DiagID = diag::error_method_not_found_with_typo; + DiagID = diag::err_method_not_found_with_typo; else DiagID = isClassMessage ? diag::warn_class_method_not_found_with_typo : diag::warn_instance_method_not_found_with_typo; @@ -1956,7 +1956,7 @@ ActOnClassPropertyRefExpr(IdentifierInfo &receiverName, if (CurMethod->isInstanceMethod()) { if (SuperType.isNull()) { // The current class does not have a superclass. - Diag(receiverNameLoc, diag::error_root_class_cannot_use_super) + Diag(receiverNameLoc, diag::err_root_class_cannot_use_super) << CurMethod->getClassInterface()->getIdentifier(); return ExprError(); } @@ -2165,7 +2165,7 @@ ExprResult Sema::ActOnSuperMessage(Scope *S, ObjCInterfaceDecl *Class = Method->getClassInterface(); if (!Class) { - Diag(SuperLoc, diag::error_no_super_class_message) + Diag(SuperLoc, diag::err_no_super_class_message) << Method->getDeclName(); return ExprError(); } @@ -2173,7 +2173,7 @@ ExprResult Sema::ActOnSuperMessage(Scope *S, QualType SuperTy(Class->getSuperClassType(), 0); if (SuperTy.isNull()) { // The current class does not have a superclass. - Diag(SuperLoc, diag::error_root_class_cannot_use_super) + Diag(SuperLoc, diag::err_root_class_cannot_use_super) << Class->getIdentifier(); return ExprError(); } diff --git a/clang/lib/Sema/SemaObjCProperty.cpp b/clang/lib/Sema/SemaObjCProperty.cpp index 5e38751..9ab80b4 100644 --- a/clang/lib/Sema/SemaObjCProperty.cpp +++ b/clang/lib/Sema/SemaObjCProperty.cpp @@ -753,7 +753,7 @@ static void checkARCPropertyImpl(Sema &S, SourceLocation propertyImplLoc, break; case Qualifiers::OCL_Weak: - S.Diag(ivar->getLocation(), diag::error_weak_property) + S.Diag(ivar->getLocation(), diag::err_weak_property) << property->getDeclName() << ivar->getDeclName(); break; @@ -904,7 +904,7 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S, dyn_cast(CurContext); // Make sure we have a context for the property implementation declaration. if (!ClassImpDecl) { - Diag(AtLoc, diag::error_missing_property_context); + Diag(AtLoc, diag::err_missing_property_context); return nullptr; } if (PropertyIvarLoc.isInvalid()) @@ -928,11 +928,11 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S, // Look for this property declaration in the @implementation's @interface property = IDecl->FindPropertyDeclaration(PropertyId, QueryKind); if (!property) { - Diag(PropertyLoc, diag::error_bad_property_decl) << IDecl->getDeclName(); + Diag(PropertyLoc, diag::err_bad_property_decl) << IDecl->getDeclName(); return nullptr; } if (property->isClassProperty() && Synthesize) { - Diag(PropertyLoc, diag::error_synthesize_on_class_property) << PropertyId; + Diag(PropertyLoc, diag::err_synthesize_on_class_property) << PropertyId; return nullptr; } unsigned PIkind = property->getPropertyAttributesAsWritten(); @@ -948,7 +948,7 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S, if (const ObjCCategoryDecl *CD = dyn_cast(property->getDeclContext())) { if (!CD->IsClassExtension()) { - Diag(PropertyLoc, diag::error_category_property) << CD->getDeclName(); + Diag(PropertyLoc, diag::err_category_property) << CD->getDeclName(); Diag(property->getLocation(), diag::note_property_declare); return nullptr; } @@ -992,12 +992,12 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S, } else if ((CatImplClass = dyn_cast(ClassImpDecl))) { if (Synthesize) { - Diag(AtLoc, diag::error_synthesize_category_decl); + Diag(AtLoc, diag::err_synthesize_category_decl); return nullptr; } IDecl = CatImplClass->getClassInterface(); if (!IDecl) { - Diag(AtLoc, diag::error_missing_property_interface); + Diag(AtLoc, diag::err_missing_property_interface); return nullptr; } ObjCCategoryDecl *Category = @@ -1010,12 +1010,12 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S, // Look for this property declaration in @implementation's category property = Category->FindPropertyDeclaration(PropertyId, QueryKind); if (!property) { - Diag(PropertyLoc, diag::error_bad_category_property_decl) + Diag(PropertyLoc, diag::err_bad_category_property_decl) << Category->getDeclName(); return nullptr; } } else { - Diag(AtLoc, diag::error_bad_property_context); + Diag(AtLoc, diag::err_bad_property_context); return nullptr; } ObjCIvarDecl *Ivar = nullptr; @@ -1153,13 +1153,13 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S, IDecl->makeDeclVisibleInContext(Ivar); if (getLangOpts().ObjCRuntime.isFragile()) - Diag(PropertyDiagLoc, diag::error_missing_property_ivar_decl) + Diag(PropertyDiagLoc, diag::err_missing_property_ivar_decl) << PropertyId; // Note! I deliberately want it to fall thru so, we have a // a property implementation and to avoid future warnings. } else if (getLangOpts().ObjCRuntime.isNonFragile() && !declaresSameEntity(ClassDeclared, IDecl)) { - Diag(PropertyDiagLoc, diag::error_ivar_in_superclass_use) + Diag(PropertyDiagLoc, diag::err_ivar_in_superclass_use) << property->getDeclName() << Ivar->getDeclName() << ClassDeclared->getDeclName(); Diag(Ivar->getLocation(), diag::note_previous_access_declaration) @@ -1184,7 +1184,7 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S, == Compatible); } if (!compat) { - Diag(PropertyDiagLoc, diag::error_property_ivar_type) + Diag(PropertyDiagLoc, diag::err_property_ivar_type) << property->getDeclName() << PropType << Ivar->getDeclName() << IvarType; Diag(Ivar->getLocation(), diag::note_ivar_decl); @@ -1199,7 +1199,7 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S, QualType rhsType =Context.getCanonicalType(IvarType).getUnqualifiedType(); if (lhsType != rhsType && lhsType->isArithmeticType()) { - Diag(PropertyDiagLoc, diag::error_property_ivar_type) + Diag(PropertyDiagLoc, diag::err_property_ivar_type) << property->getDeclName() << PropType << Ivar->getDeclName() << IvarType; Diag(Ivar->getLocation(), diag::note_ivar_decl); @@ -1209,7 +1209,7 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S, // __weak is explicit. So it works on Canonical type. if ((PropType.isObjCGCWeak() && !IvarType.isObjCGCWeak() && getLangOpts().getGC() != LangOptions::NonGC)) { - Diag(PropertyDiagLoc, diag::error_weak_property) + Diag(PropertyDiagLoc, diag::err_weak_property) << property->getDeclName() << Ivar->getDeclName(); Diag(Ivar->getLocation(), diag::note_ivar_decl); // Fall thru - see previous comment @@ -1218,7 +1218,7 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S, if ((property->getType()->isObjCObjectPointerType() || PropType.isObjCGCStrong()) && IvarType.isObjCGCWeak() && getLangOpts().getGC() != LangOptions::NonGC) { - Diag(PropertyDiagLoc, diag::error_strong_property) + Diag(PropertyDiagLoc, diag::err_strong_property) << property->getDeclName() << Ivar->getDeclName(); // Fall thru - see previous comment } @@ -1228,7 +1228,7 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S, checkARCPropertyImpl(*this, PropertyLoc, property, Ivar); } else if (PropertyIvar) // @dynamic - Diag(PropertyDiagLoc, diag::error_dynamic_property_ivar_decl); + Diag(PropertyDiagLoc, diag::err_dynamic_property_ivar_decl); assert (property && "ActOnPropertyImplDecl - property declaration missing"); ObjCPropertyImplDecl *PIDecl = @@ -1348,7 +1348,7 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S, if (Synthesize) if (ObjCPropertyImplDecl *PPIDecl = IC->FindPropertyImplIvarDecl(PropertyIvar)) { - Diag(PropertyLoc, diag::error_duplicate_ivar_use) + Diag(PropertyLoc, diag::err_duplicate_ivar_use) << PropertyId << PPIDecl->getPropertyDecl()->getIdentifier() << PropertyIvar; Diag(PPIDecl->getLocation(), diag::note_previous_use); @@ -1356,7 +1356,7 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S, if (ObjCPropertyImplDecl *PPIDecl = IC->FindPropertyImplDecl(PropertyId, QueryKind)) { - Diag(PropertyLoc, diag::error_property_implemented) << PropertyId; + Diag(PropertyLoc, diag::err_property_implemented) << PropertyId; Diag(PPIDecl->getLocation(), diag::note_previous_declaration); return nullptr; } @@ -1387,7 +1387,7 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S, if (Synthesize) if (ObjCPropertyImplDecl *PPIDecl = CatImplClass->FindPropertyImplIvarDecl(PropertyIvar)) { - Diag(PropertyDiagLoc, diag::error_duplicate_ivar_use) + Diag(PropertyDiagLoc, diag::err_duplicate_ivar_use) << PropertyId << PPIDecl->getPropertyDecl()->getIdentifier() << PropertyIvar; Diag(PPIDecl->getLocation(), diag::note_previous_use); @@ -1395,7 +1395,7 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S, if (ObjCPropertyImplDecl *PPIDecl = CatImplClass->FindPropertyImplDecl(PropertyId, QueryKind)) { - Diag(PropertyDiagLoc, diag::error_property_implemented) << PropertyId; + Diag(PropertyDiagLoc, diag::err_property_implemented) << PropertyId; Diag(PPIDecl->getLocation(), diag::note_previous_declaration); return nullptr; } @@ -1505,7 +1505,7 @@ bool Sema::DiagnosePropertyAccessorMismatch(ObjCPropertyDecl *property, compat = Context.canAssignObjCInterfaces(getterObjCPtr, propertyObjCPtr); else if (CheckAssignmentConstraints(Loc, GetterType, PropertyRValueType) != Compatible) { - Diag(Loc, diag::error_property_accessor_type) + Diag(Loc, diag::err_property_accessor_type) << property->getDeclName() << PropertyRValueType << GetterMethod->getSelector() << GetterType; Diag(GetterMethod->getLocation(), diag::note_declared_at); diff --git a/clang/lib/Sema/SemaPseudoObject.cpp b/clang/lib/Sema/SemaPseudoObject.cpp index a614018..211032c 100644 --- a/clang/lib/Sema/SemaPseudoObject.cpp +++ b/clang/lib/Sema/SemaPseudoObject.cpp @@ -661,7 +661,7 @@ bool ObjCPropertyOpBuilder::findSetter(bool warn) { if (ObjCPropertyDecl *prop1 = IFace->FindPropertyDeclaration( AltMember, prop->getQueryKind())) if (prop != prop1 && (prop1->getSetterMethodDecl() == setter)) { - S.Diag(RefExpr->getExprLoc(), diag::error_property_setter_ambiguous_use) + S.Diag(RefExpr->getExprLoc(), diag::err_property_setter_ambiguous_use) << prop << prop1 << setter->getSelector(); S.Diag(prop->getLocation(), diag::note_property_declare); S.Diag(prop1->getLocation(), diag::note_property_declare); @@ -1480,7 +1480,7 @@ ExprResult MSPropertyOpBuilder::buildGet() { SourceLocation(), GetterName, nullptr); if (GetterExpr.isInvalid()) { S.Diag(RefExpr->getMemberLoc(), - diag::error_cannot_find_suitable_accessor) << 0 /* getter */ + diag::err_cannot_find_suitable_accessor) << 0 /* getter */ << RefExpr->getPropertyDecl(); return ExprError(); } @@ -1509,7 +1509,7 @@ ExprResult MSPropertyOpBuilder::buildSet(Expr *op, SourceLocation sl, SourceLocation(), SetterName, nullptr); if (SetterExpr.isInvalid()) { S.Diag(RefExpr->getMemberLoc(), - diag::error_cannot_find_suitable_accessor) << 1 /* setter */ + diag::err_cannot_find_suitable_accessor) << 1 /* setter */ << RefExpr->getPropertyDecl(); return ExprError(); } diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp index 79ad049..89c82c9 100644 --- a/clang/lib/Sema/SemaStmt.cpp +++ b/clang/lib/Sema/SemaStmt.cpp @@ -3451,7 +3451,7 @@ StmtResult Sema::BuildObjCAtThrowStmt(SourceLocation AtLoc, Expr *Throw) { !ThrowType->isObjCObjectPointerType()) { const PointerType *PT = ThrowType->getAs(); if (!PT || !PT->getPointeeType()->isVoidType()) - return StmtError(Diag(AtLoc, diag::error_objc_throw_expects_object) + return StmtError(Diag(AtLoc, diag::err_objc_throw_expects_object) << Throw->getType() << Throw->getSourceRange()); } } @@ -3472,7 +3472,7 @@ Sema::ActOnObjCAtThrowStmt(SourceLocation AtLoc, Expr *Throw, while (AtCatchParent && !AtCatchParent->isAtCatchScope()) AtCatchParent = AtCatchParent->getParent(); if (!AtCatchParent) - return StmtError(Diag(AtLoc, diag::error_rethrow_used_outside_catch)); + return StmtError(Diag(AtLoc, diag::err_rethrow_used_outside_catch)); } return BuildObjCAtThrowStmt(AtLoc, Throw); } @@ -3493,19 +3493,19 @@ Sema::ActOnObjCAtSynchronizedOperand(SourceLocation atLoc, Expr *operand) { if (getLangOpts().CPlusPlus) { if (RequireCompleteType(atLoc, type, diag::err_incomplete_receiver_type)) - return Diag(atLoc, diag::error_objc_synchronized_expects_object) + return Diag(atLoc, diag::err_objc_synchronized_expects_object) << type << operand->getSourceRange(); ExprResult result = PerformContextuallyConvertToObjCPointer(operand); if (result.isInvalid()) return ExprError(); if (!result.isUsable()) - return Diag(atLoc, diag::error_objc_synchronized_expects_object) + return Diag(atLoc, diag::err_objc_synchronized_expects_object) << type << operand->getSourceRange(); operand = result.get(); } else { - return Diag(atLoc, diag::error_objc_synchronized_expects_object) + return Diag(atLoc, diag::err_objc_synchronized_expects_object) << type << operand->getSourceRange(); } } -- 2.7.4