]> git.ipfire.org Git - thirdparty/gcc.git/commit
d: Add option to include imported modules in the compilation [PR109023]
authorIain Buclaw <ibuclaw@gdcproject.org>
Sat, 12 Apr 2025 09:13:50 +0000 (11:13 +0200)
committerIain Buclaw <ibuclaw@gdcproject.org>
Sat, 12 Apr 2025 20:02:26 +0000 (22:02 +0200)
commit9a7b6668f8f79be8fa73982b8b0bde33c1d8c61f
tree7129059dad97dbeed0feba4e2bc4d3ce05c27214
parent8a03d014ec096b3e8c9941a6bf724d3daaeeb289
d: Add option to include imported modules in the compilation [PR109023]

Adds the ability to include imported modules in the compilation, as if
they were given on the command line.  When this option is enabled, all
imported modules are compiled except those that are part of libphobos.

PR d/109023

gcc/d/ChangeLog:

* d-compiler.cc: Include dmd/errors.h.
(Compiler::onImport): Implement.
* d-lang.cc (d_handle_option): Handle -finclude-imports.
(d_parse_file): Run semantic on included imports.
* gdc.texi: Document -finclude-imports.
* lang.opt: Add finclude-imports.
* lang.opt.urls: Regenerate.

gcc/testsuite/ChangeLog:

* gdc.dg/torture/imports/pr109023.d: New test.
* gdc.dg/torture/pr109023.d: New test.
gcc/d/d-compiler.cc
gcc/d/d-lang.cc
gcc/d/gdc.texi
gcc/d/lang.opt
gcc/d/lang.opt.urls
gcc/testsuite/gdc.dg/torture/imports/pr109023.d [new file with mode: 0644]
gcc/testsuite/gdc.dg/torture/pr109023.d [new file with mode: 0644]