More tweaks.

This commit is contained in:
Robert Clipsham
2009-06-01 18:58:21 +01:00
parent c5be82c5ae
commit 91ddf6140a
8 changed files with 59 additions and 5 deletions

View File

@@ -8,6 +8,7 @@ syntax: glob
*.a
*.s
*.so
*.swp
*.rej
Makefile
CMakeFiles

View File

@@ -70,10 +70,12 @@ option(GENERATE_OFFTI "generate complete ClassInfo.offTi arrays")
if(D_VERSION EQUAL 1)
set(DMDFE_PATH dmd)
set(LDC_EXE ldc)
set(LDMD_EXE ldmd)
add_definitions(-DDMDV1)
elseif(D_VERSION EQUAL 2)
set(DMDFE_PATH dmd2)
set(LDC_EXE ldc2)
set(LDMD_EXE ldmd2)
add_definitions(-DDMDV2)
else(D_VERSION EQUAL 1)
message(FATAL_ERROR "unsupported D version")
@@ -230,7 +232,7 @@ get_target_property(LDC_LOC ${LDC_EXE} LOCATION)
# TODO: testrun
install(TARGETS ${LDC_EXE} DESTINATION bin)
install(FILES ${PROJECT_SOURCE_DIR}/bin/ldmd DESTINATION bin)
install(FILES ${PROJECT_SOURCE_DIR}/bin/${LDMD_EXE} DESTINATION bin)
install(FILES ${PROJECT_BINARY_DIR}/bin/${LDC_EXE}.conf DESTINATION ${CONF_INST_DIR})
install(FILES ${PROJECT_BINARY_DIR}/bin/${LDC_EXE}.rebuild.conf DESTINATION ${CONF_INST_DIR})
install(DIRECTORY ${PROJECT_BINARY_DIR}/lib DESTINATION . USE_SOURCE_PERMISSIONS)

43
bin/ldmd2 Executable file
View File

@@ -0,0 +1,43 @@
#! /usr/bin/env bash
# Default to 'ldc' next to this file
LDC=`basename "$0"`/ldc2
if [ ! -x "$LDC" ]; then
# If that doesn't work, assume this script was called via $PATH
# and do the same for ldc
if which ldc2 &> /dev/null; then
LDC=ldc2
else
echo 'ldc not found, check your installation' >/dev/stderr
exit 1
fi
fi
declare -a ARGS
IDX=0
for arg; do
case "$arg" in
-C*)
# turn -Cfoo into -foo.
# Useful for passing -inline to ldc, for instance.
arg="-${arg:2}"
;;
-debug|-debug=*|-version=*)
arg="-d$arg"
;;
-inline)
arg="-enable-inlining"
;;
-fPIC)
arg="-relocation-model=pic"
;;
--a|--b|--c|--f|--r|--w|--x|--y)
# "Hidden debug switches"
# Are these ever used?
arg="-hidden-debug${arg:1}"
;;
esac
ARGS[IDX++]="$arg"
done
exec "$LDC" "${ARGS[@]}"

Binary file not shown.

Binary file not shown.

View File

@@ -672,6 +672,8 @@ LLConstant* DtoDefineClassInfo(ClassDeclaration* cd)
// ClassInfo *base; // base class
// void *destructor;
// void *invariant; // class invariant
// version(D_Version2)
// void *xgetMembers;
// uint flags;
// void *deallocator;
// OffsetTypeInfo[] offTi;
@@ -690,7 +692,11 @@ LLConstant* DtoDefineClassInfo(ClassDeclaration* cd)
ClassDeclaration* cinfo = ClassDeclaration::classinfo;
#if DMDV2
if (cinfo->fields.dim != 13)
#else
if (cinfo->fields.dim != 12)
#endif
{
error("object.d ClassInfo class is incorrect");
fatal();

View File

@@ -620,7 +620,11 @@ void Module::genmoduleinfo()
fatal();
}
// check for patch
#if DMDV2
else if (moduleinfo->fields.dim != 10)
#else
else if (moduleinfo->fields.dim != 9)
#endif
{
error("object.d ModuleInfo class is incorrect");
fatal();

View File

@@ -178,12 +178,10 @@ LLConstant * IrStruct::getVtblInit()
// build the constant struct
constVtbl = llvm::ConstantStruct::get(constants, false);
// sanity check
#if 0
IF_LOG Logger::cout() << "constVtbl type: " << *constVtbl->getType() << std::endl;
IF_LOG Logger::cout() << "vtbl type: " << *type->irtype->isClass()->getVtbl() << std::endl;
IF_LOG Logger::cout() << "constVtbl type: " << *constVtbl->getType() << std::endl;
IF_LOG Logger::cout() << "vtbl type: " << *type->irtype->isClass()->getVtbl() << std::endl;
#endif
assert(constVtbl->getType() == type->irtype->isClass()->getVtbl() &&
"vtbl initializer type mismatch");