Showing with 2,812 additions and 277 deletions.
  1. +2 −2 .gitmodules
  2. +49 −77 .travis.yml
  3. +18 −2 CMakeLists.txt
  4. +5 −5 appveyor.yml
  5. +8 −0 cmake/Modules/FindLLVM.cmake
  6. +1 −2 cmake/Modules/GetGitRevisionDescription.cmake
  7. +1 −0 dmd2/cond.c
  8. +4 −0 dmd2/expression.c
  9. +5 −0 dmd2/expression.h
  10. +1 −0 dmd2/globals.h
  11. +186 −0 dmd2/root/longdouble.h
  12. +59 −7 dmd2/root/port.c
  13. +3 −0 dmd2/root/port.h
  14. +28 −2 driver/cl_options.cpp
  15. +2 −0 driver/cl_options.h
  16. +13 −4 driver/configfile.cpp
  17. +4 −6 driver/ldmd.cpp
  18. +19 −1 driver/linker.cpp
  19. +107 −9 driver/main.cpp
  20. +111 −50 driver/targetmachine.cpp
  21. +16 −3 driver/targetmachine.h
  22. +8 −7 gen/abi-aarch64.cpp
  23. +6 −6 gen/abi-arm.cpp
  24. +178 −0 gen/abi-ios-arm.cpp
  25. +21 −0 gen/abi-ios-arm.h
  26. +156 −0 gen/abi-ios-arm64.cpp
  27. +21 −0 gen/abi-ios-arm64.h
  28. +14 −1 gen/abi-mips64.cpp
  29. +37 −27 gen/abi-ppc.cpp
  30. +13 −30 gen/abi-ppc64le.cpp
  31. +1 −1 gen/abi-x86.cpp
  32. +6 −0 gen/abi.cpp
  33. +4 −0 gen/arrays.cpp
  34. +3 −4 gen/asm-x86.h
  35. +5 −0 gen/functions.cpp
  36. +23 −7 gen/llvmhelpers.cpp
  37. +5 −6 gen/llvmhelpers.h
  38. +1 −2 gen/logger.h
  39. +23 −0 gen/module.cpp
  40. +4 −6 gen/naked.cpp
  41. +8 −0 gen/target.cpp
  42. +13 −0 gen/toconstelem.cpp
  43. +4 −0 gen/toir.cpp
  44. +15 −0 gen/tollvm.cpp
  45. +8 −0 gen/typinf.cpp
  46. +4 −0 ir/irclass.cpp
  47. +9 −2 ir/irtype.cpp
  48. +147 −4 runtime/CMakeLists.txt
  49. +1 −1 runtime/druntime
  50. +1 −1 runtime/phobos
  51. +1 −1 tests/d2/dmd-testsuite
  52. +14 −1 utils/FileCheck-3.9.cpp
  53. +1,416 −0 utils/FileCheck-4.0.cpp
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[submodule "druntime"]
path = runtime/druntime
url = git://github.com/ldc-developers/druntime.git
url = git://github.com/smolt/druntime.git
[submodule "phobos"]
path = runtime/phobos
url = git://github.com/ldc-developers/phobos.git
url = git://github.com/smolt/phobos.git
[submodule "tests/d2/dmd-testsuite"]
path = tests/d2/dmd-testsuite
url = git://github.com/ldc-developers/dmd-testsuite.git
126 changes: 49 additions & 77 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,33 @@
language: cpp
sudo: false
os:
- linux
- osx

matrix:
include:
- os: linux
env: LLVM_VERSION=3.9.0
- os: linux
env: LLVM_VERSION=3.8.1
- os: linux
env: LLVM_VERSION=3.7.1 OPTS="-DMULTILIB=ON"
- os: linux
env: LLVM_VERSION=3.6.2 OPTS="-DBUILD_SHARED_LIBS=ON"
- os: linux
env: LLVM_VERSION=3.5.2 OPTS="-DTEST_COVERAGE=ON"
- os: osx
env: LLVM_CONFIG="llvm-config-3.8"
allow_failures:
#- env: LLVM_VERSION=3.9

