First part of rename to LDC.

This commit is contained in:
Christian Kamm 2008-10-06 22:46:55 +02:00
parent 1fe1354a8a
commit 6eeeafdba6
47 changed files with 350 additions and 350 deletions

View file

@ -11,12 +11,12 @@ obj/*
tango tango
import import
Makefile Makefile
bin/llvmdc bin/ldc
idgen idgen
idgen.make idgen.make
impcnvgen impcnvgen
impcnvgen.make impcnvgen.make
llvmdc.make ldc.make
dmd/impcnvtab.c dmd/impcnvtab.c
tests/runminitest tests/runminitest
tests/findregressions tests/findregressions

View file

@ -291,7 +291,7 @@ void line(T...)(int x0, int y0, int x1, int y1, T p) {
} }
} }
import llvmdc.intrinsics; import ldc.intrinsics;
alias llvm_sqrt_f32 sqrt; alias llvm_sqrt_f32 sqrt;
alias llvm_sqrt_f64 sqrt; alias llvm_sqrt_f64 sqrt;
version(X86) version(X86)

View file

@ -1 +1 @@
use rebuild with -dc=llvmdc-posix to build the demos use rebuild with -dc=ldc-posix to build the demos

View file

@ -828,7 +828,7 @@ void PragmaDeclaration::semantic(Scope *sc)
} }
#endif #endif
// LLVMDC // LDC
#if IN_LLVM #if IN_LLVM
// pragma(intrinsic, "string") { funcdecl(s) } // pragma(intrinsic, "string") { funcdecl(s) }
@ -921,8 +921,8 @@ void PragmaDeclaration::semantic(Scope *sc)
llvm_internal = LLVMva_arg; llvm_internal = LLVMva_arg;
} }
// pragma(llvmdc, "string") { templdecl(s) } // pragma(ldc, "string") { templdecl(s) }
else if (ident == Id::llvmdc) else if (ident == Id::ldc)
{ {
Expression* expr = (Expression *)args->data[0]; Expression* expr = (Expression *)args->data[0];
expr = expr->semantic(sc); expr = expr->semantic(sc);
@ -942,7 +942,7 @@ void PragmaDeclaration::semantic(Scope *sc)
} }
} }
#endif // LLVMDC #endif // LDC
else if (global.params.ignoreUnsupportedPragmas) else if (global.params.ignoreUnsupportedPragmas)
{ {
@ -982,14 +982,14 @@ void PragmaDeclaration::semantic(Scope *sc)
s->semantic(sc); s->semantic(sc);
// LLVMDC // LDC
#if IN_LLVM #if IN_LLVM
if (llvm_internal) if (llvm_internal)
{ {
if (s->llvmInternal) if (s->llvmInternal)
{ {
error("multiple LLVMDC specific pragmas not allowed not affect the same declaration ('%s' at '%s')", s->toChars(), s->loc.toChars()); error("multiple LDC specific pragmas not allowed not affect the same declaration ('%s' at '%s')", s->toChars(), s->loc.toChars());
fatal(); fatal();
} }
switch(llvm_internal) switch(llvm_internal)
@ -1070,11 +1070,11 @@ void PragmaDeclaration::semantic(Scope *sc)
break; break;
default: default:
warning("the LLVMDC specific pragma '%s' is not yet implemented, ignoring", ident->toChars()); warning("the LDC specific pragma '%s' is not yet implemented, ignoring", ident->toChars());
} }
} }
#endif // LLVMDC #endif // LDC
} }
} }

View file

@ -329,7 +329,7 @@ struct TypeInfoDeclaration : VarDeclaration
virtual TypeInfoDeclaration* isTypeInfoDeclaration() { return this; } virtual TypeInfoDeclaration* isTypeInfoDeclaration() { return this; }
// LLVMDC // LDC
virtual void llvmDeclare(); virtual void llvmDeclare();
virtual void llvmDefine(); virtual void llvmDefine();
}; };
@ -340,7 +340,7 @@ struct TypeInfoStructDeclaration : TypeInfoDeclaration
void toDt(dt_t **pdt); void toDt(dt_t **pdt);
// LLVMDC // LDC
void llvmDeclare(); void llvmDeclare();
void llvmDefine(); void llvmDefine();
}; };
@ -351,7 +351,7 @@ struct TypeInfoClassDeclaration : TypeInfoDeclaration
void toDt(dt_t **pdt); void toDt(dt_t **pdt);
// LLVMDC // LDC
void llvmDeclare(); void llvmDeclare();
void llvmDefine(); void llvmDefine();
}; };
@ -362,7 +362,7 @@ struct TypeInfoInterfaceDeclaration : TypeInfoDeclaration
void toDt(dt_t **pdt); void toDt(dt_t **pdt);
// LLVMDC // LDC
void llvmDeclare(); void llvmDeclare();
void llvmDefine(); void llvmDefine();
}; };
@ -373,7 +373,7 @@ struct TypeInfoTypedefDeclaration : TypeInfoDeclaration
void toDt(dt_t **pdt); void toDt(dt_t **pdt);
// LLVMDC // LDC
void llvmDeclare(); void llvmDeclare();
void llvmDefine(); void llvmDefine();
}; };
@ -384,7 +384,7 @@ struct TypeInfoPointerDeclaration : TypeInfoDeclaration
void toDt(dt_t **pdt); void toDt(dt_t **pdt);
// LLVMDC // LDC
void llvmDeclare(); void llvmDeclare();
void llvmDefine(); void llvmDefine();
}; };
@ -395,7 +395,7 @@ struct TypeInfoArrayDeclaration : TypeInfoDeclaration
void toDt(dt_t **pdt); void toDt(dt_t **pdt);
// LLVMDC // LDC
void llvmDeclare(); void llvmDeclare();
void llvmDefine(); void llvmDefine();
}; };
@ -406,7 +406,7 @@ struct TypeInfoStaticArrayDeclaration : TypeInfoDeclaration
void toDt(dt_t **pdt); void toDt(dt_t **pdt);
// LLVMDC // LDC
void llvmDeclare(); void llvmDeclare();
void llvmDefine(); void llvmDefine();
}; };
@ -417,7 +417,7 @@ struct TypeInfoAssociativeArrayDeclaration : TypeInfoDeclaration
void toDt(dt_t **pdt); void toDt(dt_t **pdt);
// LLVMDC // LDC
void llvmDeclare(); void llvmDeclare();
void llvmDefine(); void llvmDefine();
}; };
@ -428,7 +428,7 @@ struct TypeInfoEnumDeclaration : TypeInfoDeclaration
void toDt(dt_t **pdt); void toDt(dt_t **pdt);
// LLVMDC // LDC
void llvmDeclare(); void llvmDeclare();
void llvmDefine(); void llvmDefine();
}; };
@ -439,7 +439,7 @@ struct TypeInfoFunctionDeclaration : TypeInfoDeclaration
void toDt(dt_t **pdt); void toDt(dt_t **pdt);
// LLVMDC // LDC
void llvmDeclare(); void llvmDeclare();
void llvmDefine(); void llvmDefine();
}; };
@ -450,7 +450,7 @@ struct TypeInfoDelegateDeclaration : TypeInfoDeclaration
void toDt(dt_t **pdt); void toDt(dt_t **pdt);
// LLVMDC // LDC
void llvmDeclare(); void llvmDeclare();
void llvmDefine(); void llvmDefine();
}; };
@ -461,7 +461,7 @@ struct TypeInfoTupleDeclaration : TypeInfoDeclaration
void toDt(dt_t **pdt); void toDt(dt_t **pdt);
// LLVMDC // LDC
void llvmDeclare(); void llvmDeclare();
void llvmDefine(); void llvmDefine();
}; };
@ -473,7 +473,7 @@ struct TypeInfoConstDeclaration : TypeInfoDeclaration
void toDt(dt_t **pdt); void toDt(dt_t **pdt);
// LLVMDC // LDC
void llvmDeclare(); void llvmDeclare();
void llvmDefine(); void llvmDefine();
}; };
@ -484,7 +484,7 @@ struct TypeInfoInvariantDeclaration : TypeInfoDeclaration
void toDt(dt_t **pdt); void toDt(dt_t **pdt);
// LLVMDC // LDC
void llvmDeclare(); void llvmDeclare();
void llvmDefine(); void llvmDefine();
}; };
@ -624,7 +624,7 @@ struct FuncDeclaration : Declaration
const char *kind(); const char *kind();
void toDocBuffer(OutBuffer *buf); void toDocBuffer(OutBuffer *buf);
// LLVMDC: give argument types to runtime functions // LDC: give argument types to runtime functions
static FuncDeclaration *genCfunc(Arguments *args, Type *treturn, char *name); static FuncDeclaration *genCfunc(Arguments *args, Type *treturn, char *name);
static FuncDeclaration *genCfunc(Arguments *args, Type *treturn, Identifier *id); static FuncDeclaration *genCfunc(Arguments *args, Type *treturn, Identifier *id);
@ -635,7 +635,7 @@ struct FuncDeclaration : Declaration
FuncDeclaration *isFuncDeclaration() { return this; } FuncDeclaration *isFuncDeclaration() { return this; }
// llvmdc stuff // LDC stuff
// vars declared in this function that nested funcs reference // vars declared in this function that nested funcs reference
// is this is not empty, nestedFrameRef is set and these VarDecls // is this is not empty, nestedFrameRef is set and these VarDecls

View file

@ -176,7 +176,7 @@ Identifier *Id::vastart;
Identifier *Id::vacopy; Identifier *Id::vacopy;
Identifier *Id::vaend; Identifier *Id::vaend;
Identifier *Id::vaarg; Identifier *Id::vaarg;
Identifier *Id::llvmdc; Identifier *Id::ldc;
Identifier *Id::tohash; Identifier *Id::tohash;
Identifier *Id::tostring; Identifier *Id::tostring;
Identifier *Id::main; Identifier *Id::main;
@ -358,7 +358,7 @@ void Id::initialize()
vacopy = Lexer::idPool("va_copy"); vacopy = Lexer::idPool("va_copy");
vaend = Lexer::idPool("va_end"); vaend = Lexer::idPool("va_end");
vaarg = Lexer::idPool("va_arg"); vaarg = Lexer::idPool("va_arg");
llvmdc = Lexer::idPool("llvmdc"); ldc = Lexer::idPool("ldc");
tohash = Lexer::idPool("toHash"); tohash = Lexer::idPool("toHash");
tostring = Lexer::idPool("toString"); tostring = Lexer::idPool("toString");
main = Lexer::idPool("main"); main = Lexer::idPool("main");

View file

@ -178,7 +178,7 @@ struct Id
static Identifier *vacopy; static Identifier *vacopy;
static Identifier *vaend; static Identifier *vaend;
static Identifier *vaarg; static Identifier *vaarg;
static Identifier *llvmdc; static Identifier *ldc;
static Identifier *tohash; static Identifier *tohash;
static Identifier *tostring; static Identifier *tostring;
static Identifier *main; static Identifier *main;

View file

@ -213,7 +213,7 @@ Msgtable msgtable[] =
{ "lib" }, { "lib" },
{ "msg" }, { "msg" },
// LLVMDC pragma's // LDC pragma's
{ "intrinsic" }, { "intrinsic" },
{ "va_intrinsic" }, { "va_intrinsic" },
{ "no_typeinfo" }, { "no_typeinfo" },
@ -223,7 +223,7 @@ Msgtable msgtable[] =
{ "vacopy", "va_copy" }, { "vacopy", "va_copy" },
{ "vaend", "va_end" }, { "vaend", "va_end" },
{ "vaarg", "va_arg" }, { "vaarg", "va_arg" },
{ "llvmdc" }, { "ldc" },
// For special functions // For special functions
{ "tohash", "toHash" }, { "tohash", "toHash" },

View file

@ -51,7 +51,7 @@ Global::Global()
doc_ext = "html"; doc_ext = "html";
ddoc_ext = "ddoc"; ddoc_ext = "ddoc";
// LLVMDC // LDC
obj_ext = "bc"; obj_ext = "bc";
ll_ext = "ll"; ll_ext = "ll";
bc_ext = "bc"; bc_ext = "bc";
@ -66,7 +66,7 @@ Global::Global()
copyright = "Copyright (c) 1999-2008 by Digital Mars and Tomas Lindquist Olsen"; copyright = "Copyright (c) 1999-2008 by Digital Mars and Tomas Lindquist Olsen";
written = "written by Walter Bright and Tomas Lindquist Olsen"; written = "written by Walter Bright and Tomas Lindquist Olsen";
version = "v1.035"; version = "v1.035";
llvmdc_version = "0.1"; ldc_version = "0.1";
global.structalign = 8; global.structalign = 8;
memset(&params, 0, sizeof(Param)); memset(&params, 0, sizeof(Param));
@ -154,12 +154,12 @@ extern void backend_term();
void usage() void usage()
{ {
printf("LLVM D Compiler %s (based on DMD %s and LLVM 2.4svn)\n%s\n%s\n", printf("LLVM D Compiler %s (based on DMD %s and LLVM 2.4svn)\n%s\n%s\n",
global.llvmdc_version, global.version, global.copyright, global.written); global.ldc_version, global.version, global.copyright, global.written);
printf("\ printf("\
D Language Documentation: http://www.digitalmars.com/d/1.0/index.html\n\ D Language Documentation: http://www.digitalmars.com/d/1.0/index.html\n\
LLVMDC Homepage: http://www.dsource.org/projects/llvmdc\n\ LDC Homepage: http://www.dsource.org/projects/llvmdc\n\
Usage:\n\ Usage:\n\
llvmdc files.d ... { -switch }\n\ ldc files.d ... { -switch }\n\
\n\ \n\
files.d D source files\n%s\ files.d D source files\n%s\
-of<filename> name output file to <filename>\n\ -of<filename> name output file to <filename>\n\
@ -321,7 +321,7 @@ int main(int argc, char *argv[])
// Predefine version identifiers // Predefine version identifiers
#if IN_LLVM #if IN_LLVM
VersionCondition::addPredefinedGlobalIdent("LLVM"); VersionCondition::addPredefinedGlobalIdent("LLVM");
VersionCondition::addPredefinedGlobalIdent("LLVMDC"); VersionCondition::addPredefinedGlobalIdent("LDC");
#endif #endif
// setup default target os to be build os // setup default target os to be build os
@ -343,9 +343,9 @@ int main(int argc, char *argv[])
VersionCondition::addPredefinedGlobalIdent("all"); VersionCondition::addPredefinedGlobalIdent("all");
#if _WIN32 #if _WIN32
inifile(global.params.argv0, "llvmdc.ini"); inifile(global.params.argv0, "ldc.ini");
#elif POSIX #elif POSIX
inifile(global.params.argv0, "llvmdc.conf"); inifile(global.params.argv0, "ldc.conf");
#else #else
#error #error
#endif #endif
@ -716,7 +716,7 @@ int main(int argc, char *argv[])
{ {
char *arg; char *arg;
arg = (char *)mem.malloc(64); arg = (char *)mem.malloc(64);
strcpy(arg, "-lllvmdc-runtime"); strcpy(arg, "-lldc-runtime");
global.params.linkswitches->push(arg); global.params.linkswitches->push(arg);
arg = (char *)mem.malloc(64); arg = (char *)mem.malloc(64);
strcpy(arg, "-ltango-cc-tango"); strcpy(arg, "-ltango-cc-tango");

View file

@ -37,7 +37,7 @@
struct Array; struct Array;
// LLVMDC // LDC
enum ARCH enum ARCH
{ {
ARCHinvalid, ARCHinvalid,
@ -139,7 +139,7 @@ struct Param
char *resfile; char *resfile;
char *exefile; char *exefile;
// LLVMDC stuff // LDC stuff
char *llvmArch; char *llvmArch;
char forceBE; char forceBE;
char *tt_arch; char *tt_arch;
@ -170,7 +170,7 @@ struct Global
Array *filePath; // Array of char*'s which form the file import lookup path Array *filePath; // Array of char*'s which form the file import lookup path
int structalign; int structalign;
char *version; char *version;
char *llvmdc_version; char *ldc_version;
Param params; Param params;
unsigned errors; // number of errors reported so far unsigned errors; // number of errors reported so far

View file

@ -98,7 +98,7 @@ enum TY
Ttuple, Ttuple,
Tslice, Tslice,
// LLVMDC // LDC
Topaque, Topaque,
TMAX TMAX
@ -177,7 +177,7 @@ struct Type : Object
static ClassDeclaration *typeinfodelegate; static ClassDeclaration *typeinfodelegate;
static ClassDeclaration *typeinfotypelist; static ClassDeclaration *typeinfotypelist;
// LLVMDC, for runtime function signatures that contain // LDC, for runtime function signatures that contain
// AAs or arrays of unknown type // AAs or arrays of unknown type
static Type* topaque; static Type* topaque;
@ -260,7 +260,7 @@ struct Type : Object
// For eliminating dynamic_cast // For eliminating dynamic_cast
virtual TypeBasic *isTypeBasic(); virtual TypeBasic *isTypeBasic();
// llvmdc // LDC
IrType ir; IrType ir;
}; };
@ -389,7 +389,7 @@ struct TypePointer : Type
void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod);
MATCH implicitConvTo(Type *to); MATCH implicitConvTo(Type *to);
int isscalar(); int isscalar();
// LLVMDC: pointers are unsigned // LDC: pointers are unsigned
int isunsigned() { return TRUE; }; int isunsigned() { return TRUE; };
Expression *defaultInit(Loc loc); Expression *defaultInit(Loc loc);
int isZeroInit(); int isZeroInit();
@ -441,7 +441,7 @@ struct TypeFunction : Type
unsigned totym(); unsigned totym();
// LLVMDC // LDC
bool retInPtr; bool retInPtr;
bool usesThis; bool usesThis;
bool usesNest; bool usesNest;
@ -674,7 +674,7 @@ struct TypeSlice : Type
void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod);
}; };
//LLVMDC //LDC
struct TypeOpaque : Type struct TypeOpaque : Type
{ {
TypeOpaque() : Type(Topaque, NULL) {} TypeOpaque() : Type(Topaque, NULL) {}
@ -704,7 +704,7 @@ struct Argument : Object
static size_t dim(Arguments *arguments); static size_t dim(Arguments *arguments);
static Argument *getNth(Arguments *arguments, size_t nth, size_t *pn = NULL); static Argument *getNth(Arguments *arguments, size_t nth, size_t *pn = NULL);
// LLVMDC // LDC
unsigned llvmAttrs; unsigned llvmAttrs;
}; };

View file

@ -9,5 +9,5 @@ enum
LLVMva_copy, LLVMva_copy,
LLVMva_end, LLVMva_end,
LLVMva_arg, LLVMva_arg,
LLVMllvmdc LLVMldc
}; };

View file

@ -21,7 +21,7 @@ void linkModules(llvm::Module* dst, const Module_vector& MV)
if (MV.empty()) if (MV.empty())
return; return;
llvm::Linker linker("llvmdc", dst); llvm::Linker linker("ldc", dst);
std::string err; std::string err;
for (Module_vector::const_iterator i=MV.begin(); i!=MV.end(); ++i) for (Module_vector::const_iterator i=MV.begin(); i!=MV.end(); ++i)

View file

@ -10,7 +10,7 @@ using namespace llvm;
// this function runs some or all of the std-compile-opts passes depending on the // this function runs some or all of the std-compile-opts passes depending on the
// optimization level given. // optimization level given.
void llvmdc_optimize_module(Module* m, char lvl, bool doinline) void ldc_optimize_module(Module* m, char lvl, bool doinline)
{ {
if (!doinline && lvl < 0) if (!doinline && lvl < 0)
return; return;

View file

@ -153,7 +153,7 @@ static const LLType* rt_dg2()
static void LLVM_D_BuildRuntimeModule() static void LLVM_D_BuildRuntimeModule()
{ {
M = new llvm::Module("llvmdc internal runtime"); M = new llvm::Module("ldc internal runtime");
const LLType* voidTy = LLType::VoidTy; const LLType* voidTy = LLType::VoidTy;
const LLType* boolTy = LLType::Int1Ty; const LLType* boolTy = LLType::Int1Ty;

View file

@ -140,7 +140,7 @@ static LLGlobalVariable* dwarfCompileUnit(Module* m)
if (srcpath.empty()) if (srcpath.empty())
srcpath = llvm::sys::Path::GetCurrentDirectory().toString(); srcpath = llvm::sys::Path::GetCurrentDirectory().toString();
vals[4] = DtoConstStringPtr(srcpath.c_str(), "llvm.metadata"); vals[4] = DtoConstStringPtr(srcpath.c_str(), "llvm.metadata");
vals[5] = DtoConstStringPtr("LLVMDC (http://www.dsource.org/projects/llvmdc)", "llvm.metadata"); vals[5] = DtoConstStringPtr("LDC (http://www.dsource.org/projects/llvmdc)", "llvm.metadata");
LLGlobalVariable* gv = emitDwarfGlobal(getDwarfCompileUnitType(), vals, "llvm.dbg.compile_unit"); LLGlobalVariable* gv = emitDwarfGlobal(getDwarfCompileUnitType(), vals, "llvm.dbg.compile_unit");
m->ir.irModule->dwarfCompileUnit = gv; m->ir.irModule->dwarfCompileUnit = gv;

View file

@ -49,7 +49,7 @@
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// in gen/optimize.cpp // in gen/optimize.cpp
void llvmdc_optimize_module(llvm::Module* m, char lvl, bool doinline); void ldc_optimize_module(llvm::Module* m, char lvl, bool doinline);
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
@ -152,7 +152,7 @@ void Module::genobjfile(int multiobj)
} }
// run optimizer // run optimizer
llvmdc_optimize_module(ir.module, global.params.optimizeLevel, global.params.llvmInline); ldc_optimize_module(ir.module, global.params.optimizeLevel, global.params.llvmInline);
// verify the llvm // verify the llvm
if (!global.params.novalidate && (global.params.optimizeLevel >= 0 || global.params.llvmInline)) { if (!global.params.novalidate && (global.params.optimizeLevel >= 0 || global.params.llvmInline)) {

View file

@ -8,7 +8,7 @@
// in artistic.txt, or the GNU General Public License in gnu.txt. // in artistic.txt, or the GNU General Public License in gnu.txt.
// See the included readme.txt for details. // See the included readme.txt for details.
// Modifications for LLVMDC: // Modifications for LDC:
// Copyright (c) 2007 by Tomas Lindquist Olsen // Copyright (c) 2007 by Tomas Lindquist Olsen
// tomas at famolsen dk // tomas at famolsen dk
@ -234,7 +234,7 @@ int TypeDArray::builtinTypeInfo()
Expression *createTypeInfoArray(Scope *sc, Expression *exps[], int dim) Expression *createTypeInfoArray(Scope *sc, Expression *exps[], int dim)
{ {
assert(0); // done elsewhere in llvmdc assert(0); // done elsewhere in LDC
return NULL; return NULL;
} }

View file

@ -1,14 +1,14 @@
ignore=object ignore=object
compiler=llvmdc compiler=ldc
inifile=llvmdc.conf inifile=ldc.conf
exeext= exeext=
objext=bc objext=bc
version=LLVM version=LLVM
version=LLVMDC version=LDC
noversion=DigitalMars noversion=DigitalMars
noversion=GNU noversion=GNU
testversion=linux testversion=linux
@ -37,7 +37,7 @@ testversion=PIC
[compile] [compile]
cmd=llvmdc -c $i cmd=ldc -c $i
flag=$i flag=$i
incdir=-I$i incdir=-I$i
@ -48,7 +48,7 @@ version=-version=$i
[link] [link]
oneatatime=yes oneatatime=yes
cmd=llvmdc $i -of$o cmd=ldc $i -of$o
libdir=-L-L=$i libdir=-L-L=$i
lib=-L-l=$i lib=-L-l=$i

View file

@ -5,100 +5,100 @@ mkdir -p obj
rm -f obj/*.bc rm -f obj/*.bc
rm -f ../lib/*.bc rm -f ../lib/*.bc
LLVMDCFLAGS_ASM="-c -oq -release" LDCFLAGS_ASM="-c -oq -release"
LLVMDCFLAGS="$LLVMDCFLAGS_ASM -noasm" LDCFLAGS="$LDCFLAGS_ASM -noasm"
echo "compiling contract runtime" echo "compiling contract runtime"
llvmdc internal/contract.d -c -of../lib/llvmdcore.bc || exit 1 #-noruntime || exit 1 ldc internal/contract.d -c -of../lib/ldcore.bc || exit 1 #-noruntime || exit 1
echo "compiling common runtime" echo "compiling common runtime"
./llvmdc-build internal/arrays.d \ ./ldc-build internal/arrays.d \
internal/mem.d \ internal/mem.d \
internal/critical.d \ internal/critical.d \
internal/dmain2.d \ internal/dmain2.d \
internal/inv.d \ internal/inv.d \
$LLVMDCFLAGS_ASM || exit 1 $LDCFLAGS_ASM || exit 1
mv *.bc obj mv *.bc obj
llvm-link -f -o=../lib/llvmdcore.bc obj/internal.*.bc ../lib/llvmdcore.bc llvm-link -f -o=../lib/ldcore.bc obj/internal.*.bc ../lib/ldcore.bc
echo "compiling typeinfo 1" echo "compiling typeinfo 1"
./llvmdc-build typeinfos1.d $LLVMDCFLAGS || exit 1 ./ldc-build typeinfos1.d $LDCFLAGS || exit 1
mv *.bc obj mv *.bc obj
llvm-link -f -o=../lib/llvmdcore.bc `ls obj/typeinfo1.*.bc` ../lib/llvmdcore.bc || exit 1 llvm-link -f -o=../lib/ldcore.bc `ls obj/typeinfo1.*.bc` ../lib/ldcore.bc || exit 1
echo "compiling typeinfo 2" echo "compiling typeinfo 2"
./llvmdc-build typeinfos2.d $LLVMDCFLAGS || exit 1 ./ldc-build typeinfos2.d $LDCFLAGS || exit 1
mv *.bc obj mv *.bc obj
llvm-link -f -o=../lib/llvmdcore.bc `ls obj/typeinfo2.*.bc` ../lib/llvmdcore.bc || exit 1 llvm-link -f -o=../lib/ldcore.bc `ls obj/typeinfo2.*.bc` ../lib/ldcore.bc || exit 1
echo "compiling exceptions" echo "compiling exceptions"
./llvmdc-build internal/eh.d $LLVMDCFLAGS -debug || exit 1 ./ldc-build internal/eh.d $LDCFLAGS -debug || exit 1
mv *.bc obj mv *.bc obj
llvm-link -f -o=../lib/llvmdcore.bc obj/*eh.bc ../lib/llvmdcore.bc || exit 1 llvm-link -f -o=../lib/ldcore.bc obj/*eh.bc ../lib/ldcore.bc || exit 1
echo "compiling object/interface casting runtime support" echo "compiling object/interface casting runtime support"
llvmdc internal/cast.d $LLVMDCFLAGS || exit 1 ldc internal/cast.d $LDCFLAGS || exit 1
mv *.bc obj mv *.bc obj
llvm-link -f -o=../lib/llvmdcore.bc obj/cast.bc ../lib/llvmdcore.bc || exit 1 llvm-link -f -o=../lib/ldcore.bc obj/cast.bc ../lib/ldcore.bc || exit 1
echo "compiling string foreach/switch runtime support" echo "compiling string foreach/switch runtime support"
llvmdc internal/aApply.d $LLVMDCFLAGS || exit 1 ldc internal/aApply.d $LDCFLAGS || exit 1
llvmdc internal/aApplyR.d $LLVMDCFLAGS || exit 1 ldc internal/aApplyR.d $LDCFLAGS || exit 1
llvmdc internal/switch.d $LLVMDCFLAGS || exit 1 ldc internal/switch.d $LDCFLAGS || exit 1
mv *.bc obj mv *.bc obj
llvm-link -f -o=../lib/llvmdcore.bc obj/aApply.bc obj/aApplyR.bc obj/switch.bc ../lib/llvmdcore.bc || exit 1 llvm-link -f -o=../lib/ldcore.bc obj/aApply.bc obj/aApplyR.bc obj/switch.bc ../lib/ldcore.bc || exit 1
echo "compiling array runtime support" echo "compiling array runtime support"
llvmdc internal/qsort2.d internal/adi.d internal/aaA.d $LLVMDCFLAGS || exit 1 ldc internal/qsort2.d internal/adi.d internal/aaA.d $LDCFLAGS || exit 1
mv *.bc obj mv *.bc obj
llvm-link -f -o=../lib/llvmdcore.bc obj/qsort2.bc obj/adi.bc obj/aaA.bc ../lib/llvmdcore.bc || exit 1 llvm-link -f -o=../lib/ldcore.bc obj/qsort2.bc obj/adi.bc obj/aaA.bc ../lib/ldcore.bc || exit 1
echo "compiling object implementation" echo "compiling object implementation"
llvmdc internal/objectimpl.d $LLVMDCFLAGS || exit 1 ldc internal/objectimpl.d $LDCFLAGS || exit 1
mv object.bc objectimpl.bc mv object.bc objectimpl.bc
mv *.bc obj mv *.bc obj
llvm-link -f -o=../lib/llvmdcore.bc obj/objectimpl.bc ../lib/llvmdcore.bc || exit 1 llvm-link -f -o=../lib/ldcore.bc obj/objectimpl.bc ../lib/ldcore.bc || exit 1
echo "compiling crc32" echo "compiling crc32"
llvmdc crc32.d $LLVMDCFLAGS || exit 1 ldc crc32.d $LDCFLAGS || exit 1
mv *.bc obj mv *.bc obj
llvm-link -f -o=../lib/llvmdcore.bc ../lib/llvmdcore.bc obj/crc32.bc || exit 1 llvm-link -f -o=../lib/ldcore.bc ../lib/ldcore.bc obj/crc32.bc || exit 1
echo "compiling llvm runtime support" echo "compiling llvm runtime support"
# ./llvmdc-build llvmsupport.d $LLVMDCFLAGS || exit 1 # ./ldc-build llvmsupport.d $LDCFLAGS || exit 1
llvmdc llvmsupport.d -oq -c || exit 1 ldc llvmsupport.d -oq -c || exit 1
mv *.bc obj mv *.bc obj
llvm-link -f -o=../lib/llvmdcore.bc `ls obj/llvm*.bc` ../lib/llvmdcore.bc || exit 1 llvm-link -f -o=../lib/ldcore.bc `ls obj/llvm*.bc` ../lib/ldcore.bc || exit 1
echo "compiling garbage collector" echo "compiling garbage collector"
cd gc cd gc
llvmdc $(ls *.d |grep -v win32) $LLVMDCFLAGS_ASM -I.. ||exit 1 ldc $(ls *.d |grep -v win32) $LDCFLAGS_ASM -I.. ||exit 1
# llvmdc gclinux.d $LLVMDCFLAGS -I.. || exit 1 # ldc gclinux.d $LDCFLAGS -I.. || exit 1
# llvmdc gcx.d $LLVMDCFLAGS -I.. || exit 1 # ldc gcx.d $LDCFLAGS -I.. || exit 1
# llvmdc gcbits.d $LLVMDCFLAGS -I.. || exit 1 # ldc gcbits.d $LDCFLAGS -I.. || exit 1
# llvmdc gc.d -oq -c -I.. || exit 1 # ldc gc.d -oq -c -I.. || exit 1
mv std.gc.bc std_gc.bc mv std.gc.bc std_gc.bc
mv *.bc ../obj mv *.bc ../obj
# mv -v obj/*.bc ../obj # mv -v obj/*.bc ../obj
cd .. cd ..
llvm-link -f -o=../lib/llvmdcore.bc obj/gclinux.bc obj/gcx.bc obj/gcbits.bc obj/std_gc.bc ../lib/llvmdcore.bc || exit 1 llvm-link -f -o=../lib/ldcore.bc obj/gclinux.bc obj/gcx.bc obj/gcbits.bc obj/std_gc.bc ../lib/ldcore.bc || exit 1
echo "compiling phobos" echo "compiling phobos"
./llvmdc-build phobos.d $LLVMDCFLAGS || exit 1 ./ldc-build phobos.d $LDCFLAGS || exit 1
mv *.bc obj mv *.bc obj
echo "linking phobos" echo "linking phobos"
# llvm-link -f -o=../lib/llvmdcore.bc `ls obj/std.*.bc` ../lib/llvmdcore.bc || exit 1 # llvm-link -f -o=../lib/ldcore.bc `ls obj/std.*.bc` ../lib/ldcore.bc || exit 1
for i in $(ls obj/std.*.bc); do for i in $(ls obj/std.*.bc); do
echo $i echo $i
llvm-link -f -o=../lib/llvmdcore.bc ../lib/llvmdcore.bc $i || exit 1 llvm-link -f -o=../lib/ldcore.bc ../lib/ldcore.bc $i || exit 1
done done
echo "Compiling auxiliary" echo "Compiling auxiliary"
./llvmdc-build etc/c/zlib.d $LLVMDCFLAGS || exit 1 ./ldc-build etc/c/zlib.d $LDCFLAGS || exit 1
mv *.bc obj mv *.bc obj
llvm-link -f -o=../lib/llvmdcore.bc `ls obj/etc.*.bc` ../lib/llvmdcore.bc || exit 1 llvm-link -f -o=../lib/ldcore.bc `ls obj/etc.*.bc` ../lib/ldcore.bc || exit 1
echo "optimizing" echo "optimizing"
opt -stats -p -f -std-compile-opts -o=../lib/llvmdcore.bc ../lib/llvmdcore.bc || exit 1 opt -stats -p -f -std-compile-opts -o=../lib/ldcore.bc ../lib/ldcore.bc || exit 1
echo "SUCCESS" echo "SUCCESS"

View file

@ -1,9 +1,9 @@
#!/bin/sh #!/bin/sh
export PATH=$PATH:/opt/llvm/bin export PATH=$PATH:/opt/llvm/bin
export FILE=$1; shift export FILE=$1; shift
export LLVMDC_PATH=~/llvmdc export LDC_PATH=~/ldc
PARAM=$(for p_file in $($LLVMDC_PATH/bin/llvmdc $FILE -I~/llvmdc/lphobos -c -v -of/dev/null |grep import \ PARAM=$(for p_file in $($LDC_PATH/bin/ldc $FILE -I~/ldc/lphobos -c -v -of/dev/null |grep import \
|sed -e "s/import *//" -e "s/\t.*//" \ |sed -e "s/import *//" -e "s/\t.*//" \
|sed -e "s/\./\//g" -e "s/$/\.d/"); do if [ -f $p_file ]; then echo $p_file; fi; done) |sed -e "s/\./\//g" -e "s/$/\.d/"); do if [ -f $p_file ]; then echo $p_file; fi; done)
echo llvmdc $FILE $@ $PARAM echo ldc $FILE $@ $PARAM
$LLVMDC_PATH/bin/llvmdc $FILE $@ $PARAM $LDC_PATH/bin/ldc $FILE $@ $PARAM

