From patchwork Tue Dec 18 22:40:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 30751 Received: (qmail 71887 invoked by alias); 18 Dec 2018 22:40:29 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 71784 invoked by uid 89); 18 Dec 2018 22:40:28 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1385 X-HELO: mail-wm1-f47.google.com Received: from mail-wm1-f47.google.com (HELO mail-wm1-f47.google.com) (209.85.128.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 18 Dec 2018 22:40:27 +0000 Received: by mail-wm1-f47.google.com with SMTP id f81so4408544wmd.4 for ; Tue, 18 Dec 2018 14:40:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=dY1fceUAXJF4sXEFa1uVnds13pzdtyHrMaOn5SvHOYo=; b=fQGhZCtclZhng5VyNjU5Wlenycqt7qszLbyBI44bgVzO0YIZYyPmXwueNe7KXT6EoX 45odOeyYWCrIHGPKhtp3Nz752Lco6RFcHuMiut930el/qp5B1jZhQTzv4XWujMwFi6fy FnsGsuus0fLoUjbZ3S2INNuPCPHQ9w/f5UCCHf8lmZKESgho6+hIx5foGLd3QICbYpBo DYDAjs6AkzQQoYzpYHhYLfjglAYHjSshmpZLC4rRn0HHNwTFTQNr/ZwpYSEG63cNS7Tc k8fNdxnjpDh9aMW+NnxQlH2XzA3VCWmflNqhLW8d5N5o3BFSOuRLSTfmB9K8cMSgH6MX vQQQ== Return-Path: Received: from localhost (host86-156-236-210.range86-156.btcentralplus.com. [86.156.236.210]) by smtp.gmail.com with ESMTPSA id v19sm6891910wrd.46.2018.12.18.14.40.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 Dec 2018 14:40:23 -0800 (PST) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Tom Tromey , Simon Marchi , jimw@sifive.com, jhb@FreeBSD.org, palmer@sifive.com, Andrew Burgess Subject: [PATCHv2 2/4] gdb: Resolve 49 reduce/reduce conflicts in c-exp.y Date: Tue, 18 Dec 2018 22:40:11 +0000 Message-Id: <6ea141fbd952fef1a7228c08fb4eeb98f1fa5370.1545172667.git.andrew.burgess@embecosm.com> In-Reply-To: References: In-Reply-To: References: <87tvjd4e54.fsf@tromey.com> X-IsSubscribed: yes This commit splits the ptr_operator rule in c-exp.y in two, resolving 49 reduce/reduce conflicts in the process. There should be no user visible change after this commit. There are still 42 shift/reduce and 4 reduce/reduce conflicts remaining in c-exp.y (using GNU bison 3.0.4). gdb/ChangeLog: * c-exp.y (base_ptr_operator): New rule, with non-recursive content taken from... (ptr_operator): ...here, leaving just the recursion here. --- gdb/ChangeLog | 6 ++++++ gdb/c-exp.y | 18 ++++++++---------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/gdb/c-exp.y b/gdb/c-exp.y index 447ac78eee1..d2198b1fdf7 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y @@ -1136,21 +1136,19 @@ const_or_volatile_or_space_identifier: | ; -ptr_operator: - ptr_operator '*' +base_ptr_operator + : '*' { insert_type (tp_pointer); } - const_or_volatile_or_space_identifier - | '*' - { insert_type (tp_pointer); } - const_or_volatile_or_space_identifier + const_or_volatile_or_space_identifier | '&' { insert_type (tp_reference); } - | '&' ptr_operator - { insert_type (tp_reference); } | ANDAND { insert_type (tp_rvalue_reference); } - | ANDAND ptr_operator - { insert_type (tp_rvalue_reference); } + ; + +ptr_operator + : base_ptr_operator + | base_ptr_operator base_ptr_operator ; ptr_operator_ts: ptr_operator