apply<VariableResolver>(stage);
apply<InterfaceGenerator>(stage);
apply<VariableResolver>(stage);
- apply<VariableRenamer>(stage);
apply<DeclarationReorderer>(stage);
apply<LegacyConverter>(stage);
}
if(i==prev_out.end())
i = prev_out.find(in_prefix+var.name);
if(i!=prev_out.end())
- generate_interface(*i->second, "in", var.name);
+ {
+ generate_interface(*i->second, "in", i->second->name);
+ var.name = i->second->name;
+ }
}
void ProgramCompiler::InterfaceGenerator::visit(VariableDeclaration &var)
}
-void ProgramCompiler::VariableRenamer::visit(VariableReference &var)
-{
- if(var.declaration)
- var.name = var.declaration->name;
-}
-
-void ProgramCompiler::VariableRenamer::visit(VariableDeclaration &var)
-{
- if(var.linked_declaration)
- var.name = var.linked_declaration->name;
- TraversingVisitor::visit(var);
-}
-
-
ProgramCompiler::DeclarationReorderer::DeclarationReorderer():
kind(NO_DECLARATION)
{ }
virtual void visit(ProgramSyntax::Passthrough &);
};
- struct VariableRenamer: Visitor
- {
- using Visitor::visit;
- virtual void visit(ProgramSyntax::VariableReference &);
- virtual void visit(ProgramSyntax::VariableDeclaration &);
- };
-
struct DeclarationReorderer: Visitor
{
enum DeclarationKind