From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15335 invoked by alias); 14 Jul 2014 08:42:04 -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 15324 invoked by uid 89); 14 Jul 2014 08:42:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: atrey.karlin.mff.cuni.cz Received: from atrey.karlin.mff.cuni.cz (HELO atrey.karlin.mff.cuni.cz) (195.113.26.193) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 14 Jul 2014 08:42:01 +0000 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 4018) id 9061C81C37; Mon, 14 Jul 2014 10:41:58 +0200 (CEST) Date: Mon, 14 Jul 2014 08:42:00 -0000 From: Jan Hubicka To: Jan Hubicka Cc: gcc-patches@gcc.gnu.org, jason@redhat.com, rguenther@suse.de, mikestump@comcast.net, stanshebs@earthlink.net Subject: Re: Move DECL_ARGUMENTS into tree_function_decl Message-ID: <20140714084158.GA3663@atrey.karlin.mff.cuni.cz> References: <20140625065108.GB27803@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140625065108.GB27803@kam.mff.cuni.cz> User-Agent: Mutt/1.5.20 (2009-06-14) X-IsSubscribed: yes X-SW-Source: 2014-07/txt/msg00952.txt.bz2 > Hi, > this patch moves DECL_ARGUMENTS into FUNCTION_DECL. For this I needed to solve > reuse in C++ and objC frontends. In C++ I think I actually run out of places > to use for TEMPLATE_DECL (well, perhaps DECL_ATTRIBUTES but I would definitely > run out of pointers fro DECL_RESULT I want to move next) so I decided to go > ahead and allow lang frontends to make their own structures for their own decls > as we currently support for exceptional trees. > > This allows me to make TEMPLATE_DECL decl_common and save there quite few pointers > that go with decl_non_common (rtl, assembler name, symtab etc). > > I think other DECL_NON_COMMON declarations in C++ FE can now be put on the diet > too. > > In objc I simply used DECL_SIZE. I have noticed that the accesors was never > updated for type checking and added these (sincerely hope I won't be asked to > fix bugs found by those at daily basis). > > Similarly objc can use some custom layouts for the decls, but I did not do it. > > THe added tree_size langhook is there only becuase I changed generic code to > die when lang does not handle its decls correctly. > > Ada/C++/Fortran do not add its own decl trees. > > Honza > > * tree.c (tree_code_size): Add TRANSLATION_UNIT_DECL, > NAMESPACE_DECL, IMPORTED_DECL and NAMELIST_DECL; > call langhook for unknown declaration. > (find_decls_types_r): Do not walk DECL_ARGUMENT_FLD. > * tree.h (DECL_ARGUMENTS): Update. > * print-tree.c (print_node): Update. > * tree-core.h (tree_decl_non_common): Remove arguments. > (tree_function_decl): Add arguments. > > * class.c (build_clone): Do not clear assembler names of > templates. > * decl.c (cp_tree_node_structure): Add TEMPLATE_DECL. > * cp-objcp-common.c (cp_tree_size): Add TEMPLATE_DECL > as a special case return sizeof (struct tree_decl_non_common) > for other decls. > (cp_common_init_ts): Do not initialize NAMESPACE_DECL; > initialize TEMPLATE_DECL as MARK_TS_DECL_COMMON. > * cp/cp-tree.h (tree_template_decl): New structure. > (cp_tree_node_structure_enum): Add TS_CP_TEMPLATE_DECL. > (union cp_lang_tree_node): Add template_decl. > (DECL_TEMPLATE_PARMS, DECL_TEMPLATE_RESULT): Update. > > * lto/lto.c (mentions_vars_p_decl_non_common): Skip > DECL_ARGUMENT_FLD. > mentions_vars_p_function): Do DECL_ARGUMENTS. > (lto_fixup_prevailing_decls): Update. > > * objc-act.c (objc_common_tree_size): New function. > * objc-act.h (KEYWORD_KEY_NAME, KEYWORD_ARG_NAME): Add type > checking. > (INSTANCE_METHOD_OR_CLASS_METHOD_DECL_CHECK): New macro. > (METHOD_SEL_NAME, METHOD_SEL_ARGS, METHOD_ADD_ARGS, > METHOD_ADD_ARGS_ELLIPSIS_P, METHOD_DEFINITION, METHOD_ENCODING, > METHOD_TYPE_ATTRIBUTES, METHOD_PROPERTY_CONTEXT): Add type checking. > (METHOD_SEL_ARGS): Use decl_common.size instead of > decl_non_common.result. > (PROPERTY_NAME, PROPERTY_GETTER_NAME, PROPERTY_SETTER_NAME, > PROPERTY_READONLY, PROPERTY_NONATOMIC, PROPERTY_ASSIGN_SEMANTICS, > PROPERTY_IVAR_NAME, PROPERTY_DYNAMIC, PROPERTY_HAS_NO_GETTER, > PROPERTY_HAS_NO_SETTER, PROPERTY_OPTIONAL): Add type checking. > (objc_common_tree_size): Declare. > * objc/objc-lang.c (LANG_HOOKS_TREE_SIZE): New macro. Ping... I would really like to finish the transition here and decompose decl_non_common/decl_with_vis so we can get the inehriatance hiearchy more explicit. Honza