From patchwork Mon Sep 12 08:19:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 1158 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5044:0:0:0:0:0 with SMTP id h4csp1782874wrt; Mon, 12 Sep 2022 01:36:30 -0700 (PDT) X-Google-Smtp-Source: AA6agR74fXBCIsSldaZA4BVvnXLmRHFKUsYKh/g6Bv32RpK1NVIAgsxyloDyYiR/J5bmwL59vsgR X-Received: by 2002:aa7:cdc8:0:b0:451:e570:882c with SMTP id h8-20020aa7cdc8000000b00451e570882cmr1965461edw.334.1662971790540; Mon, 12 Sep 2022 01:36:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662971790; cv=none; d=google.com; s=arc-20160816; b=ua2F1XTgkBrdvWI3/irYfaU5e8AzXVVySZpPfY94CW9RaryD29E6IJlbo0CnhEcuiY 9kcFLphR040wGbCHVSr52mfTx7N8LE8qe25+4tOgWdM6TrrdQsrD1/LFC81y9vKMrCzE /+Ydv5YImjMZio90fJxcKkSaPjvZHXUxfSRwMWYWThJNAhDt1TVFVVCtB5YCL8thYn0G C5MbcU5neHgL9ULnLhuSzw4HSGPVcbZvD98sNPzwIOGTFpBS/fvxMNbXB0zfnBpWP3qf NVO9EoQeDfCG/8G2QK+oF/9XR7QsZdChseBTGd2efnZHjWUP9hHWZOhtB7S8khFRmZLj KVqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:from:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :content-disposition:mime-version:message-id:subject:to:date :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=EI/F3A0kliy7whxQ/O7TIDEDyPCt8GAOW3mq5Hp6XHY=; b=Wca22iwdMp2KNVfucw+ABTC0c097lK5lUZJGqhJaXQi5jdyVrRCuuYXF8PbG57LvR/ 601nGw7SfAjVxDzGDqW0xVSO5NBAVYbqUaltjiBbXqUy7iKmLHHLhIFXARFZRMWUPOCS 8gquFhVz5VAq3LjxrvaO0UAFqZ4g0DFMJPXSWJyWZLLN2BJLzVSMWRddUNno6aWKssW9 xqcCUIBRbi963QXT0KeLHn3ITjSbqlZ20/hSIQlWIZXddOV8nNpkSDTktr76e7hEnE8d ljp0ITfNFE1OWU0SjveYv4F0efpE9wsFlQhYoMIsLQtMGCz8sJzGUAMacuIs9e+nzvhI f6EQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=dxhXUPQl; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id w22-20020a056402129600b0044ebe6f368asi5450990edv.377.2022.09.12.01.36.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Sep 2022 01:36:30 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=dxhXUPQl; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C4877384B122 for ; Mon, 12 Sep 2022 08:28:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C4877384B122 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662971303; bh=EI/F3A0kliy7whxQ/O7TIDEDyPCt8GAOW3mq5Hp6XHY=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=dxhXUPQlYkHFItcc223G6H3JIqUF8y6ue1Tr54kc7BCxwk2cYzBnGyTEBcNPbXeM3 aSK4vak83Jf7erLfX9qva2x2k95S7FPEfBGW4+gcO89T+UKB1cZUZA7kYTctSwNz5w YEAmszWF6Ts+WTBsW4aUvwxiYPkO6c8IcCyBAarg= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org 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 Received: by mail-wm1-x332.google.com with SMTP id i203-20020a1c3bd4000000b003b3df9a5ecbso5713048wma.1 for ; Mon, 12 Sep 2022 01:19:40 -0700 (PDT) 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-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 To: gcc-patches@gcc.gnu.org Subject: [Ada] Special-case printing of SPARK_Mode in error messages Message-ID: <20220912081938.GA1513071@poulhies-Precision-5550> MIME-Version: 1.0 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: =?utf-8?q?Marc_Poulhi=C3=A8s_via_Gcc-patches?= From: =?utf-8?q?Marc_Poulhi=C3=A8s?= Reply-To: Marc =?iso-8859-1?q?Poulhi=E8s?= Cc: Piotr Trojanek Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1743752308498981189?= X-GMAIL-MSGID: =?utf-8?q?1743752308498981189?= 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. 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