From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 43658 invoked by alias); 10 Dec 2017 21:23:45 -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 43639 invoked by uid 89); 10 Dec 2017 21:23:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.5 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=Hx-languages-length:2200 X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 10 Dec 2017 21:23:43 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id vBALNaoo017266 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 10 Dec 2017 16:23:41 -0500 Received: by simark.ca (Postfix, from userid 112) id C95121E586; Sun, 10 Dec 2017 16:23:36 -0500 (EST) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 0BB861E02D; Sun, 10 Dec 2017 16:23:25 -0500 (EST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 10 Dec 2017 21:23:00 -0000 From: Simon Marchi To: Tom Tromey Cc: Simon Marchi , gdb-patches@sourceware.org Subject: Re: [RFA] C++-ify parser_state In-Reply-To: <87indgtsy1.fsf@tromey.com> References: <20171126174047.23943-1-tom@tromey.com> <82650820-b9f1-c45f-2243-89b47ec00e59@ericsson.com> <878teov3zz.fsf@tromey.com> <737f8c6ee396927a68c00c74610c8cac@polymtl.ca> <87indgtsy1.fsf@tromey.com> Message-ID: <618519a01ec8df27ea6bdebbcc373bb4@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.2 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Sun, 10 Dec 2017 21:23:36 +0000 X-IsSubscribed: yes X-SW-Source: 2017-12/txt/msg00221.txt.bz2 On 2017-12-08 23:40, Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi writes: > > Simon> Oops, I realized I only answered half the question. I added a > second > Simon> patch on top. > > No problem. How's this? LGTM, with some nits. > commit ee14e980825b5eabd6753a52c75b73dda0762bf2 > Author: Tom Tromey > Date: Wed Nov 22 21:45:53 2017 -0700 > > C++-ify parser_state > > This mildly C++-ifies parser_state and stap_parse_info -- just > enough > to remove some cleanups. > > This version includes the changes implemented by Simon. > > Regression tested by the buildbot. > > ChangeLog > 2017-11-26 Tom Tromey > Simon Marchi > > * stap-probe.h (struct stap_parse_info): Add constructor, > destructor. > * stap-probe.c (stap_parse_argument): Update. > * rust-exp.y (rust_lex_tests): Update. > * parser-defs.h (struct parser_state): Add constructor, > destructor, release method. > (null_post_parser): Change type. > : Change type to expression_up. This last line should be before "null_post_parser" I think. > (initialize_expout, reallocate_expout): Remove. > * parse.c (parser_state::parser_state): Rename from > initialize_expout. > (parser_state::release): Rename from reallocate_expout. write_exp_elt, increase_expout_size should be mentioned. > (parse_exp_in_context_1): Update. > (null_post_parser): Change type of "exp". > * dtrace-probe.c (dtrace_probe::build_arg_exprs): Update. > * ada-lang.c (resolve, resolve_subexp) > (replace_operator_with_call): Change type of "expp". > * language.h (struct language_defn) : > Change type > of "expp". ... > --- a/gdb/stap-probe.h > +++ b/gdb/stap-probe.h > @@ -28,6 +28,22 @@ > > struct stap_parse_info > { > + stap_parse_info (const char *arg_, struct type *arg_type_, > + size_t initial_size, const struct language_defn *lang, > + struct gdbarch *gdbarch) > + : arg (arg_), > + pstate (initial_size, lang, gdbarch), > + saved_arg (arg_), > + arg_type (arg_type_), > + gdbarch (gdbarch), > + inside_paren_p (0) > + { > + } > + > + ~stap_parse_info () = default; This can be removed. Thanks, Simon