- const map<string, InterfaceBlock *> &blocks = stage->interface_blocks;
- map<string, InterfaceBlock *>::const_iterator i = blocks.find(var.name);
- if(i==blocks.end())
- {
- // Look for the variable in anonymous interface blocks.
- for(i=blocks.begin(); i!=blocks.end(); ++i)
- if(i->second->instance_name.empty() && i->second->struct_declaration)
- if(i->second->struct_declaration->members.variables.count(var.name))
- break;
- }
-
- if(i!=blocks.end())
- {
- /* The name refers to either an interface block with an instance name
- or a variable declared inside an anonymous interface block. Prepare
- new syntax tree nodes accordingly. */
- InterfaceBlockReference *iface_ref = new InterfaceBlockReference;
- iface_ref->source = var.source;
- iface_ref->line = var.line;
- iface_ref->declaration = i->second;
-
- if(i->second->instance_name.empty())
+ for(const auto &kvp: stage->interface_blocks)
+ if(kvp.second->name.find(' ')!=string::npos && kvp.second->block_declaration->members.variables.count(var.name))