# HG changeset patch # User Robert Clipsham # Date 1243879101 -3600 # Node ID f35a9a77d2567640a29c882684fc90a2a0066b3f # Parent 638d16625da28ae9327b34c1b66c6ac650b00dd7 More tweaks. diff -r 638d16625da2 -r f35a9a77d256 .hgignore --- 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 diff -r 638d16625da2 -r f35a9a77d256 CMakeLists.txt --- 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) diff -r 638d16625da2 -r f35a9a77d256 bin/ldmd2 --- /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[@]}" diff -r 638d16625da2 -r f35a9a77d256 dmd2/idgen Binary file dmd2/idgen has changed diff -r 638d16625da2 -r f35a9a77d256 dmd2/impcnvgen Binary file dmd2/impcnvgen has changed diff -r 638d16625da2 -r f35a9a77d256 gen/classes.cpp --- 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(); diff -r 638d16625da2 -r f35a9a77d256 gen/toobj.cpp --- 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(); diff -r 638d16625da2 -r f35a9a77d256 ir/irclass.cpp --- 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");