+ if(found_all)
+ {
+ redeclared_builtins.push_back(existing);
+ nodes_to_remove.insert(&var);
+ // The block struct will be removed during unused type removal
+ //nodes_to_remove.insert(var.block_declaration);
+ }
+ }
+ else if(!var.block_declaration && !existing->block_declaration && var.type==existing->type)
+ {
+ redeclare_builtin(*existing, var);
+
+ if(block)
+ {
+ /* Cause the block and its members to be marked as not builtin
+ so it will be emitted in output */
+ redeclared_builtins.push_back(block);
+ for(const auto &kvp: block->block_declaration->members.variables)
+ redeclared_builtins.push_back(kvp.second);
+ }
+
+ nodes_to_remove.insert(&var);
+ r_any_resolved = true;
+ }
+ }
+ else if(existing->array && !existing->array_size && var.type==existing->type && !var.layout && !var.init_expression)
+ {
+ existing->array_size = var.array_size;
+ nodes_to_remove.insert(&var);
+ r_any_resolved = true;
+ }
+ }