if(const Stage *builtin = get_builtins(Stage::SHARED))
{
- for(map<string, TypeDeclaration *>::const_iterator i=builtin->types.begin(); i!=builtin->types.end(); ++i)
- global_types.insert(i->first);
- }
- else
- {
- global_types.insert("void");
- global_types.insert("bool");
- global_types.insert("int");
- global_types.insert("uint");
- global_types.insert("float");
+ for(const auto &kvp: builtin->types)
+ global_types.insert(kvp.first);
}
tokenizer.begin(source, name);
cur_stage = &module->stages.back();
stage_types.clear();
- for(vector<const Module *>::const_iterator i=imported_modules.begin(); i!=imported_modules.end(); ++i)
+ for(const Module *m: imported_modules)
{
- list<Stage>::const_iterator j = find_member((*i)->stages, stage, &Stage::type);
- if(j!=(*i)->stages.end())
+ auto j = find_member(m->stages, stage, &Stage::type);
+ if(j!=m->stages.end())
{
- for(map<string, TypeDeclaration *>::const_iterator k=j->types.begin(); k!=j->types.end(); ++k)
- stage_types.insert(k->first);
+ for(const auto &kvp: j->types)
+ stage_types.insert(kvp.first);
}
}
}
{
const Module &imported_mod = mod_cache->get_module(import->module);
imported_modules.push_back(&imported_mod);
- for(map<string, TypeDeclaration *>::const_iterator i=imported_mod.shared.types.begin(); i!=imported_mod.shared.types.end(); ++i)
- global_types.insert(i->first);
+ for(const auto &kvp: imported_mod.shared.types)
+ global_types.insert(kvp.first);
}
return import;