From patchwork Thu Sep 29 10:41:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 1533 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f2ce:0:0:0:0:0 with SMTP id d14csp617434wrp; Thu, 29 Sep 2022 03:45:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4TPmCytu/DSvmqoo34vHFS+BqrmxvRLHKbLgaLZ9ESpZU1yhaa8bZdNsOcrCxKkxh13MVS X-Received: by 2002:aa7:c7d3:0:b0:44f:2776:31b with SMTP id o19-20020aa7c7d3000000b0044f2776031bmr2751780eds.251.1664448308628; Thu, 29 Sep 2022 03:45:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664448308; cv=none; d=google.com; s=arc-20160816; b=vXC5yNOBySKh5SkyZ8KiTlQUUBdqyYMzs8OKwmEKwJikHzGQdj+3qLKAo+oxNTohze 3hLFOH7etMbC885tUMz4OEpD683kbcUjibgpMib9MUlMsqVEPOpnEteyK6LO1Bp8Jipx exSUrUjhVCGVdBsWrl3uMIBa30obWVyh46xraJwb3zlF6OTcJ4C0p4uHiVPgqjzbCe38 jUkCqfn1zjQfA1XZR7elo9mwRC5KCvlGpJJJI51U7KrhV3Cc1FKS7bE2OGDWba/Iecbk ACQPaj9x/uLiUStR1YIzmHFz69ZXttwFuTUAyjWFJvI4+hm6AoyJRFtMeoXKE0Tm1ebj lOUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:mime-version :user-agent:message-id:in-reply-to:date:references:subject :mail-followup-to:to:dmarc-filter:delivered-to:dkim-signature :dkim-filter; bh=m1wwkDbYkNN4EvaDugejiWNsopzCPeB66puioB9XT2Y=; b=IMoVRz8rqNt1ARUr53a8YfHXqb+6JcqYOveuns706NYMyVYyaUkOdXIWQuwHNsFYWp 37yPGmfic77aLZ7tpFZgz1QJyKAWp0JUGRXAnDwrkjXXA22rILt6GtnU7VFIAQizZr94 thYTlIBsk1Nf9d9u0lbasvoJTyaiYFJLFmUX9suIDwU2U417acazfTDNElamNBIIuQ58 KvkPRPUarSRFbW0BHzRNboktUc9F5MqQghxD/vQQBu7z/DWyrZB6yJwDp+gb9lhBnTQ4 HwBwnTw/4+3Ndk+iWf6shLJ/exoy/roktRM8VvwJOWeI4F/Ljd8WF3dim1eFQyg/JrSp ypBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=jzMrbIS9; 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 z13-20020a056402274d00b00456c837e3d0si10448030edd.77.2022.09.29.03.45.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Sep 2022 03:45:08 -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=jzMrbIS9; 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 05991385117F for ; Thu, 29 Sep 2022 10:42:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 05991385117F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664448166; bh=m1wwkDbYkNN4EvaDugejiWNsopzCPeB66puioB9XT2Y=; h=To:Subject:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=jzMrbIS9OjarIeW41JGpQFpZOosDbWtLIF4iMyhXi28Pk8r/sJUvpoB7Ee6wjzz7F kj2Bci3opI9HxDUIDQsTBYmJcQEJK9l2x4yYjTKSXW2D99xJTIrSNuQv6q4kC+DhZN NuTPk6OuCaHDLBhO4OBw9wwcN5F66470bixKcBR8= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id E6C843856972 for ; Thu, 29 Sep 2022 10:41:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E6C843856972 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5360415BF for ; Thu, 29 Sep 2022 03:42:05 -0700 (PDT) Received: from localhost (e121540-lin.manchester.arm.com [10.32.98.62]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4D74B3F73B for ; Thu, 29 Sep 2022 03:41:58 -0700 (PDT) To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: [PATCH 12/17] aarch64: Avoid std::string in static data References: Date: Thu, 29 Sep 2022 11:41:57 +0100 In-Reply-To: (Richard Sandiford's message of "Thu, 29 Sep 2022 11:39:11 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-Spam-Status: No, score=-45.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_NONE, SPF_NONE, TXREP 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: Richard Sandiford via Gcc-patches From: Richard Sandiford Reply-To: Richard Sandiford 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?1745300549629879630?= X-GMAIL-MSGID: =?utf-8?q?1745300549629879630?= Just a minor patch to avoid having to construct std::strings in static data. gcc/ * common/config/aarch64/aarch64-common.cc (processor_name_to_arch) (arch_to_arch_name): Use const char * instead of std::string. --- gcc/common/config/aarch64/aarch64-common.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/common/config/aarch64/aarch64-common.cc b/gcc/common/config/aarch64/aarch64-common.cc index 85fb5f26d99..8760e092064 100644 --- a/gcc/common/config/aarch64/aarch64-common.cc +++ b/gcc/common/config/aarch64/aarch64-common.cc @@ -147,7 +147,7 @@ static const struct aarch64_option_extension all_extensions[] = struct processor_name_to_arch { - const std::string processor_name; + const char *const processor_name; const enum aarch64_arch arch; const uint64_t flags; }; @@ -155,7 +155,7 @@ struct processor_name_to_arch struct arch_to_arch_name { const enum aarch64_arch arch; - const std::string arch_name; + const char *const arch_name; const uint64_t flags; };