View file

@ -1,4 +1,4 @@
project.name = llvmdc project.name = ldc
-- options -- options
@ -44,10 +44,10 @@ package.buildoptions = { "-x c++" }
package.postbuildcommands = { "./impcnvgen", "mv -f impcnvtab.c dmd" } package.postbuildcommands = { "./impcnvgen", "mv -f impcnvtab.c dmd" }
package.defines = { "DMDV1="..DMDV1 } package.defines = { "DMDV1="..DMDV1 }
-- llvmdc -- ldc
package = newpackage() package = newpackage()
package.bindir = "bin" package.bindir = "bin"
package.name = "llvmdc" package.name = "ldc"
package.kind = "exe" package.kind = "exe"
package.language = "c++" package.language = "c++"
package.files = { matchfiles("dmd/*.c"), matchfiles("gen/*.cpp"), matchfiles("ir/*.cpp") } package.files = { matchfiles("dmd/*.c"), matchfiles("gen/*.cpp"), matchfiles("ir/*.cpp") }

View file

@ -1,8 +1,8 @@
LLVM D Compiler (LLVMDC) LLVM D Compiler (LDC)
This compiler is based on the Digital Mars D (DMD) compiler frontend, and This compiler is based on the Digital Mars D (DMD) compiler frontend, and
the LLVM compiler toolkit. See LICENSE for licensing information. the LLVM compiler toolkit. See LICENSE for licensing information.
For more information, including build instructions, visit the LLVMDC website: For more information, including build instructions, visit the LDC website:
http://www.dsource.org/projects/llvmdc http://www.dsource.org/projects/llvmdc

