strct->members.body.splice(strct->members.body.begin(), iface.members->body);
stage->content.body.insert(type_insert_point, strct);
stage->types.insert(make_pair(strct->name, strct));
strct->members.body.splice(strct->members.body.begin(), iface.members->body);
stage->content.body.insert(type_insert_point, strct);
stage->types.insert(make_pair(strct->name, strct));
{
/* Block names can be reused in different interfaces. Prefix the name with
the first character of the interface to avoid conflicts. */
{
/* Block names can be reused in different interfaces. Prefix the name with
the first character of the interface to avoid conflicts. */
if(!iface.instance_name.empty())
stage->interface_blocks.insert(make_pair("_"+iface.instance_name, &iface));
if(!iface.instance_name.empty())
stage->interface_blocks.insert(make_pair("_"+iface.instance_name, &iface));
{
BasicTypeDeclaration *basic_true = dynamic_cast<BasicTypeDeclaration *>(ternary.true_expr->type);
BasicTypeDeclaration *basic_false = dynamic_cast<BasicTypeDeclaration *>(ternary.false_expr->type);
{
BasicTypeDeclaration *basic_true = dynamic_cast<BasicTypeDeclaration *>(ternary.true_expr->type);
BasicTypeDeclaration *basic_false = dynamic_cast<BasicTypeDeclaration *>(ternary.false_expr->type);
Compatibility compat = get_compatibility(*basic_true, *basic_false);
if(compat==NOT_COMPATIBLE)
return;
Compatibility compat = get_compatibility(*basic_true, *basic_false);
if(compat==NOT_COMPATIBLE)
return;
stage inline it if that's reasonable. */
RefPtr<VariableDeclaration> temporary = new VariableDeclaration;
temporary->type = args.front().type->name;
stage inline it if that's reasonable. */
RefPtr<VariableDeclaration> temporary = new VariableDeclaration;
temporary->type = args.front().type->name;
temporary->init_expression = call.arguments.front();
current_block->body.insert(insert_point, temporary);
temporary->init_expression = call.arguments.front();
current_block->body.insert(insert_point, temporary);
in_block->members = new Block;
in_block->instance_name = out_block.instance_name;
if(stage->type==Stage::GEOMETRY)
in_block->members = new Block;
in_block->instance_name = out_block.instance_name;
if(stage->type==Stage::GEOMETRY)
if(!in_block->instance_name.empty())
stage->interface_blocks.insert(make_pair("_"+in_block->instance_name, in_block));
if(!in_block->instance_name.empty())
stage->interface_blocks.insert(make_pair("_"+in_block->instance_name, in_block));
if(!iface.linked_block && stage->previous)
{
const map<string, InterfaceBlock *> &prev_blocks = stage->previous->interface_blocks;
if(!iface.linked_block && stage->previous)
{
const map<string, InterfaceBlock *> &prev_blocks = stage->previous->interface_blocks;