Mercurial > hg > Papers > 2012 > aplas
changeset 23:e9d317e4ea70
modify
author | Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 15 Jun 2012 17:33:28 +0900 |
parents | f1839aae06dc |
children | 17ce985c1cb3 |
files | paper/rectype.ind |
diffstat | 1 files changed, 24 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/paper/rectype.ind Fri Jun 15 16:14:28 2012 +0900 +++ b/paper/rectype.ind Fri Jun 15 17:33:28 2012 +0900 @@ -235,10 +235,32 @@ csA's argument is p. GCC is also an infinite recursion happens to see the type of tye argument of the argument. -In order to the solve this problem. +We Solve this problem that does not check the arguments if the \rectype flag is true. +The following program become part was fixed gcc/c-family/c-pretty-print.c. + + static void + pp_c_abstract_declarator (c_pretty_printer *pp, tree t) + { + if (TREE_CODE (t) == POINTER_TYPE) + { + if (TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE + || TREE_CODE (TREE_TYPE (t)) == FUNCTION_TYPE) + pp_c_right_paren (pp); + #ifndef noCbC + if (IS_RECTYPE(t)) return; + #endif + t = TREE_TYPE (t); + } + pp_direct_abstract_declarator (pp, t); + } + + +Variable t have information of p's argument. +If t is POINTER_TYPE, t is assigned type of POINTER_TYPE(\verb+t = TREE_TYPE (t);+). +We have added code \verb+if (IS_RECTYPE(t)) return;+ +Thereby we have solved type checking and infinite recursion problem. - --How to implement \rectype