stage4/generate_c/generate_c_inlinefcall.cc
changeset 854 13d0b67de111
parent 852 efb44e892582
child 861 443e8243f289
equal deleted inserted replaced
853:818c4ac5d64d 854:13d0b67de111
   241 
   241 
   242 
   242 
   243     void *print_getter(symbol_c *symbol) {
   243     void *print_getter(symbol_c *symbol) {
   244       unsigned int vartype = search_var_instance_decl->get_vartype(symbol);
   244       unsigned int vartype = search_var_instance_decl->get_vartype(symbol);
   245       if (vartype == search_var_instance_decl_c::external_vt) {
   245       if (vartype == search_var_instance_decl_c::external_vt) {
   246         if (search_var_instance_decl->type_is_fb(symbol))
   246         if (!get_datatype_info_c::is_type_valid    (symbol->datatype)) ERROR;
       
   247         if ( get_datatype_info_c::is_function_block(symbol->datatype))
   247           s4o.print(GET_EXTERNAL_FB);
   248           s4o.print(GET_EXTERNAL_FB);
   248         else
   249         else
   249           s4o.print(GET_EXTERNAL);
   250           s4o.print(GET_EXTERNAL);
   250       }
   251       }
   251       else if (vartype == search_var_instance_decl_c::located_vt)
   252       else if (vartype == search_var_instance_decl_c::located_vt)
   267     void *print_setter(symbol_c* symbol,
   268     void *print_setter(symbol_c* symbol,
   268                        symbol_c* type,
   269                        symbol_c* type,
   269                        symbol_c* value) {
   270                        symbol_c* value) {
   270       unsigned int vartype = search_var_instance_decl->get_vartype(symbol);
   271       unsigned int vartype = search_var_instance_decl->get_vartype(symbol);
   271       if (vartype == search_var_instance_decl_c::external_vt) {
   272       if (vartype == search_var_instance_decl_c::external_vt) {
   272         if (search_var_instance_decl->type_is_fb(symbol))
   273         if (!get_datatype_info_c::is_type_valid    (symbol->datatype)) ERROR;
       
   274         if ( get_datatype_info_c::is_function_block(symbol->datatype))
   273           s4o.print(SET_EXTERNAL_FB);
   275           s4o.print(SET_EXTERNAL_FB);
   274          else
   276          else
   275           s4o.print(SET_EXTERNAL);
   277           s4o.print(SET_EXTERNAL);
   276       }
   278       }
   277       else if (vartype == search_var_instance_decl_c::located_vt)
   279       else if (vartype == search_var_instance_decl_c::located_vt)
   334     /*************************************/
   336     /*************************************/
   335 
   337 
   336     // SYM_REF2(structured_variable_c, record_variable, field_selector)
   338     // SYM_REF2(structured_variable_c, record_variable, field_selector)
   337     void *visit(structured_variable_c *symbol) {
   339     void *visit(structured_variable_c *symbol) {
   338       TRACE("structured_variable_c");
   340       TRACE("structured_variable_c");
   339       bool type_is_complex = search_var_instance_decl->type_is_complex(symbol->record_variable);
   341       bool type_is_complex = analyse_variable_c::is_complex_type(symbol->record_variable);
   340       if (generating_inlinefunction) {
   342       if (generating_inlinefunction) {
   341         switch (wanted_variablegeneration) {
   343         switch (wanted_variablegeneration) {
   342           case complextype_base_vg:
   344           case complextype_base_vg:
   343             symbol->record_variable->accept(*this);
   345             symbol->record_variable->accept(*this);
   344             if (!type_is_complex) {
   346             if (!type_is_complex) {