From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by sourceware.org (Postfix) with ESMTPS id B2049385E017 for ; Mon, 30 May 2022 15:09:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B2049385E017 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f44.google.com with SMTP id k16so10710343wrg.7 for ; Mon, 30 May 2022 08:09:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:from:to:references:in-reply-to :content-transfer-encoding; bh=RpLkEqDgqw88/+dBm9p7og4+jojtbdgJgS0Eof245pM=; b=AJJ2vigdFQGHMsqaZFCUbqgKOm9LcsCwzDz2LtCr1ttASwQgCdjGXKaHEGwJ/iHIDD vs3NLTTLBSK67+L0s32692hUKE/ST7/ObA/E/ArTtDnLqyQ8LKZGLzSpp6IFw76sSCoT 0BGo3h1S1lFSXt0FiT7dCbDk8yFEHGRNsBpfSLOMYDSRkmcOuSZ+Dss+iNK9DVXj96Aw sRAJcL4LRFesB9Tz4MDP1sOSUs7Qfo47fVuzIJd08vVs/X1EeFpOQiKGhUrhxpenp031 MrP3wgyQMgDicqPk0AGc0J/LirBpNi0vl0QWDUUXctt2ZmoKXzX78Hd4VG+Oy2DhZRfd FUpA== X-Gm-Message-State: AOAM532pEjw8/PZFjNcOhq1sHcd7K53spX+hJ9KCKuy08fJlJ5y0/2vB ZhyN7RjledN+0DLKBYpIEOEqhswuTMI= X-Google-Smtp-Source: ABdhPJx/qligOQDRx6X+NnahsFsYi1vey/ov5FtsYMmDU6cy10BYBWkoPyzEsSfqfUnbDO6rukJubA== X-Received: by 2002:adf:dec1:0:b0:210:1e78:21f9 with SMTP id i1-20020adfdec1000000b002101e7821f9mr13081644wrn.220.1653923362908; Mon, 30 May 2022 08:09:22 -0700 (PDT) Received: from ?IPV6:2001:8a0:f924:2600:209d:85e2:409e:8726? ([2001:8a0:f924:2600:209d:85e2:409e:8726]) by smtp.gmail.com with ESMTPSA id i7-20020a5d5847000000b002101ed6e70fsm8508492wrf.37.2022.05.30.08.09.19 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 May 2022 08:09:19 -0700 (PDT) Message-ID: <7a138daf-9ed8-574e-e381-b59b60b84046@palves.net> Date: Mon, 30 May 2022 16:09:18 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH 2/7] Eliminate the two-level data structures behind location_specs Content-Language: en-US From: Pedro Alves To: gdb-patches@sourceware.org References: <20220527180248.2990723-1-pedro@palves.net> <20220527180248.2990723-3-pedro@palves.net> In-Reply-To: <20220527180248.2990723-3-pedro@palves.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, 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: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 May 2022 15:09:26 -0000 On 2022-05-27 19:02, Pedro Alves wrote: > + std::unique_ptr els > + (new explicit_location_spec ()); > + els->source_filename > + = xstrdup (symtab_to_filename_for_display (sal2.symtab)); > + els->line_offset.offset = b->loc->line_number; > + els->line_offset.sign = LINE_OFFSET_NONE; > + > + b->locspec.reset (els.release ()); I realized after sending the patch that even though els's type is std::unique_ptr, and b->locspec is a std::unique_ptr, we can do a move instead of the reset/release above, like so: b->locspec = std::move (els); I've made that change locally, here and in a couple other spots that could do it.