From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 51190 invoked by alias); 12 Jan 2017 15:29:46 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 51163 invoked by uid 89); 12 Jan 2017 15:29:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=no version=3.3.2 spammy=H*f:sk:12986d6, H*i:sk:12986d6, Hx-languages-length:1019 X-Spam-User: qpsmtpd, 2 recipients X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 12 Jan 2017 15:29:43 +0000 Received: by simark.ca (Postfix, from userid 33) id 76DED1E80F; Thu, 12 Jan 2017 10:29:41 -0500 (EST) To: Pedro Alves Subject: Re: [PATCH 1/8] Refactor disassembly code X-PHP-Originating-Script: 33:rcube.php MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 12 Jan 2017 15:29:00 -0000 From: Simon Marchi Cc: Yao Qi , binutils@sourceware.org, gdb-patches@sourceware.org In-Reply-To: <12986d60-ddb1-c5e3-4c6a-4fc3d6816bed@redhat.com> References: <1484051178-16013-1-git-send-email-yao.qi@linaro.org> <1484051178-16013-2-git-send-email-yao.qi@linaro.org> <87fd30a805c696a677c56289e7b7b511@polymtl.ca> <20170112121909.GC31406@E107787-LIN> <12986d60-ddb1-c5e3-4c6a-4fc3d6816bed@redhat.com> Message-ID: <2e668735a1687450af4f96598c231ad1@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.2.3 X-IsSubscribed: yes X-SW-Source: 2017-01/txt/msg00231.txt.bz2 On 2017-01-12 07:36, Pedro Alves wrote: > I had written it that way originally because a default parameter forces > the compiler to pass down an extra parameter (adding to register > pressure) > to all call sites, when only a few places actually need the extra > output parameter. It's like a double-optional -- i.e., the > parameter can be NULL, so merging doesn't simplify that much, > given that the version with the single argument does not need to > check the parameter. I.e., one function can be built on top of the > other. I see it as a different case from when a parameter is optional > such that the passed in value always need to be taken in consideration > by the method implementation, like when passing a flags argument, with > the default being some flag value (or zero). > > But this is not really performance critical code, so if you > want to change it, I don't mind. Ok, I hadn't gone that far in my reflexion, I thought it was simply a convenience thing.