Fill symbol->datatype anotation for FB declarations.
--- a/stage3/fill_candidate_datatypes.cc Wed Jan 23 13:46:11 2013 +0000
+++ b/stage3/fill_candidate_datatypes.cc Wed Jan 23 14:30:03 2013 +0000
@@ -1293,6 +1293,12 @@
search_varfb_instance_type = NULL;
local_enumerated_value_symtable.reset();
+
+ /* The FB declaration itself may be used as a dataype! We now do the fill algorithm considering
+ * function_block_declaration_c a data type declaration...
+ */
+ // The next line is essentially equivalent to doing--> symbol->candidate_datatypes.push_back(symbol);
+ add_datatype_to_candidate_list(symbol, base_type(symbol));
return NULL;
}
--- a/stage3/narrow_candidate_datatypes.cc Wed Jan 23 13:46:11 2013 +0000
+++ b/stage3/narrow_candidate_datatypes.cc Wed Jan 23 14:30:03 2013 +0000
@@ -748,6 +748,10 @@
symbol->fblock_body->accept(*this);
delete search_varfb_instance_type;
search_varfb_instance_type = NULL;
+
+ // A FB declaration can also be used as a Datatype! We now do the narrow algorithm considering it as such!
+ if (symbol->candidate_datatypes.size() == 1)
+ symbol->datatype = symbol->candidate_datatypes[0];
return NULL;
}