Move driver's lib files into a package

This commit is contained in:
Nicholas Wilson 2024-10-02 20:48:32 +08:00 committed by Nicholas Wilson
parent 392a5925ea
commit 4e175352af
10 changed files with 34 additions and 31 deletions

View file

@ -1559,8 +1559,8 @@ auto sourceFiles()
dmsc.d e2ir.d iasmdmd.d glue.d objc_glue.d
s2ir.d tocsym.d toctype.d tocvdebug.d todt.d toir.d toobj.d
"),
driver: fileArray(env["D"], "dinifile.d dmdparams.d gluelayer.d lib.d libelf.d libmach.d libmscoff.d
link.d mars.d main.d scanelf.d scanmach.d scanmscoff.d timetrace.d vsoptions.d
driver: fileArray(env["D"], "dinifile.d dmdparams.d gluelayer.d lib/package.d lib/elf.d lib/mach.d lib/mscoff.d
link.d mars.d main.d lib/scanelf.d lib/scanmach.d lib/scanmscoff.d timetrace.d vsoptions.d
"),
frontend: fileArray(env["D"], "
access.d aggregate.d aliasthis.d argtypes_x86.d argtypes_sysv_x64.d argtypes_aarch64.d arrayop.d

View file

@ -199,13 +199,13 @@ Note that these groups have no strict meaning, the category assignments are a bi
| File | Purpose |
|-------------------------------------------------------------------------------|------------------------------------------------------|
| [lib.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/lib.d) | Abstract library class |
| [libelf.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/libelf.d) | Library in ELF format (Unix) |
| [libmach.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/libmach.d) | Library in Mach-O format (macOS) |
| [libmscoff.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/libmscoff.d) | Library in COFF format (32/64-bit Windows) |
| [scanelf.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/scanelf.d) | Extract symbol names from a library in ELF format |
| [scanmach.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/scanmach.d) | Extract symbol names from a library in Mach-O format |
| [scanmscoff.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/scanmscoff.d) | Extract symbol names from a library in COFF format |
| [lib/package.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/lib/package.d) | Abstract library class |
| [lib/elf.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/lib/elf.d) | Library in ELF format (Unix) |
| [lib/mach.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/lib/mach.d) | Library in Mach-O format (macOS) |
| [lib/mscoff.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/lib/mscoff.d) | Library in COFF format (32/64-bit Windows) |
| [lib/scanelf.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/lib/scanelf.d) | Extract symbol names from a library in ELF format |
| [lib/scanmach.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/lib/scanmach.d) | Extract symbol names from a library in Mach-O format |
| [lib/scanmscoff.d](https://github.com/dlang/dmd/blob/master/compiler/src/dmd/lib/scanmscoff.d) | Extract symbol names from a library in COFF format |
### Code generation / back-end interfacing

View file

@ -9,7 +9,7 @@
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/libelf.d
*/
module dmd.libelf;
module dmd.lib.elf;
import core.stdc.time;
import core.stdc.string;
@ -44,10 +44,10 @@ import dmd.root.rmem;
import dmd.root.string;
import dmd.root.stringtable;
import dmd.scanelf;
import dmd.lib.scanelf;
// Entry point (only public symbol in this module).
public extern (C++) Library LibElf_factory()
package(dmd.lib) extern (C++) Library LibElf_factory()
{
return new LibElf();
}

View file

@ -9,7 +9,7 @@
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/libmach.d
*/
module dmd.libmach;
module dmd.lib.mach;
import core.stdc.time;
import core.stdc.string;
@ -45,10 +45,10 @@ import dmd.root.rmem;
import dmd.root.string;
import dmd.root.stringtable;
import dmd.scanmach;
import dmd.lib.scanmach;
// Entry point (only public symbol in this module).
public extern (C++) Library LibMach_factory()
package(dmd.lib) extern (C++) Library LibMach_factory()
{
return new LibMach();
}

View file

@ -9,7 +9,7 @@
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/libmscoff.d
*/
module dmd.libmscoff;
module dmd.lib.mscoff;
import core.stdc.stdlib;
import core.stdc.string;
@ -46,10 +46,10 @@ import dmd.root.rmem;
import dmd.root.string;
import dmd.root.stringtable;
import dmd.scanmscoff;
import dmd.lib.scanmscoff;
// Entry point (only public symbol in this module).
public extern (C++) Library LibMSCoff_factory() @safe
package(dmd.lib) extern (C++) Library LibMSCoff_factory() @safe
{
return new LibMSCoff();
}

View file

@ -19,9 +19,9 @@ import dmd.errorsink;
import dmd.location;
import dmd.target : Target;
import dmd.libelf;
import dmd.libmach;
import dmd.libmscoff;
import dmd.lib.elf;
import dmd.lib.mach;
import dmd.lib.mscoff;
private enum LOG = false;

View file

@ -9,7 +9,7 @@
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/scanelf.d
*/
module dmd.scanelf;
module dmd.lib.scanelf;
import core.stdc.string;
import core.stdc.stdint;
@ -32,6 +32,7 @@ enum LOG = false;
* loc = location to use for error printing
* eSink = where the error messages go
*/
package(dmd.lib)
void scanElfObjModule(void delegate(const(char)[] name, int pickAny) nothrow pAddSymbol,
scope const ubyte[] base, const char* module_name, Loc loc, ErrorSink eSink)
{

View file

@ -9,7 +9,7 @@
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/scanmach.d
*/
module dmd.scanmach;
module dmd.lib.scanmach;
import core.stdc.string;
import core.stdc.stdint;
@ -34,6 +34,7 @@ private enum LOG = false;
* loc = location to use for error printing
* eSink = where the error messages go
*/
package(dmd.lib)
void scanMachObjModule(void delegate(const(char)[] name, int pickAny) nothrow pAddSymbol,
const ubyte[] base, const char* module_name, Loc loc, ErrorSink eSink)
{

View file

@ -9,7 +9,7 @@
* Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/scanmscoff.d
*/
module dmd.scanmscoff;
module dmd.lib.scanmscoff;
import core.stdc.stdio;
import core.stdc.string;
@ -33,6 +33,7 @@ private enum LOG = false;
* loc = location to use for error printing
* eSink = where the error messages go
*/
package(dmd.lib)
void scanMSCoffObjModule(void delegate(const(char)[] name, int pickAny) nothrow pAddSymbol,
scope const ubyte[] base, const char* module_name, Loc loc, ErrorSink eSink)
{

14
dub.sdl
View file

@ -123,16 +123,16 @@ subPackage {
iasmdmd,\
iasmgcc,\
irstate,\
lib,\
libelf,\
libmach,\
libmscoff,\
lib/package,\
lib/elf,\
lib/mach,\
lib/mscoff,\
lib/scanelf,\
lib/scanmach,\
lib/scanmscoff,\
link,\
objc_glue,\
s2ir,\
scanelf,\
scanmach,\
scanmscoff,\
tocsym,\
toctype,\
tocvdebug,\