View file

@ -1,4 +1,4 @@
1) Do a checkout of tango trunk in the llvmdc root dir (along dmd, gen, runtime etc). 1) Do a checkout of tango trunk in the ldc root dir (along dmd, gen, runtime etc).
* svn co http://svn.dsource.org/projects/tango/trunk ../tango * svn co http://svn.dsource.org/projects/tango/trunk ../tango

View file

@ -3,21 +3,21 @@
# I'm no good bash scripter ... # I'm no good bash scripter ...
# copy imports # copy imports
mkdir -p ../tango/llvmdc mkdir -p ../tango/ldc
cp internal/llvmdc/bitmanip.d ../tango/llvmdc/bitmanip.di cp internal/ldc/bitmanip.d ../tango/ldc/bitmanip.di
cp internal/llvmdc/vararg.d ../tango/llvmdc/vararg.di cp internal/ldc/vararg.d ../tango/ldc/vararg.di
cp import/llvmdc/* ../tango/llvmdc cp import/ldc/* ../tango/ldc
# make the runtime # make the runtime
cp -R lib ../tango cp -R lib ../tango
cd ../tango/lib cd ../tango/lib
make -f llvmdc-posix.mak clean make -f ldc-posix.mak clean
make -f llvmdc-posix.mak sharedlib make -f ldc-posix.mak sharedlib
cd ../.. cd ../..
# install the runtime # install the runtime
rm -f lib/libllvmdc-runtime-shared.so rm -f lib/libldc-runtime-shared.so
cp runtime/internal/libllvmdc-runtime-shared.so lib cp runtime/internal/libldc-runtime-shared.so lib
rm -f lib/libtango-gc-basic-shared.so rm -f lib/libtango-gc-basic-shared.so
cp tango/lib/gc/basic/libtango-gc-basic-shared.so lib cp tango/lib/gc/basic/libtango-gc-basic-shared.so lib
rm -f lib/libtango-cc-tango-shared.so rm -f lib/libtango-cc-tango-shared.so

View file

@ -3,21 +3,21 @@
# I'm no good bash scripter ... # I'm no good bash scripter ...
# copy imports # copy imports
mkdir -p ../tango/llvmdc mkdir -p ../tango/ldc
cp internal/llvmdc/bitmanip.d ../tango/llvmdc/bitmanip.di cp internal/ldc/bitmanip.d ../tango/ldc/bitmanip.di
cp internal/llvmdc/vararg.d ../tango/llvmdc/vararg.di cp internal/ldc/vararg.d ../tango/ldc/vararg.di
cp import/llvmdc/* ../tango/llvmdc cp import/ldc/* ../tango/ldc
# make the runtime # make the runtime
cp -R lib ../tango cp -R lib ../tango
cd ../tango/lib cd ../tango/lib
make -f llvmdc-posix.mak clean make -f ldc-posix.mak clean
make -f llvmdc-posix.mak lib make -f ldc-posix.mak lib
cd ../.. cd ../..
# install the runtime # install the runtime
rm -f lib/libllvmdc-runtime*.a rm -f lib/libldc-runtime*.a
cp runtime/internal/libllvmdc-runtime*.a lib cp runtime/internal/libldc-runtime*.a lib
rm -f lib/libtango-gc-basic*.a rm -f lib/libtango-gc-basic*.a
cp tango/lib/gc/basic/libtango-gc-basic*.a lib cp tango/lib/gc/basic/libtango-gc-basic*.a lib
rm -f lib/libtango-cc-tango*.a rm -f lib/libtango-cc-tango*.a

View file

@ -2,16 +2,16 @@
* vararg support for extern(C) functions * vararg support for extern(C) functions
*/ */
module llvmdc.cstdarg; module ldc.cstdarg;
// Check for the right compiler // Check for the right compiler
version(LLVMDC) version(LDC)
{ {
// OK // OK
} }
else else
{ {
static assert(false, "This module is only valid for LLVMDC"); static assert(false, "This module is only valid for LDC");
} }
alias void* va_list; alias void* va_list;

