MCPcopy Create free account
hub / github.com/build2/build2 / load_module

Function load_module

libbuild2/module.cxx:1023–1043  ·  view source on GitHub ↗

@@ 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

Source from the content-addressed store, hash-verified

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,

Callers 15

config_initFunction · 0.85
initFunction · 0.85
initFunction · 0.85
initFunction · 0.85
guess_initFunction · 0.85
config_initFunction · 0.85
objc_initFunction · 0.85
as_cpp_initFunction · 0.85
initMethod · 0.85
core_vars_initFunction · 0.85
core_guess_initFunction · 0.85
core_config_initFunction · 0.85

Calls 1

init_moduleFunction · 0.85

Tested by

no test coverage detected