Mercurial > hg > CbC > CbC_gcc
comparison gcc/c-decl.c @ 106:85047c4f1ca4
add CbC-examples/rectypeTest
author | Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 13 Jun 2012 17:18:58 +0900 |
parents | 46ee985e4f0e |
children | a3a2f64cf8f4 |
comparison
equal
deleted
inserted
replaced
105:b3cfc7733d3f | 106:85047c4f1ca4 |
---|---|
7695 | 7695 |
7696 #ifndef noCbC | 7696 #ifndef noCbC |
7697 cbc_return_f = NULL_TREE; | 7697 cbc_return_f = NULL_TREE; |
7698 cbc_env = NULL_TREE; | 7698 cbc_env = NULL_TREE; |
7699 if ( declspecs->typespec_word == cts_CbC_code ) | 7699 if ( declspecs->typespec_word == cts_CbC_code ) |
7700 { | 7700 { |
7701 cbc_set_codesegment(decl1); | 7701 cbc_set_codesegment(decl1); |
7702 //CbC_IS_CODE_SEGMENT(TREE_TYPE(decl1)) = 1; | 7702 //CbC_IS_CODE_SEGMENT(TREE_TYPE(decl1)) = 1; |
7703 | 7703 |
7704 | 7704 |
7705 /* implementation of rectype */ | 7705 /* implementation of rectype */ |
7706 tree func_tree = TREE_TYPE(decl1); | 7706 tree func_tree = TREE_TYPE(decl1); |
7707 // parm is PARM_DECL | 7707 // parm is PARM_DECL |
7708 tree parm = declarator->u.arg_info->parms; | 7708 tree parm = declarator->u.arg_info->parms; |
7709 while (parm) { | 7709 while (parm) { |
7710 tree tmptype = parm; | 7710 tree tmptype = parm; |
7711 if (!IS_RECTYPE(TREE_TYPE(tmptype))) { | 7711 if (!IS_RECTYPE(TREE_TYPE(tmptype))) { |
7712 parm = TREE_CHAIN(parm); | 7712 parm = TREE_CHAIN(parm); |
7713 continue; | 7713 continue; |
7714 } | 7714 } |
7715 tree t = TREE_TYPE(tmptype); | 7715 tree t = TREE_TYPE(tmptype); |
7716 while (TREE_CODE(t) == POINTER_TYPE) { | 7716 while (TREE_CODE(t) == POINTER_TYPE) { |
7717 tmptype = t; | 7717 tmptype = t; |
7718 t= TREE_TYPE(tmptype); | 7718 t= TREE_TYPE(tmptype); |
7719 } | 7719 } |
7720 TREE_TYPE(tmptype) = func_tree; | 7720 TREE_TYPE(tmptype) = func_tree; |
7721 parm = TREE_CHAIN(parm); | 7721 parm = TREE_CHAIN(parm); |
7722 } | 7722 } |
7723 | 7723 |
7724 } | 7724 } |
7725 | 7725 |
7726 #endif | 7726 #endif |
7727 | 7727 |
7728 /* If the declarator is not suitable for a function definition, | 7728 /* If the declarator is not suitable for a function definition, |
7729 cause a syntax error. */ | 7729 cause a syntax error. */ |