From: Aaron Ballman Date: Mon, 23 Dec 2013 15:23:11 +0000 (+0000) Subject: Consolidating some mode attribute diagnostics. No functional changes intended. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f2f628a1dbe5f7de74c03993d838916c5eab3ec9;p=clang Consolidating some mode attribute diagnostics. No functional changes intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197911 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index b92544fc7c..838ce63542 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -2354,8 +2354,7 @@ def warn_attribute_protected_visibility : InGroup>; def err_mismatched_visibility: Error<"visibility does not match previous declaration">; def note_previous_attribute : Note<"previous attribute is here">; -def err_unknown_machine_mode : Error<"unknown machine mode %0">; -def err_unsupported_machine_mode : Error<"unsupported machine mode %0">; +def err_machine_mode : Error<"%select{unknown|unsupported}0 machine mode %1">; def err_mode_not_primitive : Error< "mode attribute only supported for integer and floating-point types">; def err_mode_wrong_type : Error< diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index a0421aa0d0..56df48230c 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -2989,7 +2989,7 @@ static void handleModeAttr(Sema &S, Decl *D, const AttributeList &Attr) { // FIXME: Make sure floating-point mappings are accurate // FIXME: Support XF and TF types if (!DestWidth) { - S.Diag(Attr.getLoc(), diag::err_unknown_machine_mode) << Name; + S.Diag(Attr.getLoc(), diag::err_machine_mode) << 0 /*Unknown*/ << Name; return; } @@ -3002,7 +3002,7 @@ static void handleModeAttr(Sema &S, Decl *D, const AttributeList &Attr) { NewTy = S.Context.getRealTypeForBitwidth(DestWidth); if (NewTy.isNull()) { - S.Diag(Attr.getLoc(), diag::err_unsupported_machine_mode) << Name; + S.Diag(Attr.getLoc(), diag::err_machine_mode) << 1 /*Unsupported*/ << Name; return; }