small treelang cleanup

James A. Morrison ja2morri@csclub.uwaterloo.ca
Mon Jun 13 02:45:00 GMT 2005


Rafael Ávila de Espíndola <rafael.espindola@gmail.com> writes:

> The attached patch makes the treelang frontend use build_function_call_expr to 
> build functions calls. Currently they are built "by hand".
> 
> Do I need a copyright assignment for a patch off this size? If I do I am 
> whiling to sign it.
> 
> 

 I don't think this needs a copyright assignment as it is under 10 lines.
However, for your changes, please indicate the testing you have done, what
platform you have done your testing on, then include a Changelog entry outside
the patch like:

2005-06-12  Rafael Ávila de Espíndola   <rafael.espindola@gmail.com>

        * treetree.c (tree_code_get_expression): Call build_function_call_expr
        to build function calls.
 
> Index: gcc/treelang/treetree.c
> ===================================================================
> RCS file: /cvsroot/gcc/gcc/gcc/treelang/treetree.c,v
> retrieving revision 1.62
> diff -c -3 -p -r1.62 treetree.c
> *** gcc/treelang/treetree.c	29 Apr 2005 20:27:58 -0000	1.62
> --- gcc/treelang/treetree.c	12 Jun 2005 23:59:47 -0000
> *************** tree_code_get_expression (unsigned int e
> *** 699,710 ****
>       case EXP_FUNCTION_INVOCATION:
>         gcc_assert (op1);
>         {
> !         tree fun_ptr;
> ! 	TREE_USED (op1) = 1;
> !         fun_ptr = fold_build1 (ADDR_EXPR,
> ! 			       build_pointer_type (TREE_TYPE (op1)), op1);
> !         ret1 = fold_build3 (CALL_EXPR, type, fun_ptr, nreverse (op2),
> ! 			    NULL_TREE);
>         }
>         break;
>   
> --- 699,708 ----
>       case EXP_FUNCTION_INVOCATION:
>         gcc_assert (op1);
>         {
> !         TREE_USED (op1) = 1;
> !         gcc_assert(TREE_TYPE (TREE_TYPE (op1)) == type);
> !         tree arglist = nreverse(op2);
> !         ret1 = build_function_call_expr(op1, arglist);
>         }
>         break;
>   


-- 
Thanks,
Jim

http://www.csclub.uwaterloo.ca/~ja2morri/
http://phython.blogspot.com
http://open.nit.ca/wiki/?page=jim



More information about the Gcc-patches mailing list