cache:
directories:
- llvm-3.9.0
- llvm-3.8.1
- llvm-3.7.1
- llvm-3.6.2
- llvm-3.5.2
addons:
apt:
sources:
- llvm-toolchain-precise
- llvm-toolchain-precise-3.5
- llvm-toolchain-precise-3.6
- llvm-toolchain-precise-3.7
- llvm-toolchain-precise-3.8
- ubuntu-toolchain-r-test
packages:
- libconfig++8-dev
Expand All @@ -21,94 +38,49 @@ addons:
- g++-4.9-multilib
- gcc-multilib
- g++-multilib
- linux-libc-dev:i386
- libcurl3:i386
- libedit2
- libedit-dev
- llvm-3.5
- llvm-3.5-dev
- llvm-3.6
- llvm-3.6-dev
- llvm-3.7
- llvm-3.7-dev
- llvm-3.8
- llvm-3.8-dev
- llvm-3.9
- llvm-3.9-dev
- libcurl3:i386
before_install:
-
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
if [ -z "$(ls -A llvm-$LLVM_VERSION)" ]; then
wget -O llvm-$LLVM_VERSION.tar.xz http://llvm.org/releases/$LLVM_VERSION/clang+llvm-$LLVM_VERSION-x86_64-linux-gnu-ubuntu-14.04.tar.xz;
mkdir llvm-$LLVM_VERSION;
tar -xvf llvm-$LLVM_VERSION.tar.xz --strip 1 -C llvm-$LLVM_VERSION;
fi;
llvm-$LLVM_VERSION/bin/llvm-config --version;
export LLVM_CONFIG="llvm-$LLVM_VERSION/bin/llvm-config";
fi
install:
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then export CC="gcc-4.9"; export CXX="g++-4.9"; fi
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew update; brew install llvm37; brew install libconfig; fi;
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew update; brew install llvm38; brew install libconfig; fi;
- pip install --user lit
- python -c "import lit; lit.main();" --version | head -n 1
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then gdb --version; fi

env:
- LLVM_CONFIG="llvm-config-3.7" OPTS="-DMULTILIB=ON"
- LLVM_CONFIG="llvm-config-3.6" OPTS="-DBUILD_SHARED_LIBS=ON"
- LLVM_CONFIG="llvm-config-3.5" OPTS="-DTEST_COVERAGE=ON"
- LLVM_CONFIG="llvm-config-3.8"
- LLVM_CONFIG="llvm-config-3.9"
# OSX only (and the only ones for OSX):
- LLVM_CONFIG="llvm-config-3.7" TEST_CONFIG="Debug"
- LLVM_CONFIG="llvm-config-3.7" TEST_CONFIG="Release"
matrix:
allow_failures:
- env: LLVM_CONFIG="llvm-config-3.9"
exclude:
- os: linux
env: LLVM_CONFIG="llvm-config-3.7" TEST_CONFIG="Debug"
- os: linux
env: LLVM_CONFIG="llvm-config-3.7" TEST_CONFIG="Release"
- os: osx
env: LLVM_CONFIG="llvm-config-3.7" OPTS="-DMULTILIB=ON"
- os: osx
env: LLVM_CONFIG="llvm-config-3.6" OPTS="-DBUILD_SHARED_LIBS=ON"
- os: osx
env: LLVM_CONFIG="llvm-config-3.5" OPTS="-DTEST_COVERAGE=ON"
- os: osx
env: LLVM_CONFIG="llvm-config-3.8"
- os: osx
env: LLVM_CONFIG="llvm-config-3.9"
script:
- cmake --version
- cmake -DLLVM_CONFIG=$(which ${LLVM_CONFIG}) $OPTS .
- make -j3
# Outputs some environment info, plus makes sure we only run the test suite
# if we could actually build the executable.
- bin/ldc2 -version || exit 1
# Build Phobos & druntime unittest modules.
-
if [ "${TEST_CONFIG}" = "Debug" ]; then
MAKEOPTS=-j2 ctest --verbose -R "build-phobos2-ldc-unittest-debug";
MAKEOPTS=-j3 ctest --verbose -R "build-druntime-ldc-unittest-debug";
elif [ "${TEST_CONFIG}" = "Release" ]; then
MAKEOPTS=-j2 ctest --verbose -R "build-phobos2-ldc-unittest" -E "-debug";
MAKEOPTS=-j3 ctest --verbose -R "build-druntime-ldc-unittest" -E "-debug";
if [ "${OPTS}" = "-DMULTILIB=ON" ]; then
make -j2 phobos2-ldc-unittest-debug phobos2-ldc-unittest phobos2-ldc-unittest-debug-32 phobos2-ldc-unittest-32;
make -j3 druntime-ldc-unittest-debug druntime-ldc-unittest druntime-ldc-unittest-debug-32 druntime-ldc-unittest-32;
else
MAKEOPTS=-j2 ctest --verbose -R "build-phobos2-ldc-unittest";
MAKEOPTS=-j3 ctest --verbose -R "build-druntime-ldc-unittest";
make -j2 phobos2-ldc-unittest-debug phobos2-ldc-unittest;
make -j3 druntime-ldc-unittest-debug druntime-ldc-unittest;
fi
# Run dmd-testsuite.
-
if [ "${TEST_CONFIG}" = "Debug" ]; then
CC="" MAKEOPTS=-j4 ctest --verbose -R "dmd-testsuite-debug";
elif [ "${TEST_CONFIG}" = "Release" ]; then
CC="" MAKEOPTS=-j4 ctest --verbose -R "dmd-testsuite" -E "-debug";
else
CC="" MAKEOPTS=-j4 ctest --verbose -R "dmd-testsuite";
fi
- CC="" DMD_TESTSUITE_MAKE_ARGS=-j3 ctest --verbose -R "dmd-testsuite"
# Run LLVM IR testsuite.
- ctest --output-on-failure -R "llvm-ir-testsuite"
- ctest --output-on-failure -V -R "lit-tests"
# Link and run Phobos & druntime unittest runners.
-
if [ "${TEST_CONFIG}" = "Debug" ]; then
MAKEOPTS=-j3 ctest --verbose -R "-test-runner-debug";
ctest -j4 --output-on-failure -R "-debug" -E "testsuite";
elif [ "${TEST_CONFIG}" = "Release" ]; then
MAKEOPTS=-j3 ctest --verbose -R "-test-runner" -E "-debug";
ctest -j4 --output-on-failure -E "(-debug|testsuite)";
else
MAKEOPTS=-j3 ctest --verbose -R "-test-runner";
ctest -j4 --output-on-failure -E "testsuite";
fi
- ctest -j3 --output-on-failure -E "dmd-testsuite|lit-tests"

