reflection.reflect_code(code);
map<const Constant *, unsigned> spec_indices;
- for(const auto &kvp: reflection.constants)
+ for(auto &kvp: reflection.constants)
if(kvp.second.constant_id>=0)
{
spec_indices[&kvp.second] = spec_constants.size();
- spec_constants.push_back(kvp.second);
+ spec_constants.emplace_back(move(kvp.second));
}
map<const Structure *, unsigned> struct_indices;
structs.reserve(reflection.structs.size());
- for(const auto &kvp: reflection.structs)
+ for(auto &kvp: reflection.structs)
{
struct_indices[&kvp.second] = structs.size();
- structs.push_back(kvp.second);
+ structs.emplace_back(move(kvp.second));
}
for(Structure &s: structs)
map<const Variable *, unsigned> var_indices;
variables.reserve(reflection.variables.size());
- for(const auto &kvp: reflection.variables)
+ for(auto &kvp: reflection.variables)
{
auto i = find_if(variables, [&kvp](const Variable &v){ return v==kvp.second; });
if(i!=variables.end())
else
{
var_indices[&kvp.second] = variables.size();
- variables.push_back(kvp.second);
+ variables.emplace_back(move(kvp.second));
}
}
}
entry_points.reserve(reflection.entry_points.size());
- for(const auto &kvp: reflection.entry_points)
+ for(auto &kvp: reflection.entry_points)
{
- entry_points.push_back(kvp.second);
+ entry_points.emplace_back(move(kvp.second));
EntryPoint &entry = entry_points.back();
for(const Variable *&v: entry.globals)
{
map<const InstructionBlock *, unsigned> block_indices;
blocks.reserve(reflection.blocks.size());
- for(const auto &kvp: reflection.blocks)
+ for(auto &kvp: reflection.blocks)
{
block_indices[&kvp.second] = blocks.size();
- blocks.push_back(kvp.second);
+ blocks.emplace_back(move(kvp.second));
}
for(InstructionBlock &b: blocks)