From patchwork Thu Sep 9 13:45:28 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: PR 45186: Add build[1-6]_loc and build[1-6]_stat_loc to gcc/tree.h Date: Thu, 09 Sep 2010 03:45:28 -0000 From: Tobias Burnus X-Patchwork-Id: 64300 Message-Id: <4C88E4F8.5070606@net-b.de> To: gcc patches For PR 45186, I need to annotate build1 etc. with a location; to make life easier this patch follows fold_build[0-9], which have fold_build[0-9]_loc cousins. Build and regtested on x86-64-linux. OK for the trunk? Tobias 2010-09-09 Tobias Burnus PR fortran/45186 * tree.h (build1_stat_loc, build2_stat_loc, build3_stat_loc, build4_stat_loc, build5_stat_loc, build6_stat_loc): New inline functions. (build1_loc, build2_loc, build3_loc, build4_loc, build5_loc, build6_loc): New macros. Index: gcc/tree.h =================================================================== --- gcc/tree.h (revision 164052) +++ gcc/tree.h (working copy) @@ -3992,23 +3992,102 @@ extern tree build_nt_call_vec (tree, VEC extern tree build0_stat (enum tree_code, tree MEM_STAT_DECL); #define build0(c,t) build0_stat (c,t MEM_STAT_INFO) + + extern tree build1_stat (enum tree_code, tree, tree MEM_STAT_DECL); #define build1(c,t1,t2) build1_stat (c,t1,t2 MEM_STAT_INFO) + +static inline tree +build1_stat_loc (location_t loc, enum tree_code code, tree type, + tree op MEM_STAT_DECL) +{ + tree t = build1_stat (code, type, op PASS_MEM_STAT); + SET_EXPR_LOCATION (t, loc); + return t; +} +#define build1_loc(l,c,t1,t2) build1_stat_loc (l,c,t1,t2 MEM_STAT_INFO) + + extern tree build2_stat (enum tree_code, tree, tree, tree MEM_STAT_DECL); #define build2(c,t1,t2,t3) build2_stat (c,t1,t2,t3 MEM_STAT_INFO) + +static inline tree +build2_stat_loc (location_t loc, enum tree_code code, tree type, tree arg0, + tree op MEM_STAT_DECL) +{ + tree t = build2_stat (code, type, arg0, op PASS_MEM_STAT); + SET_EXPR_LOCATION (t, loc); + return t; +} +#define build2_loc(l,c,t1,t2,t3) build2_stat_loc (l,c,t1,t2,t3 MEM_STAT_INFO) + + extern tree build3_stat (enum tree_code, tree, tree, tree, tree MEM_STAT_DECL); #define build3(c,t1,t2,t3,t4) build3_stat (c,t1,t2,t3,t4 MEM_STAT_INFO) + +static inline tree +build3_stat_loc (location_t loc, enum tree_code code, tree type, tree arg0, + tree arg1, tree op MEM_STAT_DECL) +{ + tree t = build3_stat (code, type, arg0, arg1, op PASS_MEM_STAT); + SET_EXPR_LOCATION (t, loc); + return t; +} +#define build3_loc(l,c,t1,t2,t3,t4) \ + build3_stat_loc (l,c,t1,t2,t3,t4 MEM_STAT_INFO) + + extern tree build4_stat (enum tree_code, tree, tree, tree, tree, tree MEM_STAT_DECL); #define build4(c,t1,t2,t3,t4,t5) build4_stat (c,t1,t2,t3,t4,t5 MEM_STAT_INFO) + +static inline tree +build4_stat_loc (location_t loc, enum tree_code code, tree type, tree arg0, + tree arg1, tree arg2, tree op MEM_STAT_DECL) +{ + tree t = build4_stat (code, type, arg0, arg1, arg2, op PASS_MEM_STAT); + SET_EXPR_LOCATION (t, loc); + return t; +} +#define build4_loc(l,c,t1,t2,t3,t4,t5) \ + build4_stat_loc (l,c,t1,t2,t3,t4,t5 MEM_STAT_INFO) + + extern tree build5_stat (enum tree_code, tree, tree, tree, tree, tree, tree MEM_STAT_DECL); #define build5(c,t1,t2,t3,t4,t5,t6) build5_stat (c,t1,t2,t3,t4,t5,t6 MEM_STAT_INFO) + +static inline tree +build5_stat_loc (location_t loc, enum tree_code code, tree type, tree arg0, + tree arg1, tree arg2, tree arg3, tree op MEM_STAT_DECL) +{ + tree t = build5_stat (code, type, arg0, arg1, arg2, arg3, op PASS_MEM_STAT); + SET_EXPR_LOCATION (t, loc); + return t; +} +#define build5_loc(l,c,t1,t2,t3,t4,t5,t6) \ + build5_stat_loc (l,c,t1,t2,t3,t4,t5,t6 MEM_STAT_INFO) + + extern tree build6_stat (enum tree_code, tree, tree, tree, tree, tree, tree, tree MEM_STAT_DECL); #define build6(c,t1,t2,t3,t4,t5,t6,t7) \ build6_stat (c,t1,t2,t3,t4,t5,t6,t7 MEM_STAT_INFO) +static inline tree +build6_stat_loc (location_t loc, enum tree_code code, tree type, tree arg0, + tree arg1, tree arg2, tree arg3, tree arg4, + tree op MEM_STAT_DECL) +{ + tree t = build6_stat (code, type, arg0, arg1, arg2, arg3, arg4, + op PASS_MEM_STAT); + SET_EXPR_LOCATION (t, loc); + return t; +} +#define build6_loc(l,c,t1,t2,t3,t4,t5,t6,t7) \ + build6_stat_loc (l,c,t1,t2,t3,t4,t5,t6,t7 MEM_STAT_INFO) + + extern tree build_var_debug_value_stat (tree, tree MEM_STAT_DECL); #define build_var_debug_value(t1,t2) \ build_var_debug_value_stat (t1,t2 MEM_STAT_INFO)