Skip to content

Commit

Permalink
Merge branch 'master' into release-0.15.2
Browse files Browse the repository at this point in the history
  • Loading branch information
redstar committed Jun 28, 2015
2 parents 99cd42a + 6d3923e commit 2569c6e
Show file tree
Hide file tree
Showing 89 changed files with 2,574 additions and 1,321 deletions.
19 changes: 14 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,29 @@ install:
if [[ "${LLVM_PACKAGE}" == *3\.[567]* ]] && [[ "${CXX}" == "clang++" ]]; then
sudo apt-get install --allow-unauthenticated -qq clang-3.4; export CXX="clang++-3.4";
fi
-
if [[ "${OPTS}" == *TEST_COVERAGE*ON* ]]; then
sudo pip install cpp-coveralls;
fi
env:
- LLVM_PACKAGE="llvm-3.1 llvm-3.1-dev"
- LLVM_PACKAGE="llvm-3.2 llvm-3.2-dev"
- LLVM_PACKAGE="llvm-3.3 llvm-3.3-dev" TEST_DEBUG=1
- LLVM_PACKAGE="llvm-3.3 llvm-3.3-dev"
- LLVM_PACKAGE="llvm-3.4 llvm-3.4-dev" TEST_DEBUG=1
- LLVM_PACKAGE="llvm-3.4 llvm-3.4-dev" OPTS="-DMULTILIB=ON" TEST_BITNESS=32
- LLVM_PACKAGE="llvm-3.4 llvm-3.4-dev" OPTS="-DMULTILIB=ON" TEST_BITNESS=64
- LLVM_PACKAGE="llvm-3.4 llvm-3.4-dev" TEST_DEBUG=1 OPTS="-DBUILD_SHARED_LIBS=ON"
- LLVM_PACKAGE="llvm-3.4 llvm-3.4-dev" OPTS="-DBUILD_SHARED_LIBS=ON"
- LLVM_PACKAGE="llvm-3.5 llvm-3.5-dev libedit2 libedit-dev" TEST_DEBUG=1
- LLVM_PACKAGE="llvm-3.5 llvm-3.5-dev libedit2 libedit-dev"
- LLVM_PACKAGE="llvm-3.5 llvm-3.5-dev libedit2 libedit-dev" OPTS="-DTEST_COVERAGE=ON"
- LLVM_PACKAGE="llvm-3.6 llvm-3.6-dev libedit2 libedit-dev" TEST_DEBUG=1
- LLVM_PACKAGE="llvm-3.6 llvm-3.6-dev libedit2 libedit-dev"
- LLVM_PACKAGE="llvm-3.6 llvm-3.6-dev libedit2 libedit-dev" OPTS="-DMULTILIB=ON" TEST_BITNESS=32
- LLVM_PACKAGE="llvm-3.6 llvm-3.6-dev libedit2 libedit-dev" OPTS="-DMULTILIB=ON" TEST_BITNESS=64
- LLVM_PACKAGE="llvm-3.7 llvm-3.7-dev libedit2 libedit-dev" TEST_DEBUG=1
- LLVM_PACKAGE="llvm-3.7 llvm-3.7-dev libedit2 libedit-dev"
matrix:
allow_failures:
- env: LLVM_PACKAGE="llvm-3.6 llvm-3.6-dev libedit2 libedit-dev" TEST_DEBUG=1
- env: LLVM_PACKAGE="llvm-3.6 llvm-3.6-dev libedit2 libedit-dev"
- env: LLVM_PACKAGE="llvm-3.6 llvm-3.6-dev libedit2 libedit-dev" OPTS="-DMULTILIB=ON" TEST_BITNESS=32
- env: LLVM_PACKAGE="llvm-3.7 llvm-3.7-dev libedit2 libedit-dev" TEST_DEBUG=1
- env: LLVM_PACKAGE="llvm-3.7 llvm-3.7-dev libedit2 libedit-dev"
script:
Expand Down Expand Up @@ -101,6 +104,12 @@ script:
- ctest -j2 --verbose ${BUILD_SEL}
- ctest -j2 --output-on-failure ${RUN_SEL}

after_success:
-
if [[ "${OPTS}" == *TEST_COVERAGE*ON* ]]; then
coveralls -e runtime -e tests -e vcbuild --gcov gcov-4.9 --gcov-options '\-lp' > /dev/null 2>&1;
fi

notifications:
# Temporarily disabled due to time limit problems.
# email:
Expand Down
17 changes: 16 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ file(GLOB IR_SRC ir/*.cpp)
file(GLOB IR_HDR ir/*.h)
set(DRV_SRC
driver/cl_options.cpp
driver/codegenerator.cpp
driver/configfile.cpp
driver/targetmachine.cpp
driver/toobj.cpp
Expand All @@ -239,6 +240,7 @@ set(DRV_SRC
set(DRV_HDR
driver/linker.h
driver/cl_options.h
driver/codegenerator.h
driver/configfile.h
driver/ldc-version.h
driver/targetmachine.h
Expand Down Expand Up @@ -325,7 +327,7 @@ if(MSVC)
string(REGEX REPLACE "(^| ) */GR-? *( |$)" "\\1 \\2" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")

add_definitions(-D_HAS_EXCEPTIONS=0)
set(EXTRA_CXXFLAGS "/W0 /wd4996 /GF /GR- /EHs-c- /MP")
set(EXTRA_CXXFLAGS "/GF /GR- /EHs-c- /MP")
else()
set(EXTRA_CXXFLAGS "")
endif()
Expand Down Expand Up @@ -381,6 +383,19 @@ if( NOT WIN32 OR CYGWIN )
endforeach()
endif()