View file

@ -7,16 +7,16 @@
* *
*/ */
module llvmdc.intrinsics; module ldc.intrinsics;
// Check for the right compiler // Check for the right compiler
version(LLVMDC) version(LDC)
{ {
// OK // OK
} }
else else
{ {
static assert(false, "This module is only valid for LLVMDC"); static assert(false, "This module is only valid for LDC");
} }
// //

View file

@ -1,4 +1,4 @@
private import llvmdc.intrinsics; private import ldc.intrinsics;
extern(C): extern(C):

View file

@ -5,7 +5,7 @@
module eh; module eh;
import util.console; import util.console;
import llvmdc.cstdarg; import ldc.cstdarg;
// debug = EH_personality; // debug = EH_personality;

View file

@ -127,7 +127,7 @@ extern (C) Object _d_newclass(ClassInfo ci)
} }
// initialize it // initialize it
// llvmdc does this inline // ldc does this inline
//(cast(byte*) p)[0 .. ci.init.length] = ci.init[]; //(cast(byte*) p)[0 .. ci.init.length] = ci.init[];
debug(PRINTF) printf("initialization done\n"); debug(PRINTF) printf("initialization done\n");

View file

@ -1,4 +1,4 @@
# Makefile to build the LLVMDC compiler runtime D library for Linux # Makefile to build the LDC compiler runtime D library for Linux
# Designed to work with GNU make # Designed to work with GNU make
# Targets: # Targets:
# make # make
@ -10,11 +10,11 @@
# make clean # make clean
# Delete unneeded files created by build process # Delete unneeded files created by build process
LIB_TARGET_FULL=libllvmdc-runtime.a LIB_TARGET_FULL=libldc-runtime.a
LIB_TARGET_BC_ONLY=libllvmdc-runtime-bc-only.a LIB_TARGET_BC_ONLY=libldc-runtime-bc-only.a
LIB_TARGET_C_ONLY=libllvmdc-runtime-c-only.a LIB_TARGET_C_ONLY=libldc-runtime-c-only.a
LIB_TARGET_SHARED=libllvmdc-runtime-shared.so LIB_TARGET_SHARED=libldc-runtime-shared.so
LIB_MASK=libllvmdc-runtime*.* LIB_MASK=libldc-runtime*.*
CP=cp -f CP=cp -f
@ -37,7 +37,7 @@ LC=llvm-ar rsv
LLINK=llvm-link LLINK=llvm-link
LCC=llc LCC=llc
CLC=ar rsv CLC=ar rsv
DC=llvmdc DC=ldc
LLC=llvm-as LLC=llvm-as
LIB_DEST=.. LIB_DEST=..
@ -60,13 +60,13 @@ LIB_DEST=..
$(DC) -c $(DFLAGS) $< -of$@ $(DC) -c $(DFLAGS) $< -of$@
.d.html: .d.html:
$(DC) -c -o- $(DOCFLAGS) -Df$*.html llvmdc.ddoc $< $(DC) -c -o- $(DOCFLAGS) -Df$*.html ldc.ddoc $<
targets : lib sharedlib doc targets : lib sharedlib doc
all : lib sharedlib doc all : lib sharedlib doc
lib : llvmdc.lib llvmdc.bclib llvmdc.clib lib : ldc.lib ldc.bclib ldc.clib
sharedlib : llvmdc.sharedlib sharedlib : ldc.sharedlib
doc : llvmdc.doc doc : ldc.doc
###################################################### ######################################################
OBJ_C= \ OBJ_C= \
@ -95,9 +95,9 @@ OBJ_UTIL= \
util/string.bc \ util/string.bc \
util/utf.bc util/utf.bc
OBJ_LLVMDC= \ OBJ_LDC= \
llvmdc/bitmanip.bc \ ldc/bitmanip.bc \
llvmdc/vararg.bc ldc/vararg.bc
OBJ_TI= \ OBJ_TI= \
typeinfo/ti_AC.bc \ typeinfo/ti_AC.bc \
@ -140,7 +140,7 @@ ALL_OBJS= \
$(OBJ_BASE) \ $(OBJ_BASE) \
$(OBJ_UTIL) \ $(OBJ_UTIL) \
$(OBJ_TI) \ $(OBJ_TI) \
$(OBJ_LLVMDC) $(OBJ_LDC)
###################################################### ######################################################
@ -148,10 +148,10 @@ ALL_DOCS=
###################################################### ######################################################
llvmdc.bclib : $(LIB_TARGET_BC_ONLY) ldc.bclib : $(LIB_TARGET_BC_ONLY)
llvmdc.clib : $(LIB_TARGET_C_ONLY) ldc.clib : $(LIB_TARGET_C_ONLY)
llvmdc.lib : $(LIB_TARGET_FULL) ldc.lib : $(LIB_TARGET_FULL)
llvmdc.sharedlib : $(LIB_TARGET_SHARED) ldc.sharedlib : $(LIB_TARGET_SHARED)
$(LIB_TARGET_BC_ONLY) : $(ALL_OBJS) $(LIB_TARGET_BC_ONLY) : $(ALL_OBJS)
$(RM) $@ $(RM) $@
@ -179,7 +179,7 @@ $(LIB_TARGET_SHARED) : $(ALL_OBJS) $(OBJ_C)
$(CC) -shared -o $@ $@.o $(OBJ_C) $(CC) -shared -o $@ $@.o $(OBJ_C)
llvmdc.doc : $(ALL_DOCS) ldc.doc : $(ALL_DOCS)
echo No documentation available. echo No documentation available.
###################################################### ######################################################

