Skip to content

Commit

Permalink
Merge branch 'master' into release-0.16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
redstar committed Oct 10, 2015
2 parents 4760a64 + 8374689 commit 8dcb5d6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ include(CheckCXXCompilerFlag)
find_package(LLVM 3.1 REQUIRED
all-targets analysis asmparser asmprinter bitreader bitwriter codegen core debuginfodwarf instcombine ipa ipo instrumentation linker lto mc mcdisassembler mcparser objcarcopts object option profiledata scalaropts selectiondag support tablegen target transformutils vectorize ${EXTRA_LLVM_MODULES})
math(EXPR LDC_LLVM_VER ${LLVM_VERSION_MAJOR}*100+${LLVM_VERSION_MINOR})
# Remove LLVMTableGen library from list of libraries
string(REGEX MATCH "^-.*LLVMTableGen[^;]*;|;-.*LLVMTableGen[^;]*" LLVM_TABLEGEN_LIBRARY "${LLVM_LIBRARIES}")
string(REGEX REPLACE "^-.*LLVMTableGen[^;]*;|;-.*LLVMTableGen[^;]*" "" LLVM_LIBRARIES "${LLVM_LIBRARIES}")

#
# Locate libconfig.
Expand Down Expand Up @@ -488,7 +491,7 @@ set_target_properties(
COMPILE_FLAGS "${TABLEGEN_CXXFLAGS} ${LDC_CXXFLAGS}"
LINK_FLAGS "${SANITIZE_LDFLAGS}"
)
target_link_libraries(gen_gccbuiltins ${LLVM_LIBRARIES} ${PTHREAD_LIBS} ${TERMINFO_LIBS} ${CMAKE_DL_LIBS} "${LLVM_LDFLAGS}")
target_link_libraries(gen_gccbuiltins ${LLVM_TABLEGEN_LIBRARY} ${LLVM_LIBRARIES} ${PTHREAD_LIBS} ${TERMINFO_LIBS} ${CMAKE_DL_LIBS} "${LLVM_LDFLAGS}")
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
target_link_libraries(gen_gccbuiltins dl)
endif()
Expand Down
5 changes: 2 additions & 3 deletions cmake/Modules/FindLLVM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ else()
file(TO_CMAKE_PATH "${LLVM_${var}}" LLVM_${var})
endif()
endmacro()
macro(llvm_set_libs var flag prefix)
macro(llvm_set_libs var flag)
if(LLVM_FIND_QUIETLY)
set(_quiet_arg ERROR_QUIET)
endif()
Expand All @@ -142,7 +142,6 @@ else()
${_quiet_arg}
)
file(TO_CMAKE_PATH "${tmplibs}" tmplibs)
string(REGEX REPLACE "([$^.[|*+?()]|])" "\\\\\\1" pattern "${prefix}/")
string(REGEX MATCHALL "${pattern}[^ ]+" LLVM_${var} ${tmplibs})
endmacro()

Expand Down Expand Up @@ -181,7 +180,7 @@ else()
string(REPLACE "\n" " " LLVM_LDFLAGS "${LLVM_LDFLAGS} ${LLVM_SYSTEM_LIBS}")
endif()
llvm_set(LIBRARY_DIRS libdir true)
llvm_set_libs(LIBRARIES libfiles "${LLVM_LIBRARY_DIRS}")
llvm_set_libs(LIBRARIES libs)
endif()

# On CMake builds of LLVM, the output of llvm-config --cxxflags does not
Expand Down
2 changes: 1 addition & 1 deletion gen/nested.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ static void DtoCreateNestedContextType(FuncDeclaration* fd)
// start with adding all enclosing parent frames until a static parent is reached

LLStructType* innerFrameType = NULL;
int depth = 0;
unsigned depth = 0;

if (parentFunc)
{
Expand Down
2 changes: 1 addition & 1 deletion gen/programs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ std::string getGcc()
{
#if defined(__FreeBSD__) && __FreeBSD__ >= 10
// Default compiler on FreeBSD 10 is clang
return getProgram("clang", gcc, "CC");
return getProgram("clang", &gcc, "CC");
#else
return getProgram("gcc", &gcc, "CC");
#endif
Expand Down

0 comments on commit 8dcb5d6

Please sign in to comment.