It is the way done by the compilers, and a lot of parts use
`mainmodule.name` to name things when `-m` is used.
So, in order to not broke the compilers parts,
generalize the idea in phases.
Note: the implicit main-module have no projets associated, so things
should not use "<main>" to identify then.
Signed-off-by: Jean Privat <jean@pryen.org>
mainmodule = mmodules.first
else
# We need a main module, so we build it by importing all modules
mainmodule = mmodules.first
else
# We need a main module, so we build it by importing all modules
- mainmodule = new MModule(modelbuilder.model, null, "<main>", new Location(null, 0, 0, 0, 0))
+ mainmodule = new MModule(modelbuilder.model, null, mmodules.first.name, new Location(null, 0, 0, 0, 0))
mainmodule.set_imported_mmodules(mmodules)
end
for phase in phases_list do
mainmodule.set_imported_mmodules(mmodules)
end
for phase in phases_list do
# Called by the `ToolContext::run_global_phases`.
#
# `mainmodule` is the main module of the program.
# Called by the `ToolContext::run_global_phases`.
#
# `mainmodule` is the main module of the program.
- # It could be an implicit module (called "<main>").
+ # It could be an implicit module (called like the first given_mmodules).
#
# `given_modules` is the list of explicitely requested modules.
# from the command-line for instance.
#
# `given_modules` is the list of explicitely requested modules.
# from the command-line for instance.