Patch attached :). -Balaji V. Iyer.
-----Original Message----- From: H.J. Lu [mailto:hjl.to...@gmail.com] Sent: Friday, September 09, 2011 11:14 AM To: Iyer, Balaji V Cc: Tobias Burnus; gcc-patches@gcc.gnu.org Subject: Re: [Patch] Finish function using absolute value not #define value On Fri, Sep 9, 2011 at 7:48 AM, Iyer, Balaji V <balaji.v.i...@intel.com> wrote: > Hello Everyone, > Here are the fixes to the patches as mentioned by H. J. . I am not > attaching the patch, just cut and pasting it. Cut/paste may not work if other people have to apply the patch for you. > Thanks, > > Balaji V. Iyer. > > Here is the cp/ChangeLog > > 2011-09-09 Balaji V. Iyer <balaji.v.i...@intel.com> > > * decl2.c (finish_objects): Replaced finish_function (0) with > finish_function (SF_PRE_PARSED). > (finish_static_storage_duration_function): Likewise. > * decl.c (end_cleanup_fn): Likewise. > * method.c (synthesize_method): Likewise. > * optimize.c (maybe_clone_body): Likewise. > * pt.c (instantiate_decl): Likewise. > * parser.c (cp_parser_function_definition_after_declarator): > Replaced > finish_function ((ctor_initializer_p ? 1 : 0) | (inline_p ? 2 : > 0)) > with finish_function ((ctor_initializer_p ? SF_PRE_PARSED : > SF_DEFAULT) > | (inline_p ? SF_INCLASS_INLINE : SF_DEFAULT)). > * parser.c (cp_parser_lambda_body): Replaced finish_function > (2) with > finish_function (SF_INCLASS_INLINE). > * semantics.c (maybe_add_lambda_conv_op): Likewise. > > Here is the objcp/ChangeLog > > 2011-09-09 Balaji V. Iyer <balaji.v.i...@intel.com> > > * objcp-decl.c (objcp_finish_function): Replaced > finish_function (0) > with finish_function (SF_DEFAULT). > Your ChangeLog can just say "Use SF_DEFAULT, SF_PRE_PARSED and SF_INCLASS_INLINE." -- H.J.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index eed4535..b92f13b 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -6540,7 +6540,7 @@ start_cleanup_fn (void) static void end_cleanup_fn (void) { - expand_or_defer_fn (finish_function (0)); + expand_or_defer_fn (finish_function (SF_DEFAULT)); pop_from_top_level (); } diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index f05b0f8..5b3bcc0 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -2775,7 +2775,7 @@ finish_objects (int method_type, int initp, tree body) /* Finish up. */ finish_compound_stmt (body); - fn = finish_function (0); + fn = finish_function (SF_DEFAULT); if (method_type == 'I') { @@ -2917,7 +2917,7 @@ finish_static_storage_duration_function (tree body) { /* Close out the function. */ finish_compound_stmt (body); - expand_or_defer_fn (finish_function (0)); + expand_or_defer_fn (finish_function (SF_DEFAULT)); } /* Return the information about the indicated PRIORITY level. If no diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 5b24f8f..97213f1 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -767,7 +767,7 @@ synthesize_method (tree fndecl) } finish_function_body (stmt); - expand_or_defer_fn (finish_function (0)); + expand_or_defer_fn (finish_function (SF_DEFAULT)); input_location = save_input_location; diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c index 6a06988..2e1c7b6 100644 --- a/gcc/cp/optimize.c +++ b/gcc/cp/optimize.c @@ -415,7 +415,7 @@ maybe_clone_body (tree fn) cp_function_chain->can_throw = !TREE_NOTHROW (fn); /* Now, expand this function into RTL, if appropriate. */ - finish_function (0); + finish_function (SF_DEFAULT); BLOCK_ABSTRACT_ORIGIN (DECL_INITIAL (clone)) = DECL_INITIAL (fn); if (alias) { diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 7d766d1..3fc6c75 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -7904,7 +7904,7 @@ cp_parser_lambda_body (cp_parser* parser, tree lambda_expr) finish_lambda_scope (); /* Finish the function and generate code for it if necessary. */ - expand_or_defer_fn (finish_function (/*inline*/2)); + expand_or_defer_fn (finish_function (SF_INCLASS_INLINE)); } parser->local_variables_forbidden_p = local_variables_forbidden_p; @@ -20091,8 +20091,8 @@ cp_parser_function_definition_after_declarator (cp_parser* parser, finish_lambda_scope (); /* Finish the function. */ - fn = finish_function ((ctor_initializer_p ? 1 : 0) | - (inline_p ? 2 : 0)); + fn = finish_function ((ctor_initializer_p ? SF_PRE_PARSED : SF_DEFAULT) | + (inline_p ? SF_INCLASS_INLINE : SF_DEFAULT)); /* Generate code for it, if necessary. */ expand_or_defer_fn (fn); /* Restore the saved values. */ diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 1f43ff1..8a79262 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -18286,7 +18286,7 @@ instantiate_decl (tree d, int defer_ok, local_specializations = saved_local_specializations; /* Finish the function. */ - d = finish_function (0); + d = finish_function (SF_DEFAULT); expand_or_defer_fn (d); } diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index f782df9..b416135 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -9043,7 +9043,7 @@ maybe_add_lambda_conv_op (tree type) finish_compound_stmt (compound_stmt); finish_function_body (body); - expand_or_defer_fn (finish_function (2)); + expand_or_defer_fn (finish_function (SF_INCLASS_INLINE)); /* Generate the body of the conversion op. */ @@ -9057,7 +9057,7 @@ maybe_add_lambda_conv_op (tree type) finish_compound_stmt (compound_stmt); finish_function_body (body); - expand_or_defer_fn (finish_function (2)); + expand_or_defer_fn (finish_function (SF_INCLASS_INLINE)); if (nested) pop_function_context (); diff --git a/gcc/objcp/objcp-decl.c b/gcc/objcp/objcp-decl.c index ecc2b2b..7d5a045 100644 --- a/gcc/objcp/objcp-decl.c +++ b/gcc/objcp/objcp-decl.c @@ -82,7 +82,7 @@ objcp_finish_function (void) { /* The C++ flavor of 'finish_function' does not generate RTL -- one has to call 'expand_or_defer_fn' to do that. */ - expand_or_defer_fn (finish_function (0)); + expand_or_defer_fn (finish_function (SF_DEFAULT)); } tree