mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-21 15:23:13 +01:00
More tweaks.
This commit is contained in:
@@ -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
43
bin/ldmd2
Executable 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[@]}"
|
||||
BIN
dmd2/idgen
BIN
dmd2/idgen
Binary file not shown.
BIN
dmd2/impcnvgen
BIN
dmd2/impcnvgen
Binary file not shown.
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user