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

@@ -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

View File

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

View File

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

View File

@@ -2,16 +2,16 @@
* vararg support for extern(C) functions
*/
module llvmdc.cstdarg;
module ldc.cstdarg;
// Check for the right compiler
version(LLVMDC)
version(LDC)
{
// OK
}
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;

View File

@@ -7,16 +7,16 @@
*
*/
module llvmdc.intrinsics;
module ldc.intrinsics;
// Check for the right compiler
version(LLVMDC)
version(LDC)
{
// OK
}
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):

View File

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

View File

@@ -127,7 +127,7 @@ extern (C) Object _d_newclass(ClassInfo ci)
}
// initialize it
// llvmdc does this inline
// ldc does this inline
//(cast(byte*) p)[0 .. ci.init.length] = ci.init[];
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
# Targets:
# make
@@ -10,11 +10,11 @@
# make clean
# Delete unneeded files created by build process
LIB_TARGET_FULL=libllvmdc-runtime.a
LIB_TARGET_BC_ONLY=libllvmdc-runtime-bc-only.a
LIB_TARGET_C_ONLY=libllvmdc-runtime-c-only.a
LIB_TARGET_SHARED=libllvmdc-runtime-shared.so
LIB_MASK=libllvmdc-runtime*.*
LIB_TARGET_FULL=libldc-runtime.a
LIB_TARGET_BC_ONLY=libldc-runtime-bc-only.a
LIB_TARGET_C_ONLY=libldc-runtime-c-only.a
LIB_TARGET_SHARED=libldc-runtime-shared.so
LIB_MASK=libldc-runtime*.*
CP=cp -f
@@ -37,7 +37,7 @@ LC=llvm-ar rsv
LLINK=llvm-link
LCC=llc
CLC=ar rsv
DC=llvmdc
DC=ldc
LLC=llvm-as
LIB_DEST=..
@@ -60,13 +60,13 @@ LIB_DEST=..
$(DC) -c $(DFLAGS) $< -of$@
.d.html:
$(DC) -c -o- $(DOCFLAGS) -Df$*.html llvmdc.ddoc $<
$(DC) -c -o- $(DOCFLAGS) -Df$*.html ldc.ddoc $<
targets : lib sharedlib doc
all : lib sharedlib doc
lib : llvmdc.lib llvmdc.bclib llvmdc.clib
sharedlib : llvmdc.sharedlib
doc : llvmdc.doc
lib : ldc.lib ldc.bclib ldc.clib
sharedlib : ldc.sharedlib
doc : ldc.doc
######################################################
OBJ_C= \
@@ -95,9 +95,9 @@ OBJ_UTIL= \
util/string.bc \
util/utf.bc
OBJ_LLVMDC= \
llvmdc/bitmanip.bc \
llvmdc/vararg.bc
OBJ_LDC= \
ldc/bitmanip.bc \
ldc/vararg.bc
OBJ_TI= \
typeinfo/ti_AC.bc \
@@ -140,7 +140,7 @@ ALL_OBJS= \
$(OBJ_BASE) \
$(OBJ_UTIL) \
$(OBJ_TI) \
$(OBJ_LLVMDC)
$(OBJ_LDC)
######################################################
@@ -148,10 +148,10 @@ ALL_DOCS=
######################################################
llvmdc.bclib : $(LIB_TARGET_BC_ONLY)
llvmdc.clib : $(LIB_TARGET_C_ONLY)
llvmdc.lib : $(LIB_TARGET_FULL)
llvmdc.sharedlib : $(LIB_TARGET_SHARED)
ldc.bclib : $(LIB_TARGET_BC_ONLY)
ldc.clib : $(LIB_TARGET_C_ONLY)
ldc.lib : $(LIB_TARGET_FULL)
ldc.sharedlib : $(LIB_TARGET_SHARED)
$(LIB_TARGET_BC_ONLY) : $(ALL_OBJS)
$(RM) $@
@@ -179,7 +179,7 @@ $(LIB_TARGET_SHARED) : $(ALL_OBJS) $(OBJ_C)
$(CC) -shared -o $@ $@.o $(OBJ_C)
llvmdc.doc : $(ALL_DOCS)
ldc.doc : $(ALL_DOCS)
echo No documentation available.
######################################################

View File

@@ -1,18 +1,18 @@
/*
* D phobos intrinsics for LLVMDC
* D phobos intrinsics for LDC
*
* From GDC ... public domain!
*/
module llvmdc.bitmanip;
module ldc.bitmanip;
// Check for the right compiler
version(LLVMDC)
version(LDC)
{
// OK
}
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)

View File

@@ -4,16 +4,16 @@
* Provides the functions tango.core.Vararg expects to be present!
*/
module llvmdc.Vararg;
module ldc.Vararg;
// Check for the right compiler
version(LLVMDC)
version(LDC)
{
// OK
}
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;
@@ -26,7 +26,7 @@ void va_start(T) ( out va_list ap, inout T parmn )
T va_arg(T)(ref va_list 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 ) ) );
return *arg;
}