#
# Enable instrumentation for code coverage analysis
#
set(TEST_COVERAGE OFF CACHE BOOL "instrument compiler for code coverage analysis")
if(TEST_COVERAGE)
if(CMAKE_COMPILER_IS_GNUCXX OR (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang"))
append("-O0 -g -fprofile-arcs -ftest-coverage" EXTRA_CXXFLAGS)
append("--coverage" LLVM_LDFLAGS)
else()
message(WARNING "Coverage testing is not available.")
endif()
endif()

#
# Set up the main ldc/ldc2 target.
#
Expand Down
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
LDC – the LLVM-based D Compiler
===============================

[![Build Status](https://travis-ci.org/ldc-developers/ldc.png?branch=master)](https://travis-ci.org/ldc-developers/ldc) [![Bountysource](https://www.bountysource.com/badge/tracker?tracker_id=283332)](https://www.bountysource.com/trackers/283332-ldc?utm_source=283332&utm_medium=shield&utm_campaign=TRACKER_BADGE)
[![Build Status](https://travis-ci.org/ldc-developers/ldc.png?branch=master)][1]
[![Test Coverage](https://coveralls.io/repos/ldc-developers/ldc/badge.svg)][2]
[![Bountysource](https://www.bountysource.com/badge/tracker?tracker_id=283332)][3]

The LDC project aims to provide a portable D programming language
compiler with modern optimization and code generation capabilities.
Expand Down Expand Up @@ -52,3 +54,8 @@ For further documentation, contributor information, etc. please see
the D wiki: http://wiki.dlang.org/LDC

Feedback of any kind is very much appreciated!


[1]: https://travis-ci.org/ldc-developers/ldc "Build Status"
[2]: https://coveralls.io/r/ldc-developers/ldc "Test Coverage"
[3]: https://www.bountysource.com/trackers/283332-ldc?utm_source=283332&utm_medium=shield&utm_campaign=TRACKER_BADGE "Bountysource"
9 changes: 8 additions & 1 deletion cmake/Modules/GetGitRevisionDescription.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ set(__get_git_revision_description YES)
get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH)

function(get_git_head_revision _refspecvar _hashvar)
set(GIT_PARENT_DIR "${CMAKE_SOURCE_DIR}")
set(GIT_PARENT_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
set(GIT_DIR "${GIT_PARENT_DIR}/.git")
while(NOT EXISTS "${GIT_DIR}") # .git dir not found, search parent directories
set(GIT_PREVIOUS_PARENT "${GIT_PARENT_DIR}")
Expand All @@ -53,6 +53,13 @@ function(get_git_head_revision _refspecvar _hashvar)
endif()
set(GIT_DIR "${GIT_PARENT_DIR}/.git")
endwhile()
# check if this is a submodule
if(NOT IS_DIRECTORY ${GIT_DIR})
file(READ ${GIT_DIR} submodule)
string(REGEX REPLACE "gitdir: (.*)\n$" "\\1" GIT_DIR_RELATIVE ${submodule})
get_filename_component(SUBMODULE_DIR ${GIT_DIR} PATH)
get_filename_component(GIT_DIR ${SUBMODULE_DIR}/${GIT_DIR_RELATIVE} ABSOLUTE)
endif()
set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data")
if(NOT EXISTS "${GIT_DATA}")
file(MAKE_DIRECTORY "${GIT_DATA}")
Expand Down
9 changes: 6 additions & 3 deletions cmake/Modules/GetGitRevisionDescription.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@ if(HEAD_CONTENTS MATCHES "ref")
string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}")
if(EXISTS "@GIT_DIR@/${HEAD_REF}")
configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
elseif(EXISTS "@GIT_DIR@/logs/${HEAD_REF}")
configure_file("@GIT_DIR@/logs/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
set(HEAD_HASH "${HEAD_REF}")
else()
configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY)
file(READ "@GIT_DATA@/packed-refs" PACKED_REFS)
if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}")
set(HEAD_HASH "${CMAKE_MATCH_1}")
endif()
endif()
else()
# detached HEAD
Expand Down
4 changes: 2 additions & 2 deletions dmd2/builtin.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ Expression *eval_llvmminnum(Loc loc, FuncDeclaration *fd, Expressions *arguments
assert(arg0->op == TOKfloat64);
Expression *arg1 = (*arguments)[1];
assert(arg1->op == TOKfloat64);
return new RealExp(loc, fmin(arg0->toReal(), arg1->toReal()), type);
return new RealExp(loc, fminl(arg0->toReal(), arg1->toReal()), type);
}

Expression *eval_llvmmaxnum(Loc loc, FuncDeclaration *fd, Expressions *arguments)
Expand All @@ -176,7 +176,7 @@ Expression *eval_llvmmaxnum(Loc loc, FuncDeclaration *fd, Expressions *arguments
assert(arg0->op == TOKfloat64);
Expression *arg1 = (*arguments)[1];
assert(arg1->op == TOKfloat64);
return new RealExp(loc, fmax(arg0->toReal(), arg1->toReal()), type);
return new RealExp(loc, fmaxl(arg0->toReal(), arg1->toReal()), type);
}

Expression *eval_llvmfloor(Loc loc, FuncDeclaration *fd, Expressions *arguments)
Expand Down
Loading

0 comments on commit 2569c6e

Please sign in to comment.