after_success:
-
Expand All @@ -128,4 +100,4 @@ notifications:
on_success: always
on_failure: always
use_notice: false
skip_join: true
skip_join: true
20 changes: 18 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ include(GetLinuxDistribution)
#

# Version information
set(LDC_VERSION "0.17.1") # May be overridden by git hash tag
set(LDC_VERSION "0.17.3") # May be overridden by git hash tag
set(DMDFE_MAJOR_VERSION 2)
set(DMDFE_MINOR_VERSION 0)
set(DMDFE_PATCH_VERSION 68)
Expand Down Expand Up @@ -191,6 +191,14 @@ if(CMAKE_COMPILER_IS_GNUCXX)
string(REPLACE "-Wcovered-switch-default " "" LLVM_CXXFLAGS ${LLVM_CXXFLAGS})
string(REPLACE "-fcolor-diagnostics " "" LLVM_CXXFLAGS ${LLVM_CXXFLAGS})
endif()

if(IPHONEOS_ARCHS)
# Enable cross compile to target real
append("-DUSE_OSX_TARGET_REAL" DMD_CXXFLAGS LDC_CXXFLAGS)
# Override llvm default target triple with one for iOS
append("-DIPHONEOS_DEFAULT_TRIPLE" LDC_CXXFLAGS)
endif()

#
# Run idgen and impcnvgen.
#
Expand Down Expand Up @@ -249,7 +257,15 @@ if(NOT TAG MATCHES "NOTFOUND")
else()
get_git_head_revision(REFSPEC HASH)
if(NOT HASH STREQUAL "GITDIR-NOTFOUND")
string(SUBSTRING "${HASH}" 0 6 LDC_VERSION)
# Append git hash to LDC_VERSION
string(SUBSTRING "${HASH}" 0 7 LDC_VERSION_HASH)
set(LDC_VERSION "${LDC_VERSION}git-${LDC_VERSION_HASH}")

