Added initial D2 support, D2 frontend and changes to codegen to make things compile.

This commit is contained in:
Tomas Lindquist Olsen
2008-11-11 01:38:48 +01:00
parent fe49ee6448
commit c4c1c1d72e
115 changed files with 83772 additions and 110 deletions

View File

@@ -41,37 +41,45 @@ io.write("Default target: '"..TRIPLE.."'\n");
X86_REVERSE_PARAMS = 1
X86_PASS_IN_EAX = 1
-- D version - don't change these !!!
DMDV1 = "1"
-- D version
DMDV2 = true
if DMDV2 then
DMD_V_DEF = "DMDV2=1"
DMD_DIR = "dmd2"
else
DMD_V_DEF = "DMDV1=1"
DMD_DIR = "dmd"
end
-- idgen
package = newpackage()
package.name = "idgen"
package.kind = "exe"
package.language = "c++"
package.files = { "dmd/idgen.c" }
package.files = { DMD_DIR.."/idgen.c" }
package.buildoptions = { "-x c++" }
package.postbuildcommands = { "./idgen", "mv -f id.c id.h dmd" }
package.defines = { "DMDV1="..DMDV1 }
package.postbuildcommands = { "./idgen", "mv -f id.c id.h "..DMD_DIR }
package.defines = { DMD_V_DEF }
-- impcnvgen
package = newpackage()
package.name = "impcnvgen"
package.kind = "exe"
package.language = "c++"
package.files = { "dmd/impcnvgen.c" }
package.files = { DMD_DIR.."/impcnvgen.c" }
package.buildoptions = { "-x c++" }
package.postbuildcommands = { "./impcnvgen", "mv -f impcnvtab.c dmd" }
package.defines = { "DMDV1="..DMDV1 }
package.postbuildcommands = { "./impcnvgen", "mv -f impcnvtab.c "..DMD_DIR }
package.defines = { DMD_V_DEF }
-- ldc
package = newpackage()
package.bindir = "bin"
package.name = "ldc"
package.name = DMDV2 and "ldc2" or "ldc"
package.kind = "exe"
package.language = "c++"
package.files = { matchfiles("dmd/*.c"), matchfiles("gen/*.cpp"), matchfiles("ir/*.cpp") }
package.excludes = { "dmd/idgen.c", "dmd/impcnvgen.c" }
package.files = { matchfiles(DMD_DIR.."/*.c"), matchfiles("gen/*.cpp"), matchfiles("ir/*.cpp") }
package.excludes = { DMD_DIR.."/idgen.c", DMD_DIR.."/impcnvgen.c" }
package.buildoptions = { "-x c++", "`llvm-config --cxxflags`" }
package.linkoptions = {
-- long but it's faster than just 'all'
@@ -81,19 +89,23 @@ package.linkoptions = {
package.defines = {
"IN_LLVM",
"_DH",
DMD_V_DEF,
"OPAQUE_VTBLS="..OPAQUE_VTBLS,
"USE_BOEHM_GC="..USE_BOEHM_GC,
"DMDV1="..DMDV1,
"POSIX="..POSIX,
"DEFAULT_TARGET_TRIPLE=\\\""..TRIPLE.."\\\"",
"X86_REVERSE_PARAMS="..X86_REVERSE_PARAMS,
"X86_PASS_IN_EAX="..X86_PASS_IN_EAX,
}
package.config.Release.defines = { "LLVMD_NO_LOGGER" }
package.config.Debug.buildoptions = { "-g -O0" }
--package.targetprefix = "llvm"
package.includepaths = { ".", "dmd" }
package.includepaths = { ".", DMD_DIR }
--package.postbuildcommands = { "cd runtime; ./build.sh; cd .." }
if USE_BOEHM_GC == 1 then
package.links = { "gc" }
end