From patchwork Tue Oct 26 15:00:54 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 69257 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id A2AD1B70CD for ; Wed, 27 Oct 2010 02:01:18 +1100 (EST) Received: (qmail 25649 invoked by alias); 26 Oct 2010 15:01:07 -0000 Received: (qmail 25529 invoked by uid 22791); 26 Oct 2010 15:01:04 -0000 X-SWARE-Spam-Status: No, hits=-6.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, TW_FN, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 26 Oct 2010 15:00:57 +0000 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o9QF0toT006455 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 26 Oct 2010 11:00:55 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o9QF0t9a031593 for ; Tue, 26 Oct 2010 11:00:55 -0400 Message-ID: <4CC6ED26.20402@redhat.com> Date: Tue, 26 Oct 2010 11:00:54 -0400 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.14) Gecko/20101020 Lightning/1.0b1 Shredder/3.0.10pre MIME-Version: 1.0 To: gcc-patches List Subject: Some small C++ cleanup PATCHes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org A few minor things I ran across while working on something else: 1) stabilize_expr didn't know about xvalues. I think this has no practical impact, given the current users of stabilize_expr--when it is called by stabilize_call, any reference arguments to the call have REFERENCE_TYPE rather than the dereferenced type--but I thought that it might be good to fix it for potential future users. 2) build_over_call was unnecessarily duplicating the logic for getting the 'this' argument that was previously used to set up argarray. 3) finish_function doesn't need special handling for function_depth > 1 anymore; the comment talks about cxx_pop_function_context wanting to use current_function_decl, but that function no longer exists. Tested x86_64-pc-linux-gnu, applied to trunk. commit 53c671d19db2b1e61843fd87d9859a213a3f1353 Author: Jason Merrill Date: Sat Oct 23 10:32:30 2010 -0400 * decl.c (finish_function): Don't look at function_depth. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 1409330..e513bc0 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -12660,7 +12660,6 @@ finish_function (int flags) tree fndecl = current_function_decl; tree fntype, ctype = NULL_TREE; int inclass_inline = (flags & 2) != 0; - int nested; /* When we get some parse errors, we can end up without a current_function_decl, so cope. */ @@ -12672,7 +12671,6 @@ finish_function (int flags) record_key_method_defined (fndecl); - nested = function_depth > 1; fntype = TREE_TYPE (fndecl); /* TREE_READONLY (fndecl) = 1; @@ -12883,11 +12881,7 @@ finish_function (int flags) --function_depth; /* Clean up. */ - if (! nested) - /* Let the error reporting routines know that we're outside a - function. For a nested function, this value is used in - cxx_pop_function_context and then reset via pop_function_context. */ - current_function_decl = NULL_TREE; + current_function_decl = NULL_TREE; defer_mark_used_calls = false; if (deferred_mark_used_calls)