Mercurial > projects > ldc
changeset 1453:f35a9a77d256
More tweaks.
author | Robert Clipsham <robert@octarineparrot.com> |
---|---|
date | Mon, 01 Jun 2009 18:58:21 +0100 |
parents | 638d16625da2 |
children | ff707c518ad7 |
files | .hgignore CMakeLists.txt bin/ldmd2 dmd2/idgen dmd2/impcnvgen gen/classes.cpp gen/toobj.cpp ir/irclass.cpp |
diffstat | 8 files changed, 59 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgignore Sat May 30 17:23:32 2009 +0100 +++ b/.hgignore Mon Jun 01 18:58:21 2009 +0100 @@ -8,6 +8,7 @@ *.a *.s *.so +*.swp *.rej Makefile CMakeFiles
--- a/CMakeLists.txt Sat May 30 17:23:32 2009 +0100 +++ b/CMakeLists.txt Mon Jun 01 18:58:21 2009 +0100 @@ -70,10 +70,12 @@ 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 @@ # 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)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/ldmd2 Mon Jun 01 18:58:21 2009 +0100 @@ -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[@]}"
--- a/gen/classes.cpp Sat May 30 17:23:32 2009 +0100 +++ b/gen/classes.cpp Mon Jun 01 18:58:21 2009 +0100 @@ -672,6 +672,8 @@ // 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 @@ 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();
--- a/gen/toobj.cpp Sat May 30 17:23:32 2009 +0100 +++ b/gen/toobj.cpp Mon Jun 01 18:58:21 2009 +0100 @@ -620,7 +620,11 @@ 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();
--- a/ir/irclass.cpp Sat May 30 17:23:32 2009 +0100 +++ b/ir/irclass.cpp Mon Jun 01 18:58:21 2009 +0100 @@ -178,12 +178,10 @@ // 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");