From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 88486 invoked by alias); 14 Sep 2018 17:30:51 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 88086 invoked by uid 89); 14 Sep 2018 17:30:31 -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,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=FINAL, formatted, dom_walker, basic_block X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 14 Sep 2018 17:30:30 +0000 Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0422A307CF58 for ; Fri, 14 Sep 2018 17:30:29 +0000 (UTC) Received: from c64.redhat.com (ovpn-112-33.phx2.redhat.com [10.3.112.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id D3DC599592; Fri, 14 Sep 2018 17:30:27 +0000 (UTC) From: David Malcolm To: msebor@redhat.com Cc: gcc-patches@gcc.gnu.org, David Malcolm Subject: [PATCH 3/5] gimple-ssa-sprintf.c: move struct call_info out of the dom_walker subclass Date: Fri, 14 Sep 2018 17:31:00 -0000 Message-Id: <1536949038-34114-4-git-send-email-dmalcolm@redhat.com> In-Reply-To: <1536949038-34114-1-git-send-email-dmalcolm@redhat.com> References: <1536949038-34114-1-git-send-email-dmalcolm@redhat.com> X-IsSubscribed: yes X-SW-Source: 2018-09/txt/msg00770.txt.bz2 gcc/ChangeLog: * gimple-ssa-sprintf.c (struct call_info): New forward decl. (class sprintf_dom_walker): Remove forward decl. (struct sprintf_dom_walker::call_info): Rename to... (struct call_info): ...this. (should_warn_p): Update for move of call_info out of sprintf_dom_walker. (maybe_warn): Likewise. (format_directive): Likewise. (parse_directive): Likewise. (is_call_safe): Likewise. (try_substitute_return_value): Likewise. (try_simplify_call): Likewise. --- gcc/gimple-ssa-sprintf.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/gcc/gimple-ssa-sprintf.c b/gcc/gimple-ssa-sprintf.c index 65c7f92..ab430fe 100644 --- a/gcc/gimple-ssa-sprintf.c +++ b/gcc/gimple-ssa-sprintf.c @@ -116,6 +116,7 @@ const pass_data pass_data_sprintf_length = { static int warn_level; struct format_result; +struct call_info; class sprintf_dom_walker : public dom_walker { @@ -127,7 +128,6 @@ class sprintf_dom_walker : public dom_walker void after_dom_children (basic_block) FINAL OVERRIDE; bool handle_gimple_call (gimple_stmt_iterator *); - struct call_info; bool compute_format_length (call_info &, format_result *); class evrp_range_analyzer evrp_range_analyzer; }; @@ -890,7 +890,7 @@ bytes_remaining (unsigned HOST_WIDE_INT navail, const format_result &res) /* Description of a call to a formatted function. */ -struct sprintf_dom_walker::call_info +struct call_info { /* Function call statement. */ gimple *callstmt; @@ -2333,7 +2333,7 @@ format_plain (const directive &dir, tree, vr_values *) should be diagnosed given the AVAILable space in the destination. */ static bool -should_warn_p (const sprintf_dom_walker::call_info &info, +should_warn_p (const call_info &info, const result_range &avail, const result_range &result) { if (result.max <= avail.min) @@ -2404,7 +2404,7 @@ should_warn_p (const sprintf_dom_walker::call_info &info, static bool maybe_warn (substring_loc &dirloc, location_t argloc, - const sprintf_dom_walker::call_info &info, + const call_info &info, const result_range &avail_range, const result_range &res, const directive &dir) { @@ -2684,7 +2684,7 @@ maybe_warn (substring_loc &dirloc, location_t argloc, in *RES. Return true if the directive has been handled. */ static bool -format_directive (const sprintf_dom_walker::call_info &info, +format_directive (const call_info &info, format_result *res, const directive &dir, class vr_values *vr_values) { @@ -2963,7 +2963,7 @@ format_directive (const sprintf_dom_walker::call_info &info, the directive. */ static size_t -parse_directive (sprintf_dom_walker::call_info &info, +parse_directive (call_info &info, directive &dir, format_result *res, const char *str, unsigned *argno, vr_values *vr_values) @@ -3491,7 +3491,7 @@ get_destination_size (tree dest) of its return values. */ static bool -is_call_safe (const sprintf_dom_walker::call_info &info, +is_call_safe (const call_info &info, const format_result &res, bool under4k, unsigned HOST_WIDE_INT retval[2]) { @@ -3550,7 +3550,7 @@ is_call_safe (const sprintf_dom_walker::call_info &info, static bool try_substitute_return_value (gimple_stmt_iterator *gsi, - const sprintf_dom_walker::call_info &info, + const call_info &info, const format_result &res) { tree lhs = gimple_get_lhs (info.callstmt); @@ -3668,7 +3668,7 @@ try_substitute_return_value (gimple_stmt_iterator *gsi, static bool try_simplify_call (gimple_stmt_iterator *gsi, - const sprintf_dom_walker::call_info &info, + const call_info &info, const format_result &res) { unsigned HOST_WIDE_INT dummy[2]; -- 1.8.5.3