From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 105629 invoked by alias); 22 Jun 2015 18:57:18 -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 105617 invoked by uid 89); 22 Jun 2015 18:57:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-HELO: mail-ob0-f176.google.com Received: from mail-ob0-f176.google.com (HELO mail-ob0-f176.google.com) (209.85.214.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 22 Jun 2015 18:57:17 +0000 Received: by obpn3 with SMTP id n3so36403578obp.0 for ; Mon, 22 Jun 2015 11:57:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=iRGsEYxhSI39DelTL6lHfWgg+CqjG1LCl0LCJPm6ebo=; b=gjygLbLY/phb5Mgk3Ydkd4/P2skPI6FOgPiOSu4Ya8xwYMcK2lDIi+mb2bQgS32m2Q Tm66j/znpmvZVBBp1F5EW4semLKogIy7zr+FU4Z/IdPoUK5JHibZfDrJNXoY3Lt55mSZ edcmyrnmNJzp3WtZlw74wo/SmfIlhxQCFiikJCpirbFRMh+hIXYYt8Z2iubG9x7HTFYC +/ZbGWeCCVRHw4L+Ul+KX0Oq0+C7yftA291k7h4T+aCEA6zZvpkwZdq50Yya7wBMObBi GbR1zlfSqp8T1X7VMm9VWrV2XhuMbgnGlTEBbPOf8/2HO4lzxZVvlbimQPs9rKBuXEbz bXIg== X-Gm-Message-State: ALoCoQlIbtEpA3P3SdeYdjAgciasrgUgiPyvLQGaWIcAPLVf5Gt+2UWcKi7PZWoxt1OEghYOPYyH X-Received: by 10.60.69.7 with SMTP id a7mr25796105oeu.14.1434999434799; Mon, 22 Jun 2015 11:57:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.96.167 with HTTP; Mon, 22 Jun 2015 11:56:55 -0700 (PDT) In-Reply-To: <5588460B.5050609@redhat.com> References: <1433871067-30661-1-git-send-email-patrick@parcs.ath.cx> <5588460B.5050609@redhat.com> From: Patrick Palka Date: Mon, 22 Jun 2015 19:03:00 -0000 Message-ID: Subject: Re: [PATCH 1/3] Refactor entry point to -Wmisleading-indentation To: Jeff Law Cc: GCC Patches , David Malcolm Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2015-06/txt/msg01496.txt.bz2 On Mon, Jun 22, 2015 at 1:29 PM, Jeff Law wrote: > On 06/09/2015 11:31 AM, Patrick Palka wrote: >> >> This patch refactors the entry point of -Wmisleading-indentation from: >> >> void >> warn_for_misleading_indentation (location_t guard_loc, >> location_t body_loc, >> location_t next_stmt_loc, >> enum cpp_ttype next_tok_type, >> const char *guard_kind); >> >> to >> >> struct token_indent_info >> { >> location_t location; >> cpp_ttype type; >> rid keyword; >> }; >> >> void >> warn_for_misleading_indentation (const token_indent_info &guard_tinfo, >> const token_indent_info &body_tinfo, >> const token_indent_info &next_tinfo); >> >> The purpose of this refactoring is to expose more information to the >> -Wmisleading-indentation implementation to allow for more advanced >> heuristics and for better coverage. >> >> (I decided to keep the usage of const references because nobody >> seems to mind. Also I added a new header file, c-indentation.h.) >> >> gcc/c-family/ChangeLog: >> >> * c-indentation.h (struct token_indent_info): Define. >> (get_token_indent_info): Define. >> (warn_for_misleading_information): Declare. >> * c-common.h (warn_for_misleading_information): Remove. >> * c-identation.c (warn_for_misleading_indentation): >> Change declaration to take three token_indent_infos. Adjust >> accordingly. >> * c-identation.c (should_warn_for_misleading_indentation): >> Likewise. Bail out early if the body is a compound statement. >> (guard_tinfo_to_string): Define. >> >> gcc/c/ChangeLog: >> >> * c-parser.c (c_parser_if_body): Take token_indent_info >> argument. Call warn_for_misleading_indentation even when the >> body is a semicolon. Extract token_indent_infos corresponding >> to the guard, body and next tokens. Adjust call to >> warn_for_misleading_indentation accordingly. >> (c_parser_else_body): Likewise. >> (c_parser_if_statement): Likewise. >> (c_parser_while_statement): Likewise. >> (c_parser_for_statement): Likewise. >> >> gcc/cp/ChangeLog: >> >> * parser.c (cp_parser_selection_statement): Move handling of >> semicolon body to ... >> (cp_parser_implicitly_scoped_statement): .. here. Call >> warn_for_misleading_indentation even when the body is a >> semicolon. Extract token_indent_infos corresponding to the >> guard, body and next tokens. Adjust call to >> warn_for_misleading_indentation accordingly. Take >> token_indent_info argument. >> (cp_parser_already_scoped_statement): Likewise. >> (cp_parser_selection_statement, cp_parser_iteration_statement): >> Extract a token_indent_info corresponding to the guard token. > > The only question in my mind is bootstrap & regression testing. From > reading the thread for the earlier version of this patch I got the > impression you had bootstrapped and regression tested earlier versions. > > If you could confirm that you've bootstrapped and regression tested this > version it'd be appreciated. You can do it on the individual patches or the > set as a whole. I think I successfully bootstrapped + regtested this exact version but I'm not sure. I was going to do so again before committing anyway. I will fire off a build tonight and confirm the results tomorrow. > > Jeff > >