Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
537bf54
Testing D to H tool
ibuclaw Aug 21, 2018
2910025
Use generated frontend.h in C++ test
ibuclaw Aug 21, 2018
24c841b
Remove unused and redundant dmd headers
ibuclaw Aug 21, 2018
2f3cdf7
Improve dtoh
thewilsonator Nov 18, 2018
638e186
Fix stuff
thewilsonator Nov 18, 2018
e537519
Add dtoh as a compiler switch
edi33416 Jun 4, 2019
8a64333
Update code after rebase
edi33416 Jun 4, 2019
453188f
Compile frontend srcs and write to flie
edi33416 Jun 14, 2019
f33421b
wip generate frontend.h
edi33416 Jun 18, 2019
ad4f6f2
Add dtoh enum test
edi33416 Jun 21, 2019
eb0e0b8
Add free functions dtoh test
edi33416 Jun 24, 2019
8b5ecfe
Add unittest block dtoh test
edi33416 Jun 24, 2019
6d4dca2
Add VarDeclaration dtoh test
edi33416 Jun 24, 2019
5b4ee56
Add AliasDeclaration dtoh test
edi33416 Jun 24, 2019
8cdb6a3
Add AnonDeclaration dtoh test
edi33416 Jun 24, 2019
e4d42a5
Add StructDeclaration dtoh test
edi33416 Jun 24, 2019
66cfd16
Add ClassDeclaration dtoh test
edi33416 Jun 24, 2019
1162314
Add TemplateDeclaration dtoh test
edi33416 Jun 24, 2019
645dcd7
Add debug prints
edi33416 Jul 4, 2019
63891de
Fix struct field void initializer
edi33416 Jul 4, 2019
416e6cd
Generate frontend header files and compile and run cxxfrontend test
edi33416 Jul 15, 2019
63a850d
Add ignoredModule tmp helper
edi33416 Jul 15, 2019
892ffe9
Add tmp workaround for alias forward decl and >> template issue
edi33416 Jul 15, 2019
dac9254
Add support for enum base type
edi33416 Jul 17, 2019
2bf8605
Add support for alignment of pow2
edi33416 Jul 30, 2019
aa240e6
Fix alignment issues
edi33416 Jul 30, 2019
7362bdf
Generate enums based on -extern-std version
edi33416 Jul 30, 2019
9a3ce62
Update tool auto-gen message
edi33416 Aug 21, 2019
7072bdc
Update tests
edi33416 Aug 21, 2019
d17d199
Fix outdated code in cxxfrontend test
edi33416 Aug 21, 2019
54e7e18
Code cleanup
edi33416 Aug 21, 2019
0ef5acf
CPP does not support covariant const methods
edi33416 Aug 23, 2019
77b584a
Correctly write ctor declarations
edi33416 Sep 2, 2019
a548da6
Generate default args for literals
edi33416 Sep 2, 2019
3e75514
Generate dtor and copy ctor declarations
edi33416 Oct 14, 2019
6e052f8
Rebase with master
edi33416 Oct 14, 2019
70b2f7f
Add compiler switch to cli.d
edi33416 Oct 22, 2019
ca370fb
Update tests
edi33416 Oct 22, 2019
1eba99b
Add support for @disable
edi33416 Oct 22, 2019
65b05f4
Improve default ctor generation
edi33416 Oct 22, 2019
c3f2a24
Cleanup cxxfrontend.c
edi33416 Oct 22, 2019
00d65f8
Update struct decl test
edi33416 Oct 23, 2019
144c85d
Use member initializer list for default ctor definition
edi33416 Oct 23, 2019
341de35
Add frontend.h dep to build.d
edi33416 Nov 14, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 49 additions & 3 deletions src/build.d
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ immutable rootDeps = [
&clean,
&checkwhitespace,
&runCxxUnittest,
&frontendH,
&detab,
&tolf,
&zip,
Expand Down Expand Up @@ -354,6 +355,51 @@ alias dmdDefault = makeDep!((builder, dep) => builder
.deps([dmdExe(null, null), dmdConf])
);

//alias frontendH = makeDep!((builder, dep) => builder
alias frontendH = makeDep!((builder, dep) {
//writeln("===");
//writeln(
//env["DMD_PATH"],
//"-I.",
//"-J" ~ env["G"],
//"-J../res",
//"-version=NoBackend",
//"-HCf=./frontend.h",
//"-c",
//.sources.frontend);
//writeln(env.keys());
//writeln(env["D"]);
//writeln(env["RES"]);
//writeln(.sources.lexer);
//writeln(.sources.lexer.filter!(s => s != "id.d"));
//writeln("===");

static string[] fileArray(string dir, string files)
{
return files.split.map!(e => dir.buildPath(e)).array;
}

auto lexerSRCS = fileArray(env["D"], "
console.d entity.d errors.d filecache.d globals.d identifier.d lexer.d tokens.d utf.d");

builder
.name("frontend.h")
.description("Generate frontend.h")
.deps([dmdDefault])
//.sources(.sources.frontendHeaders ~ .sources.dmd ~ .sources.root)
//.sources(.sources.frontend)
.command([
env["DMD_PATH"],
"-I.",
"-J" ~ env["G"],
"-J../res",
"-version=NoBackend",
"-HCf=./dmd/frontend.h",
"-c"].chain(.sources.frontend, lexerSRCS).array
);
//env["DMD_PATH"] = env["G"].buildPath("dmd").exeName;
});

/// Dependency to run the DMD unittest executable.
alias runDmdUnittest = makeDep!((builder, dep) {
auto dmdUnittestExe = dmdExe("-unittest", ["-version=NoMain", "-unittest", "-main"]);
Expand Down Expand Up @@ -384,7 +430,7 @@ alias runCxxUnittest = makeDep!((runCxxBuilder, runCxxDep) {
.name("cxx-unittest")
.description("Build the C++ unittests")
.msg("(DMD) CXX-UNITTEST")
.deps([lexer, backend, cxxFrontend])
.deps([lexer, backend, frontendH, cxxFrontend])
.sources(sources.dmd ~ sources.root)
.target(env["G"].buildPath("cxx-unittest").exeName)
.command([ env["HOST_DMD_RUN"], "-of=" ~ exeDep.target, "-vtls", "-J" ~ env["RES"],
Expand Down Expand Up @@ -1025,7 +1071,7 @@ auto sourceFiles()
cli.d clone.d compiler.d complex.d cond.d constfold.d cppmangle.d cppmanglewin.d ctfeexpr.d
ctorflow.d dcast.d dclass.d declaration.d delegatize.d denum.d dimport.d dinifile.d
dinterpret.d dmacro.d dmangle.d dmodule.d doc.d dscope.d dstruct.d dsymbol.d dsymbolsem.d
dtemplate.d dversion.d env.d escape.d expression.d expressionsem.d func.d hdrgen.d impcnvtab.d
dtemplate.d dtoh.d dversion.d env.d escape.d expression.d expressionsem.d func.d hdrgen.d impcnvtab.d
imphint.d init.d initsem.d inline.d inlinecost.d intrange.d json.d lambdacomp.d lib.d libelf.d
libmach.d libmscoff.d libomf.d link.d mars.d mtype.d nogc.d nspace.d objc.d opover.d optimize.d
parse.d parsetimevisitor.d permissivevisitor.d printast.d safe.d sapply.d scanelf.d scanmach.d
Expand All @@ -1037,7 +1083,7 @@ auto sourceFiles()
aggregate.h aliasthis.h arraytypes.h attrib.h compiler.h complex_t.h cond.h
ctfe.h declaration.h dsymbol.h doc.h enum.h errors.h expression.h globals.h hdrgen.h
identifier.h id.h import.h init.h json.h mangle.h module.h mtype.h nspace.h objc.h scope.h
statement.h staticassert.h target.h template.h tokens.h version.h visitor.h
statement.h staticassert.h target.h template.h tokens.h version.h visitor.h frontend.h
"),
lexer: fileArray(env["D"], "
console.d entity.d errors.d filecache.d globals.d id.d identifier.d lexer.d tokens.d utf.d
Expand Down
Loading