From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by sourceware.org (Postfix) with ESMTPS id 7662F38515D4 for ; Mon, 12 Sep 2022 08:19:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7662F38515D4 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-wm1-x332.google.com with SMTP id i203-20020a1c3bd4000000b003b3df9a5ecbso5713048wma.1 for ; Mon, 12 Sep 2022 01:19:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date; bh=EI/F3A0kliy7whxQ/O7TIDEDyPCt8GAOW3mq5Hp6XHY=; b=Zz1OuqwCKul0cxw/5ZS82zczfop2KIY4NmYh2+YRjPmIWwD3kUfMYPZqg+eT1SFq8k sdGwPom7KMx8CR8+6h3RjJ8HwqE9gX7cPZonyk/86WcAj3DkKeRIcDjljIkZxcE891fF qdi9jsFtGP7RT24FBbSyT6CKqUY/jc8m9k27+2eJX2btFyY6fkxzH4I4MudpiGi0qbR7 6zNF+rg61C2BULB4L9Ku2v2pYnaSBvpJ+DiqDiC8Ub3jTQFr32D7eTuCU1xEGDI/XkxO 8GU0YEhP1Pe6q9aHVwhYOa5tbq+ayUHLidIz0rGQuLUs8gNno6x+D49zG/Ng4LHRvbwA srPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date; bh=EI/F3A0kliy7whxQ/O7TIDEDyPCt8GAOW3mq5Hp6XHY=; b=f6F0Z3Pu6RGYEKMw8GjXVYLrbozUDTztftIljR77rC0ddCkFXgWahs+PjL9ALSR58d 0iNa0galSY9xJNjr+AbjKoCqKVpjkuo1gJeJ9QDDPyDbSSpH0yLIGGfOtYR5ltam9dYs T0yeuy2IvxH9KKn49kcZFBMyjecR5qxT3lC9pG42+qLVlKKmc3AQdQJezDhyzkMvId52 Xx7T1qTk+CeMgg58ney+NiX2jncIv0EHEVxCtnU1a/sV/Uixtxc4mR0MQaFilBnIWIl1 Ow2et+KHV/lhiovBI6kr8UC1tbYBs/yhppLe+oVMikyufgk9NaHNjZYQoDdycTgGSAg1 RkSw== X-Gm-Message-State: ACgBeo0td28U7VYYx71JIwwwnnH7H/nK/nx/LD/G3+UgkHKbiXwRs7zm 0WDVZY2GKeMwAS+VLriaTwZni7J0dcXowg== X-Google-Smtp-Source: AA6agR5BpsmtArHPKh3OCnNSjSorVfpHd/E34EMZGfmZklR26f88Hy4fhnzQevLgyCtUjpkacURHAg== X-Received: by 2002:a7b:c38e:0:b0:3b4:84ae:bc4a with SMTP id s14-20020a7bc38e000000b003b484aebc4amr3431486wmj.97.1662970779365; Mon, 12 Sep 2022 01:19:39 -0700 (PDT) Received: from poulhies-Precision-5550 (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id l1-20020a05600002a100b00228d183f9c2sm6810117wry.89.2022.09.12.01.19.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Sep 2022 01:19:38 -0700 (PDT) Date: Mon, 12 Sep 2022 10:19:38 +0200 From: Marc =?iso-8859-1?Q?Poulhi=E8s?= To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [Ada] Special-case printing of SPARK_Mode in error messages Message-ID: <20220912081938.GA1513071@poulhies-Precision-5550> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="3V7upXqbjpZ4EhLz" Content-Disposition: inline X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --3V7upXqbjpZ4EhLz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline For error messages with inserted names that include acronyms like SPARK or CPP, we want to preserve the casing. The list of special-cased named is currently the same as in gnatpp. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * erroutc.adb (Set_Msg_Insertion_Name): Special-case printing with acronyms. --3V7upXqbjpZ4EhLz Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="patch.diff" diff --git a/gcc/ada/erroutc.adb b/gcc/ada/erroutc.adb --- a/gcc/ada/erroutc.adb +++ b/gcc/ada/erroutc.adb @@ -1317,8 +1317,8 @@ package body Erroutc is Name_Len := Name_Len - 1; end if; - -- If operator name or character literal name, just print it as is - -- Also print as is if it ends in a right paren (case of x'val(nnn)) + -- If operator name or character literal name, just print it as is. + -- Also print as is if it ends in a right paren (case of x'val(nnn)). if Name_Buffer (1) = '"' or else Name_Buffer (1) = ''' @@ -1534,6 +1534,32 @@ package body Erroutc is elsif Text = "_TYPE_INVARIANT" then Set_Msg_Str ("TYPE_INVARIANT'CLASS"); + -- Preserve casing for names that include acronyms + + elsif Text = "Cpp_Class" then + Set_Msg_Str ("CPP_Class"); + + elsif Text = "Cpp_Constructor" then + Set_Msg_Str ("CPP_Constructor"); + + elsif Text = "Cpp_Virtual" then + Set_Msg_Str ("CPP_Virtual"); + + elsif Text = "Cpp_Vtable" then + Set_Msg_Str ("CPP_Vtable"); + + elsif Text = "Persistent_Bss" then + Set_Msg_Str ("Persistent_BSS"); + + elsif Text = "Spark_Mode" then + Set_Msg_Str ("SPARK_Mode"); + + elsif Text = "Use_Vads_Size" then + Set_Msg_Str ("Use_VADS_Size"); + + elsif Text = "Vads_Size" then + Set_Msg_Str ("VADS_size"); + -- Normal case with no replacement else --3V7upXqbjpZ4EhLz--