@@ TODO: This is a bit of a fuzzy mess: - The .build.loaded variable check: it's not clear if init_module() already has this semantics? - Why do we use variable instead of the module map entry? Probably because of optional. Also entry present if only booted. Need to be careful here. Also root vs base! Note that it would have been nice to keep these inline but we need the definition of scope for
| 1021 | // definition of scope for the variable lookup. |
| 1022 | // |
| 1023 | optional<shared_ptr<module>> |
| 1024 | load_module (scope& rs, |
| 1025 | scope& bs, |
| 1026 | const string& name, |
| 1027 | const location& loc, |
| 1028 | bool opt, |
| 1029 | const variable_map& hints) |
| 1030 | { |
| 1031 | if (cast_false<bool> (bs[name + ".build.loaded"])) |
| 1032 | { |
| 1033 | if (cast_false<bool> (bs[name + ".build.configured"])) |
| 1034 | return rs.root_extra->loaded_modules.find (name)->module; |
| 1035 | } |
| 1036 | else |
| 1037 | { |
| 1038 | if (module_state* ms = init_module (rs, bs, name, loc, opt, hints)) |
| 1039 | return ms->module; |
| 1040 | } |
| 1041 | |
| 1042 | return nullopt; |
| 1043 | } |
| 1044 | |
| 1045 | shared_ptr<module> |
| 1046 | load_module (scope& rs, |
no test coverage detected