View file

@ -1,18 +1,18 @@
/* /*
* D phobos intrinsics for LLVMDC * D phobos intrinsics for LDC
* *
* From GDC ... public domain! * From GDC ... public domain!
*/ */
module llvmdc.bitmanip; module ldc.bitmanip;
// Check for the right compiler // Check for the right compiler
version(LLVMDC) version(LDC)
{ {
// OK // OK
} }
else else
{ {
static assert(false, "This module is only valid for LLVMDC"); static assert(false, "This module is only valid for LDC");
} }
int bsf(uint v) int bsf(uint v)

View file

@ -4,16 +4,16 @@
* Provides the functions tango.core.Vararg expects to be present! * Provides the functions tango.core.Vararg expects to be present!
*/ */
module llvmdc.Vararg; module ldc.Vararg;
// Check for the right compiler // Check for the right compiler
version(LLVMDC) version(LDC)
{ {
// OK // OK
} }
else else
{ {
static assert(false, "This module is only valid for LLVMDC"); static assert(false, "This module is only valid for LDC");
} }
alias void* va_list; alias void* va_list;
@ -26,7 +26,7 @@ void va_start(T) ( out va_list ap, inout T parmn )
T va_arg(T)(ref va_list vp) T va_arg(T)(ref va_list vp)
{ {
T* arg = cast(T*) vp; T* arg = cast(T*) vp;
// llvmdc always aligns to size_t.sizeof in vararg lists // ldc always aligns to size_t.sizeof in vararg lists
vp = cast(va_list) ( cast(void*) vp + ( ( T.sizeof + size_t.sizeof - 1 ) & ~( size_t.sizeof - 1 ) ) ); vp = cast(va_list) ( cast(void*) vp + ( ( T.sizeof + size_t.sizeof - 1 ) & ~( size_t.sizeof - 1 ) ) );
return *arg; return *arg;
} }

