append_subtree(branches);
}
-void DumpTree::visit(InterfaceBlock &block)
+void DumpTree::visit(InterfaceBlock &iface)
{
string head;
- if(!block.instance_name.empty())
- head += format("%%%d ", get_label(block));
- head += format("%s %s", block.interface, block.name);
- if(!block.instance_name.empty())
- head += format(" %s", block.instance_name);
- if(block.array)
+ if(!iface.instance_name.empty())
+ head += format("%%%d ", get_label(iface));
+ head += format("%s %s", iface.interface, iface.name);
+ if(!iface.instance_name.empty())
+ head += format(" %s", iface.instance_name);
+ if(iface.array)
head += "[]";
- if(block.source==BUILTIN_SOURCE)
+ if(iface.source==BUILTIN_SOURCE)
head += " (builtin)";
- else if(block.linked_block)
+ else if(iface.linked_block)
head += " (linked)";
append(head);
begin_sub();
last_branch();
- if(block.type_declaration)
- append(format("Type: %%%d %s", get_label(*block.type_declaration), block.type_declaration->name));
- else if(block.members)
- block.members->visit(*this);
+ if(iface.type_declaration)
+ append(format("Type: %%%d %s", get_label(*iface.type_declaration), iface.type_declaration->name));
+ else if(iface.members)
+ iface.members->visit(*this);
end_sub();
}
bool ExpressionResolver::convert_to_element(RefPtr<Expression> &expr, BasicTypeDeclaration &elem_type)
{
- if(BasicTypeDeclaration *expr_type = dynamic_cast<BasicTypeDeclaration *>(expr->type))
+ if(BasicTypeDeclaration *expr_basic = dynamic_cast<BasicTypeDeclaration *>(expr->type))
{
BasicTypeDeclaration *to_type = &elem_type;
- if(is_vector_or_matrix(*expr_type))
- to_type = find_type(elem_type, expr_type->kind, expr_type->size);
+ if(is_vector_or_matrix(*expr_basic))
+ to_type = find_type(elem_type, expr_basic->kind, expr_basic->size);
if(to_type)
{
convert_to(expr, *to_type);
}
-UnusedVariableRemover::VariableInfo::VariableInfo():
- local(false),
- output(false),
- conditionally_assigned(false),
- referenced(false),
- interface_block(0)
-{ }
-
-
bool UnusedTypeRemover::apply(Stage &stage)
{
stage.content.visit(*this);
}
+UnusedVariableRemover::VariableInfo::VariableInfo():
+ local(false),
+ output(false),
+ conditionally_assigned(false),
+ referenced(false),
+ interface_block(0)
+{ }
+
+
UnusedVariableRemover::UnusedVariableRemover():
stage(0),
interface_block(0),