From: Richard Smith Date: Fri, 2 Dec 2016 23:00:28 +0000 (+0000) Subject: More diagnostic name fixups: w_ -> warn_, warning_ -> warn_, not_ -> note_. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8ef39c62fb19b21a9282769fd62ce1d0150251d2;p=clang More diagnostic name fixups: w_ -> warn_, warning_ -> warn_, not_ -> note_. In passing, add a warning group for "ignored qualifier in inline assembly" warnings. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288548 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/DiagnosticGroups.td b/include/clang/Basic/DiagnosticGroups.td index b3968dabeb..dc6ceefd15 100644 --- a/include/clang/Basic/DiagnosticGroups.td +++ b/include/clang/Basic/DiagnosticGroups.td @@ -846,8 +846,9 @@ def ObjCLiteralComparison : DiagGroup<"objc-literal-compare", [ // Inline ASM warnings. def ASMOperandWidths : DiagGroup<"asm-operand-widths">; +def ASMIgnoredQualifier : DiagGroup<"asm-ignored-qualifier">; def ASM : DiagGroup<"asm", [ - ASMOperandWidths + ASMOperandWidths, ASMIgnoredQualifier ]>; // OpenMP warnings. diff --git a/include/clang/Basic/DiagnosticParseKinds.td b/include/clang/Basic/DiagnosticParseKinds.td index 4bcc0b555b..4bd812446c 100644 --- a/include/clang/Basic/DiagnosticParseKinds.td +++ b/include/clang/Basic/DiagnosticParseKinds.td @@ -13,10 +13,11 @@ let Component = "Parse" in { -def w_asm_qualifier_ignored : Warning<"ignored %0 qualifier on asm">, - CatInlineAsm; +def warn_asm_qualifier_ignored : Warning< + "ignored %0 qualifier on asm">, CatInlineAsm, InGroup; def warn_file_asm_volatile : Warning< - "meaningless 'volatile' on asm outside function">, CatInlineAsm; + "meaningless 'volatile' on asm outside function">, CatInlineAsm, + InGroup; let CategoryName = "Inline Assembly Issue" in { def err_asm_empty : Error<"__asm used with no assembly instructions">; diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index a266cb4385..4ab18e7677 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -906,7 +906,7 @@ def warn_strict_multiple_method_decl : Warning< "multiple methods named %0 found">, InGroup, DefaultIgnore; def warn_accessor_property_type_mismatch : Warning< "type of property %0 does not match type of accessor %1">; -def not_conv_function_declared_at : Note<"type conversion function declared here">; +def note_conv_function_declared_at : Note<"type conversion function declared here">; def note_method_declared_at : Note<"method %0 declared here">; def note_property_attribute : Note<"property %0 is declared " "%select{deprecated|unavailable|partial}1 here">; @@ -1134,7 +1134,7 @@ def warn_unimplemented_selector: Warning< InGroup, DefaultIgnore; def warn_unimplemented_protocol_method : Warning< "method %0 in protocol %1 not implemented">, InGroup; -def warning_multiple_selectors: Warning< +def warn_multiple_selectors: Warning< "several methods with selector %0 of mismatched types are found " "for the @selector expression">, InGroup, DefaultIgnore; @@ -6409,7 +6409,7 @@ def err_typecheck_missing_return_type_incompatible : Error< "return type must match previous return type}0,1 when %select{block " "literal|lambda expression}2 has unspecified explicit return type">; -def not_incomplete_class_and_qualified_id : Note< +def note_incomplete_class_and_qualified_id : Note< "conformance of forward class %0 to protocol %1 can not be confirmed">; def warn_incompatible_qualified_id : Warning< "%select{%diff{assigning to $ from incompatible type $|" @@ -8555,7 +8555,7 @@ def err_omp_expected_int_param : Error< "expected a reference to an integer-typed parameter">; def err_omp_at_least_one_motion_clause_required : Error< "expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'">; -def err_omp_usedeviceptr_not_a_pointer : Error< +def err_omp_usedeviceptr_not_a_pointer : Error< "expected pointer or reference to pointer in 'use_device_ptr' clause">; def err_omp_argument_type_isdeviceptr : Error < "expected pointer, array, reference to pointer, or reference to array in 'is_device_ptr clause'">; diff --git a/lib/Parse/ParseStmtAsm.cpp b/lib/Parse/ParseStmtAsm.cpp index 1f63dc257b..293de78505 100644 --- a/lib/Parse/ParseStmtAsm.cpp +++ b/lib/Parse/ParseStmtAsm.cpp @@ -681,12 +681,12 @@ StmtResult Parser::ParseAsmStatement(bool &msAsm) { // GNU asms accept, but warn, about type-qualifiers other than volatile. if (DS.getTypeQualifiers() & DeclSpec::TQ_const) - Diag(Loc, diag::w_asm_qualifier_ignored) << "const"; + Diag(Loc, diag::warn_asm_qualifier_ignored) << "const"; if (DS.getTypeQualifiers() & DeclSpec::TQ_restrict) - Diag(Loc, diag::w_asm_qualifier_ignored) << "restrict"; + Diag(Loc, diag::warn_asm_qualifier_ignored) << "restrict"; // FIXME: Once GCC supports _Atomic, check whether it permits it here. if (DS.getTypeQualifiers() & DeclSpec::TQ_atomic) - Diag(Loc, diag::w_asm_qualifier_ignored) << "_Atomic"; + Diag(Loc, diag::warn_asm_qualifier_ignored) << "_Atomic"; // Remember if this was a volatile asm. bool isVolatile = DS.getTypeQualifiers() & DeclSpec::TQ_volatile; diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 00b15f420f..667ea6cb4e 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -12761,7 +12761,7 @@ bool Sema::DiagnoseAssignmentResult(AssignConvertType ConvTy, Diag(Loc, FDiag); if (DiagKind == diag::warn_incompatible_qualified_id && PDecl && IFace && !IFace->hasDefinition()) - Diag(IFace->getLocation(), diag::not_incomplete_class_and_qualified_id) + Diag(IFace->getLocation(), diag::note_incomplete_class_and_qualified_id) << IFace->getName() << PDecl->getName(); if (SecondType == Context.OverloadTy) diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp index b37c3fdb19..7dbd660f53 100644 --- a/lib/Sema/SemaExprObjC.cpp +++ b/lib/Sema/SemaExprObjC.cpp @@ -1112,7 +1112,7 @@ static bool HelperToDiagnoseMismatchedMethodsInGlobalPool(Sema &S, MatchingMethodDecl, Sema::MMS_loose)) { if (!Warned) { Warned = true; - S.Diag(AtLoc, diag::warning_multiple_selectors) + S.Diag(AtLoc, diag::warn_multiple_selectors) << Method->getSelector() << FixItHint::CreateInsertion(LParenLoc, "(") << FixItHint::CreateInsertion(RParenLoc, ")"); S.Diag(Method->getLocation(), diag::note_method_declared_at) @@ -1131,7 +1131,7 @@ static void DiagnoseMismatchedSelectors(Sema &S, SourceLocation AtLoc, SourceLocation RParenLoc, bool WarnMultipleSelectors) { if (!WarnMultipleSelectors || - S.Diags.isIgnored(diag::warning_multiple_selectors, SourceLocation())) + S.Diags.isIgnored(diag::warn_multiple_selectors, SourceLocation())) return; bool Warned = false; for (Sema::GlobalMethodPool::iterator b = S.MethodPool.begin(), diff --git a/lib/Sema/SemaPseudoObject.cpp b/lib/Sema/SemaPseudoObject.cpp index 211032c44e..8e53fda846 100644 --- a/lib/Sema/SemaPseudoObject.cpp +++ b/lib/Sema/SemaPseudoObject.cpp @@ -1104,8 +1104,9 @@ Sema::ObjCSubscriptKind Diag(FromE->getExprLoc(), diag::err_objc_multiple_subscript_type_conversion) << FromE->getType(); for (unsigned int i = 0; i < ConversionDecls.size(); i++) - Diag(ConversionDecls[i]->getLocation(), diag::not_conv_function_declared_at); - + Diag(ConversionDecls[i]->getLocation(), + diag::note_conv_function_declared_at); + return OS_Error; } diff --git a/test/Misc/warning-flags.c b/test/Misc/warning-flags.c index c5294cff8f..08edb6f5bc 100644 --- a/test/Misc/warning-flags.c +++ b/test/Misc/warning-flags.c @@ -18,7 +18,7 @@ This test serves two purposes: The list of warnings below should NEVER grow. It should gradually shrink to 0. -CHECK: Warnings without flags (82): +CHECK: Warnings without flags (80): CHECK-NEXT: ext_excess_initializers CHECK-NEXT: ext_excess_initializers_in_char_array_initializer CHECK-NEXT: ext_expected_semi_decl_list @@ -37,7 +37,6 @@ CHECK-NEXT: ext_using_undefined_std CHECK-NEXT: pp_invalid_string_literal CHECK-NEXT: pp_out_of_date_dependency CHECK-NEXT: pp_poisoning_existing_macro -CHECK-NEXT: w_asm_qualifier_ignored CHECK-NEXT: warn_accessor_property_type_mismatch CHECK-NEXT: warn_arcmt_nsalloc_realloc CHECK-NEXT: warn_asm_label_on_auto_decl @@ -64,7 +63,6 @@ CHECK-NEXT: warn_extraneous_char_constant CHECK-NEXT: warn_fe_cc_log_diagnostics_failure CHECK-NEXT: warn_fe_cc_print_header_failure CHECK-NEXT: warn_fe_macro_contains_embedded_newline -CHECK-NEXT: warn_file_asm_volatile CHECK-NEXT: warn_ignoring_ftabstop_value CHECK-NEXT: warn_implements_nscopying CHECK-NEXT: warn_incompatible_qualified_id