View file

@ -39,7 +39,7 @@ LC=llvm-ar rsv
LLINK=llvm-link LLINK=llvm-link
LCC=llc LCC=llc
CLC=ar rsv CLC=ar rsv
DC=llvmdc DC=ldc
LLC=llvm-as LLC=llvm-as
INC_DEST=../../../tango INC_DEST=../../../tango

View file

@ -1,4 +1,4 @@
# Makefile to build the garbage collector D library for LLVMDC # Makefile to build the garbage collector D library for LDC
# Designed to work with GNU make # Designed to work with GNU make
# Targets: # Targets:
# make # make
@ -39,7 +39,7 @@ LCC=llc
LLINK=llvm-link LLINK=llvm-link
CLC=ar rsv CLC=ar rsv
LD=llvm-ld LD=llvm-ld
DC=llvmdc DC=ldc
LIB_DEST=.. LIB_DEST=..

View file

@ -33,7 +33,7 @@ DOCFLAGS=-version=DDoc
CC=gcc CC=gcc
LC=llvm-ar rsv LC=llvm-ar rsv
DC=llvmdc DC=ldc
LIB_DEST=.. LIB_DEST=..

View file

@ -10,11 +10,11 @@
# make clean # make clean
# Delete unneeded files created by build process # Delete unneeded files created by build process
LIB_TARGET=libtango-base-llvmdc.a LIB_TARGET=libtango-base-ldc.a
LIB_MASK=libtango-base-llvmdc*.a LIB_MASK=libtango-base-ldc*.a
LIB_TARGET_C=libtango-base-c-llvmdc.a LIB_TARGET_C=libtango-base-c-ldc.a
LIB_MASK_C=libtango-base-c-llvmdc*.a LIB_MASK_C=libtango-base-c-ldc*.a
LIB_NAME_NATIVE=libtango-base-llvmdc-native LIB_NAME_NATIVE=libtango-base-ldc-native
LIB_TARGET_NATIVE=$(LIB_NAME_NATIVE).a LIB_TARGET_NATIVE=$(LIB_NAME_NATIVE).a
DIR_CC=./common/tango DIR_CC=./common/tango
@ -29,7 +29,7 @@ MD=mkdir -p
CC=gcc CC=gcc
LC=llvm-ar rsv LC=llvm-ar rsv
CLC=ar rsv CLC=ar rsv
DC=llvmdc DC=ldc
LLVMLINK=llvm-link LLVMLINK=llvm-link
LLC=llc LLC=llc
@ -51,21 +51,21 @@ ALL_DOCS=
###################################################### ######################################################
lib : $(ALL_OBJS) lib : $(ALL_OBJS)
make -C $(DIR_CC) -fllvmdc.mak lib DC=$(DC) ADD_DFLAGS="$(ADD_DFLAGS)" ADD_CFLAGS="$(ADD_CFLAGS)" make -C $(DIR_CC) -fldc.mak lib DC=$(DC) ADD_DFLAGS="$(ADD_DFLAGS)" ADD_CFLAGS="$(ADD_CFLAGS)"
make -C $(DIR_RT) -fllvmdc.mak lib make -C $(DIR_RT) -fldc.mak lib
make -C $(DIR_GC) -fllvmdc.mak lib DC=$(DC) ADD_DFLAGS="$(ADD_DFLAGS)" ADD_CFLAGS="$(ADD_CFLAGS)" make -C $(DIR_GC) -fldc.mak lib DC=$(DC) ADD_DFLAGS="$(ADD_DFLAGS)" ADD_CFLAGS="$(ADD_CFLAGS)"
# could link the three parts into one here, but why should we # could link the three parts into one here, but why should we
sharedlib : $(ALL_OBJS) sharedlib : $(ALL_OBJS)
make -C $(DIR_CC) -fllvmdc.mak sharedlib DC=$(DC) ADD_DFLAGS="$(ADD_DFLAGS)" ADD_CFLAGS="$(ADD_CFLAGS)" make -C $(DIR_CC) -fldc.mak sharedlib DC=$(DC) ADD_DFLAGS="$(ADD_DFLAGS)" ADD_CFLAGS="$(ADD_CFLAGS)"
make -C $(DIR_RT) -fllvmdc.mak sharedlib make -C $(DIR_RT) -fldc.mak sharedlib
make -C $(DIR_GC) -fllvmdc.mak sharedlib DC=$(DC) ADD_DFLAGS="$(ADD_DFLAGS)" ADD_CFLAGS="$(ADD_CFLAGS)" make -C $(DIR_GC) -fldc.mak sharedlib DC=$(DC) ADD_DFLAGS="$(ADD_DFLAGS)" ADD_CFLAGS="$(ADD_CFLAGS)"
# could link the three parts into one here, but why should we # could link the three parts into one here, but why should we
doc : $(ALL_DOCS) doc : $(ALL_DOCS)
make -C $(DIR_CC) -fllvmdc.mak doc make -C $(DIR_CC) -fldc.mak doc
make -C $(DIR_RT) -fllvmdc.mak doc make -C $(DIR_RT) -fldc.mak doc
make -C $(DIR_GC) -fllvmdc.mak doc make -C $(DIR_GC) -fldc.mak doc
###################################################### ######################################################
@ -73,16 +73,16 @@ clean :
find . -name "*.di" | xargs $(RM) find . -name "*.di" | xargs $(RM)
$(RM) $(ALL_OBJS) $(RM) $(ALL_OBJS)
$(RM) $(ALL_DOCS) $(RM) $(ALL_DOCS)
make -C $(DIR_CC) -fllvmdc.mak clean make -C $(DIR_CC) -fldc.mak clean
make -C $(DIR_RT) -fllvmdc.mak clean make -C $(DIR_RT) -fldc.mak clean
make -C $(DIR_GC) -fllvmdc.mak clean make -C $(DIR_GC) -fldc.mak clean
$(RM) $(LIB_MASK) $(RM) $(LIB_MASK)
$(RM) $(LIB_MASK_C) $(RM) $(LIB_MASK_C)
$(RM) $(LIB_NAME_NATIVE)* $(RM) $(LIB_NAME_NATIVE)*
install : install :
make -C $(DIR_CC) -fllvmdc.mak install make -C $(DIR_CC) -fldc.mak install
make -C $(DIR_RT) -fllvmdc.mak install make -C $(DIR_RT) -fldc.mak install
make -C $(DIR_GC) -fllvmdc.mak install make -C $(DIR_GC) -fldc.mak install
$(CP) $(LIB_MASK) $(LIB_DEST)/. $(CP) $(LIB_MASK) $(LIB_DEST)/.
$(CP) $(LIB_MASK_C) $(LIB_DEST)/. $(CP) $(LIB_MASK_C) $(LIB_DEST)/.

