OP_NAME = 5,
OP_MEMBER_NAME = 6,
OP_ENTRY_POINT = 15,
+ OP_EXECUTION_MODE = 16,
OP_TYPE_VOID = 19,
OP_TYPE_BOOL = 20,
OP_TYPE_INT = 21,
}
}
+ for(const EntryPoint &e: entry_points)
+ flags[e.id] = 0;
for(const Variable &v: variables)
flags[v.id] = 0;
for(const InstructionBlock &b: blocks)
unsigned start = new_code.size();
new_code.push_back(opcode);
new_code.push_back(*(op+1));
- new_code.push_back(*(op+2));
+ unsigned func_id = *(op+2);
+ new_code.push_back(func_id);
unsigned i=3;
while(i<word_count)
break;
}
+ unsigned var_count = 0;
for(; i<word_count; ++i)
{
unsigned id = *(op+i);
if(flags[id])
+ {
+ ++var_count;
new_code.push_back(id);
+ }
}
- new_code[start] |= (new_code.size()-start)<<16;
+ if(var_count)
+ {
+ flags[func_id] = 1;
+ new_code[start] |= (new_code.size()-start)<<16;
+ }
+ else
+ new_code.resize(start);
copy = false;
}
+ else if(opcode==OP_EXECUTION_MODE)
+ copy = flags[*(op+1)];
else if(opcode==OP_SPEC_CONSTANT_TRUE || opcode==OP_SPEC_CONSTANT_FALSE)
{
unsigned id = *(op+2);
++i;
}
+ Stage *prev_stage = 0;
+ for(auto i=module->stages.begin(); i!=module->stages.end(); )
+ {
+ if(i->functions.empty())
+ i = module->stages.erase(i);
+ else
+ {
+ i->previous = prev_stage;
+ prev_stage = &*i;
+ ++i;
+ }
+ }
+
for(Stage &s: module->stages)
{
StructuralFeatureConverter().apply(s, features);