# Append "-dirty" when the working copy is dirty
git_describe(GIT_DIRTY --dirty)
if (GIT_DIRTY MATCHES ".*-dirty")
set(LDC_VERSION "${LDC_VERSION}-dirty")
endif()
endif()
endif()
message(STATUS "LDC version identifier: ${LDC_VERSION}")
Expand Down
10 changes: 5 additions & 5 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,25 @@ install:
- git checkout 7585cf6
- cd ..
## Download & extract LLVM source
#- ps: Start-FileDownload 'http://llvm.org/pre-releases/3.7.0/rc3/llvm-3.7.0rc3.src.tar.xz' -FileName 'llvm.src.tar.xz'
#- appveyor DownloadFile "http://llvm.org/pre-releases/3.7.0/rc3/llvm-3.7.0rc3.src.tar.xz" -FileName llvm.src.tar.xz
#- 7z x llvm.src.tar.xz -so | 7z x -si -ttar > nul
#- ren llvm-3.7.0rc3.src llvm
# Download a pre-built LLVM & extract
- ps: Start-FileDownload 'https://dl.dropboxusercontent.com/s/5cok3dvmohtduy6/llvm-x64-release.7z?dl=0' -FileName 'llvm-x64.7z'
# Download & extract a pre-built LLVM (CMAKE_BUILD_TYPE=Release, LLVM_ENABLE_ASSERTIONS=ON)
- appveyor DownloadFile "https://dl.dropboxusercontent.com/s/kkmr30ntlay843f/LLVM-3.9.0-x64.7z?dl=0" -FileName llvm-x64.7z
- md llvm-x64
- cd llvm-x64
- 7z x ..\llvm-x64.7z > nul
- cd ..
# Download & install Ninja
- ps: Start-FileDownload 'https://github.com/ninja-build/ninja/releases/download/v1.6.0/ninja-win.zip' -FileName 'ninja.zip'
- appveyor DownloadFile "https://github.com/ninja-build/ninja/releases/download/v1.6.0/ninja-win.zip" -FileName ninja.zip
- md ninja
- cd ninja
- 7z x ..\ninja.zip > nul
- cd ..
- set PATH=c:\projects\ninja;%PATH%
- ninja --version
# Download & extract libcurl
- ps: Start-FileDownload 'http://d.darktech.org/libcurl-7.43.0-WinSSL-zlib-x86-x64.zip' -FileName 'libcurl.zip'
- appveyor DownloadFile "http://d.darktech.org/libcurl-7.43.0-WinSSL-zlib-x86-x64.zip" -FileName libcurl.zip
- md libcurl
- cd libcurl
- 7z x ..\libcurl.zip > nul
Expand Down
8 changes: 8 additions & 0 deletions cmake/Modules/FindLLVM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ if ((WIN32 AND NOT(MINGW OR CYGWIN)) OR NOT LLVM_CONFIG)
# Versions beginning with 3.8 do not support component ipa
list(REMOVE_ITEM LLVM_FIND_COMPONENTS "ipa" index)
endif()
if(${LLVM_VERSION_STRING} MATCHES "^4\\.[\\.0-9A-Za-z]*")
# Versions beginning with 4. do not support component ipa
list(REMOVE_ITEM LLVM_FIND_COMPONENTS "ipa" index)
endif()

if(${LLVM_VERSION_STRING} MATCHES "^3\\.[0-4][\\.0-9A-Za-z]*")
llvm_map_components_to_libraries(tmplibs ${LLVM_FIND_COMPONENTS})
Expand Down Expand Up @@ -164,6 +168,10 @@ else()
# Versions beginning with 3.8 do not support component ipa
list(REMOVE_ITEM LLVM_FIND_COMPONENTS "ipa" index)
endif()
if(${LLVM_VERSION_STRING} MATCHES "^4\\.[\\.0-9A-Za-z]*")
# Versions beginning with 4. do not support component ipa
list(REMOVE_ITEM LLVM_FIND_COMPONENTS "ipa" index)
endif()

llvm_set(LDFLAGS ldflags)
if(NOT ${LLVM_VERSION_STRING} MATCHES "^3\\.[0-4][\\.0-9A-Za-z]*")
Expand Down
3 changes: 1 addition & 2 deletions cmake/Modules/GetGitRevisionDescription.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ function(git_describe _var)
execute_process(COMMAND
git
describe
HEAD
${ARGN}
WORKING_DIRECTORY
"${CMAKE_SOURCE_DIR}"
Expand All @@ -102,6 +101,6 @@ function(git_describe _var)
endfunction()

function(git_get_exact_tag _var)
git_describe(out --exact-match --tag ${ARGN})
git_describe(out HEAD --exact-match --tag ${ARGN})
set(${_var} "${out}" PARENT_SCOPE)
endfunction()
1 change: 1 addition & 0 deletions dmd2/cond.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ bool VersionCondition::isPredefined(const char *ident)
"Win64",
"linux",
"OSX",
"iOS",
"FreeBSD",
"OpenBSD",
"NetBSD",
Expand Down
4 changes: 4 additions & 0 deletions dmd2/expression.c
Original file line number Diff line number Diff line change
Expand Up @@ -3028,7 +3028,11 @@ Expression *ErrorExp::toLvalue(Scope *sc, Expression *e)
RealExp::RealExp(Loc loc, real_t value, Type *type)
: Expression(loc, TOKfloat64, sizeof(RealExp))
{
#if USE_OSX_TARGET_REAL
//printf("RealExp::RealExp(%Lg)\n", (long double)value);
#else
//printf("RealExp::RealExp(%Lg)\n", value);
#endif
this->value = value;
this->type = type;
}
Expand Down
5 changes: 5 additions & 0 deletions dmd2/expression.h
Original file line number Diff line number Diff line change
Expand Up @@ -1617,7 +1617,12 @@ struct UnionExp
char sliceexp [sizeof(SliceExp)];

// Ensure that the union is suitably aligned.
#if USE_OSX_TARGET_REAL
// TODO: need to fix so this conditional is not needed
long double for_alignment_only;
#else
longdouble for_alignment_only;
#endif
} u;
};

Expand Down
1 change: 1 addition & 0 deletions dmd2/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ struct Param
// Codegen cl options
bool singleObj;
bool disableRedZone;
bool disableTls;
#endif
};

Expand Down
Loading