View File

@@ -39,7 +39,7 @@ LC=llvm-ar rsv
LLINK=llvm-link
LCC=llc
CLC=ar rsv
DC=llvmdc
DC=ldc
LLC=llvm-as
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
# Targets:
# make
@@ -39,7 +39,7 @@ LCC=llc
LLINK=llvm-link
CLC=ar rsv
LD=llvm-ld
DC=llvmdc
DC=ldc
LIB_DEST=..

View File

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

View File

@@ -10,11 +10,11 @@
# make clean
# Delete unneeded files created by build process
LIB_TARGET=libtango-base-llvmdc.a
LIB_MASK=libtango-base-llvmdc*.a
LIB_TARGET_C=libtango-base-c-llvmdc.a
LIB_MASK_C=libtango-base-c-llvmdc*.a
LIB_NAME_NATIVE=libtango-base-llvmdc-native
LIB_TARGET=libtango-base-ldc.a
LIB_MASK=libtango-base-ldc*.a
LIB_TARGET_C=libtango-base-c-ldc.a
LIB_MASK_C=libtango-base-c-ldc*.a
LIB_NAME_NATIVE=libtango-base-ldc-native
LIB_TARGET_NATIVE=$(LIB_NAME_NATIVE).a
DIR_CC=./common/tango
@@ -29,7 +29,7 @@ MD=mkdir -p
CC=gcc
LC=llvm-ar rsv
CLC=ar rsv
DC=llvmdc
DC=ldc
LLVMLINK=llvm-link
LLC=llc
@@ -51,21 +51,21 @@ ALL_DOCS=
######################################################
lib : $(ALL_OBJS)
make -C $(DIR_CC) -fllvmdc.mak lib DC=$(DC) ADD_DFLAGS="$(ADD_DFLAGS)" ADD_CFLAGS="$(ADD_CFLAGS)"
make -C $(DIR_RT) -fllvmdc.mak lib
make -C $(DIR_GC) -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) -fldc.mak lib
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
sharedlib : $(ALL_OBJS)
make -C $(DIR_CC) -fllvmdc.mak sharedlib DC=$(DC) ADD_DFLAGS="$(ADD_DFLAGS)" ADD_CFLAGS="$(ADD_CFLAGS)"
make -C $(DIR_RT) -fllvmdc.mak sharedlib
make -C $(DIR_GC) -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) -fldc.mak sharedlib
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
doc : $(ALL_DOCS)
make -C $(DIR_CC) -fllvmdc.mak doc
make -C $(DIR_RT) -fllvmdc.mak doc
make -C $(DIR_GC) -fllvmdc.mak doc
make -C $(DIR_CC) -fldc.mak doc
make -C $(DIR_RT) -fldc.mak doc
make -C $(DIR_GC) -fldc.mak doc
######################################################
@@ -73,16 +73,16 @@ clean :
find . -name "*.di" | xargs $(RM)
$(RM) $(ALL_OBJS)
$(RM) $(ALL_DOCS)
make -C $(DIR_CC) -fllvmdc.mak clean
make -C $(DIR_RT) -fllvmdc.mak clean
make -C $(DIR_GC) -fllvmdc.mak clean
make -C $(DIR_CC) -fldc.mak clean
make -C $(DIR_RT) -fldc.mak clean
make -C $(DIR_GC) -fldc.mak clean
$(RM) $(LIB_MASK)
$(RM) $(LIB_MASK_C)
$(RM) $(LIB_NAME_NATIVE)*
install :
make -C $(DIR_CC) -fllvmdc.mak install
make -C $(DIR_RT) -fllvmdc.mak install
make -C $(DIR_GC) -fllvmdc.mak install
make -C $(DIR_CC) -fldc.mak install
make -C $(DIR_RT) -fldc.mak install
make -C $(DIR_GC) -fldc.mak install
$(CP) $(LIB_MASK) $(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 );
}
+else version( LLVMDC )
+else version( LDC )
+{
+ public import llvmdc.bitmanip;
+ public import ldc.bitmanip;
+}
else
{
@@ -36,7 +36,7 @@ Index: lib/common/tango/core/Thread.d
body
{
- version( D_InlineAsm_X86 )
+ version( LLVMDC)
+ version( LDC)
{
+ version(X86)
+ {
@@ -67,7 +67,7 @@ Index: lib/common/tango/core/Thread.d
}
- version( D_InlineAsm_X86 )
+ version( LLVMDC)
+ version( LDC)
{
+ // nothing to pop
+ }
@@ -173,7 +173,7 @@ Index: lib/unittest.sh
- gdc: Builds unittests for gdc
+ dmd: Builds unittests for dmd
+ gdc: Builds unittests for gdc
+ llvmdc: Builds unittests for llvmdc
+ ldc: Builds unittests for ldc
<none>: Builds unittests for all known compilers.'
exit 0
@@ -190,8 +190,8 @@ Index: lib/unittest.sh
gdc)
GDC=1
;;
+ llvmdc)
+ LLVMDC=1
+ ldc)
+ LDC=1
+ ;;
*)
usage
@@ -201,11 +201,11 @@ Index: lib/unittest.sh
done
-if [ ! "$DMD" -a ! "$GDC" ]
+if [ ! "$DMD" -a ! "$GDC" -a ! "$LLVMDC" ]
+if [ ! "$DMD" -a ! "$GDC" -a ! "$LDC" ]
then
DMD=1
GDC=1
+ LLVMDC=1
+ LDC=1
fi
if [ "$DMD" = "1" ]
@@ -214,9 +214,9 @@ Index: lib/unittest.sh
compile gdc runUnitTest_gdc
fi
-
+if [ "$LLVMDC" = "1" ]
+if [ "$LDC" = "1" ]
+then
+ compile llvmdc runUnitTest_llvmdc
+ compile ldc runUnitTest_ldc
+fi
Index: lib/gc/basic/gcx.d
===================================================================
@@ -254,7 +254,7 @@ Index: lib/gc/basic/gcx.d
__builtin_unwind_init();
sp = & sp;
}
+ else version(LLVMDC)
+ else version(LDC)
+ {
+ version(X86)
+ {
@@ -283,7 +283,7 @@ Index: lib/gc/basic/gcx.d
{
// nothing to do
}
+ else version(LLVMDC)
+ else version(LDC)
+ {
+ // nothing to do
+ }
@@ -298,7 +298,7 @@ Index: lib/gc/basic/gcbits.d
{
// use the unoptimized version
}
+else version(LLVMDC)
+else version(LDC)
+{
+ // ditto
+}
@@ -313,7 +313,7 @@ Index: tango/text/convert/Layout.d
alias void* Arg;
alias va_list ArgList;
}
+else version(LLVMDC)
+else version(LDC)
+ {
+ private import tango.core.Vararg;
+ alias void* Arg;
@@ -327,7 +327,7 @@ Index: tango/text/convert/Layout.d
assert (arguments.length < 64, "too many args in Layout.convert");
- version (GNU)
+ version (LLVMDC)
+ version (LDC)
{
Arg[64] arglist = void;
+ foreach (i, arg; arguments)
@@ -350,9 +350,9 @@ Index: tango/core/Vararg.d
{
public import std.stdarg;
}
+else version( LLVMDC )
+else version( LDC )
+{
+ public import llvmdc.vararg;
+ public import ldc.vararg;
+}
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;
}
}
+else version(LLVMDC)
+else version(LDC)
+{
+ import llvmdc.intrinsics;
+ import ldc.intrinsics;
+ version(X86)
+ {
+ version = LLVMDC_X86;
+ version = LDC_X86;
+ }
+}
@@ -552,7 +552,7 @@ Index: tango/math/Math.d
* Bugs:
* Results are undefined if |x| >= $(POWER 2,64).
*/
+version(LLVMDC)
+version(LDC)
+{
+ alias llvm_cos_f32 cos;
+ alias llvm_cos_f64 cos;
@@ -585,7 +585,7 @@ Index: tango/math/Math.d
* Bugs:
* Results are undefined if |x| >= $(POWER 2,64).
*/
+version(LLVMDC)
+version(LDC)
+{
+ alias llvm_sin_f32 sin;
+ alias llvm_sin_f64 sin;
@@ -620,7 +620,7 @@ Index: tango/math/Math.d
return tanl(x);
- } else {
+ }
+ else version(LLVMDC) {
+ else version(LDC) {
+ return tango.stdc.math.tanl(x);
+ }
+ else {
@@ -631,7 +631,7 @@ Index: tango/math/Math.d
* <tr> <td> +&infin; <td> +&infin; <td> no
* )
*/
+version(LLVMDC)
+version(LDC)
+{
+ alias llvm_sqrt_f32 sqrt;
+ alias llvm_sqrt_f64 sqrt;
@@ -667,7 +667,7 @@ Index: tango/math/Math.d
}
}
- return tango.stdc.math.powl(x, y);
+ version(LLVMDC_X86)
+ version(LDC_X86)
+ {
+ return llvm_pow_f80(x, y);
+ }
@@ -686,7 +686,7 @@ Index: tango/stdc/stdlib.d
{
void* alloca(size_t size);
}
+else version( LLVMDC )
+else version( LDC )
+{
+ pragma(alloca)
+ void* alloca(size_t size);
@@ -702,9 +702,9 @@ Index: tango/stdc/stdarg.d
{
public import std.c.stdarg;
}
+else version( LLVMDC )
+else version( LDC )
+{
+ public import llvmdc.cstdarg;
+ public import ldc.cstdarg;
+}
else
{

View File

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