View file

@ -20,9 +20,9 @@ Index: lib/common/tango/core/BitManip.d
*/ */
uint outpl( uint port_address, uint value ); uint outpl( uint port_address, uint value );
} }
+else version( LLVMDC ) +else version( LDC )
+{ +{
+ public import llvmdc.bitmanip; + public import ldc.bitmanip;
+} +}
else else
{ {
@ -36,7 +36,7 @@ Index: lib/common/tango/core/Thread.d
body body
{ {
- version( D_InlineAsm_X86 ) - version( D_InlineAsm_X86 )
+ version( LLVMDC) + version( LDC)
{ {
+ version(X86) + version(X86)
+ { + {
@ -67,7 +67,7 @@ Index: lib/common/tango/core/Thread.d
} }
- version( D_InlineAsm_X86 ) - version( D_InlineAsm_X86 )
+ version( LLVMDC) + version( LDC)
{ {
+ // nothing to pop + // nothing to pop
+ } + }
@ -173,7 +173,7 @@ Index: lib/unittest.sh
- gdc: Builds unittests for gdc - gdc: Builds unittests for gdc
+ dmd: Builds unittests for dmd + dmd: Builds unittests for dmd
+ gdc: Builds unittests for gdc + gdc: Builds unittests for gdc
+ llvmdc: Builds unittests for llvmdc + ldc: Builds unittests for ldc
<none>: Builds unittests for all known compilers.' <none>: Builds unittests for all known compilers.'
exit 0 exit 0
@ -190,8 +190,8 @@ Index: lib/unittest.sh
gdc) gdc)
GDC=1 GDC=1
;; ;;
+ llvmdc) + ldc)
+ LLVMDC=1 + LDC=1
+ ;; + ;;
*) *)
usage usage
@ -201,11 +201,11 @@ Index: lib/unittest.sh
done done
-if [ ! "$DMD" -a ! "$GDC" ] -if [ ! "$DMD" -a ! "$GDC" ]
+if [ ! "$DMD" -a ! "$GDC" -a ! "$LLVMDC" ] +if [ ! "$DMD" -a ! "$GDC" -a ! "$LDC" ]
then then
DMD=1 DMD=1
GDC=1 GDC=1
+ LLVMDC=1 + LDC=1
fi fi
if [ "$DMD" = "1" ] if [ "$DMD" = "1" ]
@ -214,9 +214,9 @@ Index: lib/unittest.sh
compile gdc runUnitTest_gdc compile gdc runUnitTest_gdc
fi fi
- -
+if [ "$LLVMDC" = "1" ] +if [ "$LDC" = "1" ]
+then +then
+ compile llvmdc runUnitTest_llvmdc + compile ldc runUnitTest_ldc
+fi +fi
Index: lib/gc/basic/gcx.d Index: lib/gc/basic/gcx.d
=================================================================== ===================================================================
@ -254,7 +254,7 @@ Index: lib/gc/basic/gcx.d
__builtin_unwind_init(); __builtin_unwind_init();
sp = & sp; sp = & sp;
} }
+ else version(LLVMDC) + else version(LDC)
+ { + {
+ version(X86) + version(X86)
+ { + {
@ -283,7 +283,7 @@ Index: lib/gc/basic/gcx.d
{ {
// nothing to do // nothing to do
} }
+ else version(LLVMDC) + else version(LDC)
+ { + {
+ // nothing to do + // nothing to do
+ } + }
@ -298,7 +298,7 @@ Index: lib/gc/basic/gcbits.d
{ {
// use the unoptimized version // use the unoptimized version
} }
+else version(LLVMDC) +else version(LDC)
+{ +{
+ // ditto + // ditto
+} +}
@ -313,7 +313,7 @@ Index: tango/text/convert/Layout.d
alias void* Arg; alias void* Arg;
alias va_list ArgList; alias va_list ArgList;
} }
+else version(LLVMDC) +else version(LDC)
+ { + {
+ private import tango.core.Vararg; + private import tango.core.Vararg;
+ alias void* Arg; + alias void* Arg;
@ -327,7 +327,7 @@ Index: tango/text/convert/Layout.d
assert (arguments.length < 64, "too many args in Layout.convert"); assert (arguments.length < 64, "too many args in Layout.convert");
- version (GNU) - version (GNU)
+ version (LLVMDC) + version (LDC)
{ {
Arg[64] arglist = void; Arg[64] arglist = void;
+ foreach (i, arg; arguments) + foreach (i, arg; arguments)
@ -350,9 +350,9 @@ Index: tango/core/Vararg.d
{ {
public import std.stdarg; public import std.stdarg;
} }
+else version( LLVMDC ) +else version( LDC )
+{ +{
+ public import llvmdc.vararg; + public import ldc.vararg;
+} +}
else else
{ {
@ -365,13 +365,13 @@ Index: tango/core/Atomic.d
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
+// LLVMDC Atomics Implementation +// LDC Atomics Implementation
+//////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////
+ +
+ +
+else version( LLVMDC ) +else version( LDC )
+{ +{
+ import llvmdc.intrinsics; + import ldc.intrinsics;
+ +
+ +
+ //////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////
@ -537,12 +537,12 @@ Index: tango/math/Math.d
version = DigitalMars_D_InlineAsm_X86; version = DigitalMars_D_InlineAsm_X86;
} }
} }
+else version(LLVMDC) +else version(LDC)
+{ +{
+ import llvmdc.intrinsics; + import ldc.intrinsics;
+ version(X86) + version(X86)
+ { + {
+ version = LLVMDC_X86; + version = LDC_X86;
+ } + }
+} +}
@ -552,7 +552,7 @@ Index: tango/math/Math.d
* Bugs: * Bugs:
* Results are undefined if |x| >= $(POWER 2,64). * Results are undefined if |x| >= $(POWER 2,64).
*/ */
+version(LLVMDC) +version(LDC)
+{ +{
+ alias llvm_cos_f32 cos; + alias llvm_cos_f32 cos;
+ alias llvm_cos_f64 cos; + alias llvm_cos_f64 cos;
@ -585,7 +585,7 @@ Index: tango/math/Math.d
* Bugs: * Bugs:
* Results are undefined if |x| >= $(POWER 2,64). * Results are undefined if |x| >= $(POWER 2,64).
*/ */
+version(LLVMDC) +version(LDC)
+{ +{
+ alias llvm_sin_f32 sin; + alias llvm_sin_f32 sin;
+ alias llvm_sin_f64 sin; + alias llvm_sin_f64 sin;
@ -620,7 +620,7 @@ Index: tango/math/Math.d
return tanl(x); return tanl(x);
- } else { - } else {
+ } + }
+ else version(LLVMDC) { + else version(LDC) {
+ return tango.stdc.math.tanl(x); + return tango.stdc.math.tanl(x);
+ } + }
+ else { + else {
@ -631,7 +631,7 @@ Index: tango/math/Math.d
* <tr> <td> +&infin; <td> +&infin; <td> no * <tr> <td> +&infin; <td> +&infin; <td> no
* ) * )
*/ */
+version(LLVMDC) +version(LDC)
+{ +{
+ alias llvm_sqrt_f32 sqrt; + alias llvm_sqrt_f32 sqrt;
+ alias llvm_sqrt_f64 sqrt; + alias llvm_sqrt_f64 sqrt;
@ -667,7 +667,7 @@ Index: tango/math/Math.d
} }
} }
- return tango.stdc.math.powl(x, y); - return tango.stdc.math.powl(x, y);
+ version(LLVMDC_X86) + version(LDC_X86)
+ { + {
+ return llvm_pow_f80(x, y); + return llvm_pow_f80(x, y);
+ } + }
@ -686,7 +686,7 @@ Index: tango/stdc/stdlib.d
{ {
void* alloca(size_t size); void* alloca(size_t size);
} }
+else version( LLVMDC ) +else version( LDC )
+{ +{
+ pragma(alloca) + pragma(alloca)
+ void* alloca(size_t size); + void* alloca(size_t size);
@ -702,9 +702,9 @@ Index: tango/stdc/stdarg.d
{ {
public import std.c.stdarg; public import std.c.stdarg;
} }
+else version( LLVMDC ) +else version( LDC )
+{ +{
+ public import llvmdc.cstdarg; + public import ldc.cstdarg;
+} +}
else else
{ {

View file

@ -1,4 +1,4 @@
#!/bin/bash #!/bin/bash
cd ../tango cd ../tango
patch -p0 < ../runtime/llvmdc.diff patch -p0 < ../runtime/ldc.diff

View file

@ -1,6 +1,6 @@
After making sure llvmdc and its runtime are up to date, use After making sure LDC and its runtime are up to date, use
./runtest tmp-sensible-name ./runtest tmp-sensible-name
to run tests for llvmdc. to run tests for LDC.
Move into reference/ subfolder and add to svn if desired. Move into reference/ subfolder and add to svn if desired.
Use Use
@ -8,4 +8,4 @@ Use
to find changes. to find changes.
Recommended for comparing to DMD: Recommended for comparing to DMD:
./findregressions reference/dmd-version llvmdc-something | grep -v "PASS -> XFAIL" | sort > tmp-new-regressions ./findregressions reference/dmd-version ldc-something | grep -v "PASS -> XFAIL" | sort > tmp-new-regressions

View file

@ -337,7 +337,7 @@ int main(char[][] args){
if(args.length < 3 || (args[1] == "--regenerate" && args.length < 4)){ if(args.length < 3 || (args[1] == "--regenerate" && args.length < 4)){
fwritefln(stderr, "%s [--regenerate] <reference-log> <log> <log> ...", args[0]); fwritefln(stderr, "%s [--regenerate] <reference-log> <log> <log> ...", args[0]);
fwritefln(stderr, "bash example: %s reference/dmd-something $(ls reference/llvmdc*)", args[0]); fwritefln(stderr, "bash example: %s reference/dmd-something $(ls reference/ldc*)", args[0]);
return 1; return 1;
} }
@ -377,119 +377,119 @@ int main(char[][] args){
BufferedFile index = new BufferedFile(std.path.join(basedir, "index.html"), FileMode.OutNew); BufferedFile index = new BufferedFile(std.path.join(basedir, "index.html"), FileMode.OutNew);
scope(exit) index.close(); scope(exit) index.close();
index.writefln(` index.writefln(`
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>DStress results for x86-32 Linux</title> <title>DStress results for x86-32 Linux</title>
<style type="text/css"> <style type="text/css">
body { body {
font-family: Arial, Helvetica, sans-serif; font-family: Arial, Helvetica, sans-serif;
font-size: 0.8em; font-size: 0.8em;
} }
a { a {
text-decoration: none; text-decoration: none;
} }
a:hover { a:hover {
border-bottom: 1px dotted blue; border-bottom: 1px dotted blue;
} }
table { table {
border-collapse: collapse; border-collapse: collapse;
} }
tr { tr {
border-bottom: 1px solid #CCC; border-bottom: 1px solid #CCC;
} }
tr.odd { tr.odd {
background: #e0e0e0; background: #e0e0e0;
} }
tr.head { tr.head {
border-bottom: none; border-bottom: none;
} }
td,th { td,th {
padding: 2px 10px 2px 10px; padding: 2px 10px 2px 10px;
} }
.result:hover { .result:hover {
background: #C3DFFF; background: #C3DFFF;
} }
.pass,.xfail,.xpass,.fail,.xpass,.error,.generic { .pass,.xfail,.xpass,.fail,.xpass,.error,.generic {
text-align: center; text-align: center;
} }
.generic { .generic {
background: #EEE; background: #EEE;
color: gray; color: gray;
} }
.pass { .pass {
background: #98FF90; background: #98FF90;
color: green; color: green;
} }
tr:hover .pass { tr:hover .pass {
background: #83E67B; background: #83E67B;
} }
.xfail { .xfail {
background: #BDFFB8; background: #BDFFB8;
color: #0CAE00; color: #0CAE00;
} }
tr:hover .xfail { tr:hover .xfail {
background: #98FF90; background: #98FF90;
} }
.fail { .fail {
background: #FF6E7A; background: #FF6E7A;
color: maroon; color: maroon;
} }
.xpass { .xpass {
background: #FF949D; background: #FF949D;
color: maroon; color: maroon;
} }
.error { .error {
background: #FFB3B9; background: #FFB3B9;
color: maroon; color: maroon;
} }
.borderleft { .borderleft {
border-left: 1px solid #CCC; border-left: 1px solid #CCC;
} }
</style> </style>
</head> </head>
<body> <body>
<h1>DStress results for x86-32 Linux</h1> <h1>DStress results for x86-32 Linux</h1>
<h2>Legend</h2> <h2>Legend</h2>
<table id="legend"> <table id="legend">
<tr> <tr>
<th>Color</th> <th>Color</th>
<th>Description</th> <th>Description</th>
</tr> </tr>
<tr class="result"> <tr class="result">
<td class="pass">PASS</td> <td class="pass">PASS</td>
<td>Test passed and was expected to pass</td> <td>Test passed and was expected to pass</td>
</tr> </tr>
<tr class="result"> <tr class="result">
<td class="xfail">XFAIL</td> <td class="xfail">XFAIL</td>
<td>Test failed and expected to fail</td> <td>Test failed and expected to fail</td>
</tr> </tr>
<tr class="result"> <tr class="result">
<td class="fail">FAIL</td> <td class="fail">FAIL</td>
<td>Test failed but was expected to pass</td> <td>Test failed but was expected to pass</td>
</tr> </tr>
<tr class="result"> <tr class="result">
<td class="xpass">XPASS</td> <td class="xpass">XPASS</td>
<td>Test passed but was expected to fail</td> <td>Test passed but was expected to fail</td>
</tr> </tr>
<tr class="result"> <tr class="result">
<td class="error">ERROR</td> <td class="error">ERROR</td>
<td>The compiler, linker or the test segfaulted</td> <td>The compiler, linker or the test segfaulted</td>
</tr> </tr>
<tr class="result"> <tr class="result">
<td class="generic">+</td> <td class="generic">+</td>
<td>Changes from FAIL, XPASS or ERROR to PASS or XFAIL</td> <td>Changes from FAIL, XPASS or ERROR to PASS or XFAIL</td>
</tr> </tr>
<tr class="result"> <tr class="result">
<td class="generic">-</td> <td class="generic">-</td>
<td>Changes from PASS or XFAIL to FAIL, XPASS or ERROR</td> <td>Changes from PASS or XFAIL to FAIL, XPASS or ERROR</td>
</tr> </tr>
<tr class="result"> <tr class="result">
<td class="generic">chg</td> <td class="generic">chg</td>
<td>Changed within the good or bad group without crossing over</td> <td>Changed within the good or bad group without crossing over</td>
</tr> </tr>
</table> </table>
<h2>Results</h2> <h2>Results</h2>

View file

@ -24,7 +24,7 @@ extern(C)
int rand(); int rand();
} }
import llvmdc.intrinsics; import ldc.intrinsics;
void main() void main()
{ {

View file

@ -1,4 +1,4 @@
import llvmdc.intrinsics; import ldc.intrinsics;
extern(C) int printf(char*,...); extern(C) int printf(char*,...);
extern(C) int scanf(char*,...); extern(C) int scanf(char*,...);

View file

@ -49,7 +49,7 @@ int main(string[] args)
auto testname = getName(getBaseName(c)); auto testname = getName(getBaseName(c));
writefln("TEST NAME: ", testname); writefln("TEST NAME: ", testname);
string cmd = format("llvmdc %s -quiet -ofobj" ~ std.path.sep ~ "%s -odobj", c, testname); string cmd = format("ldc %s -quiet -ofobj" ~ std.path.sep ~ "%s -odobj", c, testname);
foreach(v; args[1..$]) { foreach(v; args[1..$]) {
cmd ~= ' '; cmd ~= ' ';
cmd ~= v; cmd ~= v;

View file

@ -37,8 +37,8 @@ echo "Remember to make sure you have an up to date runtime!"
echo echo
if [ -z "$DMD" ] ; then if [ -z "$DMD" ] ; then
echo "Testing with llvmdc. Set DMD environment variable to select compiler." echo "Testing with LDC. Set DMD environment variable to select compiler."
DMD="llvmdc -I$BASEPATH/testincludes -L$BASEPATH/testincludes/libtangobos-partial.a" DMD="ldc -I$BASEPATH/testincludes -L$BASEPATH/testincludes/libtangobos-partial.a"
echo "Default is $DMD" echo "Default is $DMD"
else else
echo "Using compiler given by DMD environment variable: $DMD" echo "Using compiler given by DMD environment variable: $DMD"

View file

@ -34,7 +34,7 @@ DOCFLAGS=-version=DDoc
CC=gcc CC=gcc
LC=llvm-ar rsv LC=llvm-ar rsv
CLC=ar rsv CLC=ar rsv
DC=llvmdc DC=ldc
LLC=llvm-as LLC=llvm-as
LLVMLINK=llvm-link LLVMLINK=llvm-link
LLC=llc LLC=llc