absyntax_utils/search_var_instance_decl.cc
changeset 870 9c6c588fd708
parent 854 13d0b67de111
child 939 5074236fb3c4
equal deleted inserted replaced
822:a7d9e0b8636b 870:9c6c588fd708
   127   return this->current_option;
   127   return this->current_option;
   128 }
   128 }
   129 
   129 
   130 
   130 
   131 
   131 
   132 /* This is a temporary fix. Hopefully, once I clean up stage4 code, and I change the way
       
   133  * we generate C code, this function will no longer be needed!
       
   134  */
       
   135 #include <typeinfo>  /* required for typeid() */
       
   136 bool search_var_instance_decl_c::type_is_complex(symbol_c *symbol) {
       
   137   symbol_c *decl;
       
   138   
       
   139   decl = this->get_decl(symbol);
       
   140   if (NULL == decl) ERROR;
       
   141   decl = search_base_type_c::get_basetype_decl(decl);
       
   142   if (NULL == decl) ERROR;
       
   143   
       
   144   return ((typeid( *(decl) ) == typeid( array_specification_c                )) ||
       
   145 //        (typeid( *(decl) ) == typeid( array_spec_init_c                    )) ||  /* does not seem to be necessary */
       
   146           (typeid( *(decl) ) == typeid( structure_type_declaration_c         )) ||  
       
   147           (typeid( *(decl) ) == typeid( structure_element_declaration_list_c )) ||
       
   148 //        (typeid( *(decl) ) == typeid( structure_type_declaration_c         )) ||  /* does not seem to be necessary */
       
   149           (typeid( *(decl) ) == typeid( initialized_structure_c              )) ||
       
   150           (search_base_type_c::type_is_fb(decl) && current_vartype == external_vt)
       
   151          );
       
   152 }
       
   153 
       
   154 bool search_var_instance_decl_c::type_is_fb(symbol_c *symbol) {
       
   155     symbol_c *decl;
       
   156     search_base_type_c search_base_type;
       
   157 
       
   158     decl = this->get_decl(symbol);
       
   159     if (NULL == decl) ERROR;
       
   160     return search_base_type.type_is_fb(decl);
       
   161 }
       
   162 
   132 
   163 /***************************/
   133 /***************************/
   164 /* B 0 - Programming Model */
   134 /* B 0 - Programming Model */
   165 /***************************/
   135 /***************************/
   166 void *search_var_instance_decl_c::visit(library_c *symbol) {
   136 void *search_var_instance_decl_c::visit(library_c *symbol) {