Skip to content

Commit 8dcb5d6

Browse files
committed
Merge branch 'master' into release-0.16.0
2 parents 4760a64 + 8374689 commit 8dcb5d6

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ include(CheckCXXCompilerFlag)
1818
find_package(LLVM 3.1 REQUIRED
1919
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})
2020
math(EXPR LDC_LLVM_VER ${LLVM_VERSION_MAJOR}*100+${LLVM_VERSION_MINOR})
21+
# Remove LLVMTableGen library from list of libraries
22+
string(REGEX MATCH "^-.*LLVMTableGen[^;]*;|;-.*LLVMTableGen[^;]*" LLVM_TABLEGEN_LIBRARY "${LLVM_LIBRARIES}")
23+
string(REGEX REPLACE "^-.*LLVMTableGen[^;]*;|;-.*LLVMTableGen[^;]*" "" LLVM_LIBRARIES "${LLVM_LIBRARIES}")
2124

2225
#
2326
# Locate libconfig.
@@ -488,7 +491,7 @@ set_target_properties(
488491
COMPILE_FLAGS "${TABLEGEN_CXXFLAGS} ${LDC_CXXFLAGS}"
489492
LINK_FLAGS "${SANITIZE_LDFLAGS}"
490493
)
491-
target_link_libraries(gen_gccbuiltins ${LLVM_LIBRARIES} ${PTHREAD_LIBS} ${TERMINFO_LIBS} ${CMAKE_DL_LIBS} "${LLVM_LDFLAGS}")
494+
target_link_libraries(gen_gccbuiltins ${LLVM_TABLEGEN_LIBRARY} ${LLVM_LIBRARIES} ${PTHREAD_LIBS} ${TERMINFO_LIBS} ${CMAKE_DL_LIBS} "${LLVM_LDFLAGS}")
492495
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
493496
target_link_libraries(gen_gccbuiltins dl)
494497
endif()

cmake/Modules/FindLLVM.cmake

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ else()
131131
file(TO_CMAKE_PATH "${LLVM_${var}}" LLVM_${var})
132132
endif()
133133
endmacro()
134-
macro(llvm_set_libs var flag prefix)
134+
macro(llvm_set_libs var flag)
135135
if(LLVM_FIND_QUIETLY)
136136
set(_quiet_arg ERROR_QUIET)
137137
endif()
@@ -142,7 +142,6 @@ else()
142142
${_quiet_arg}
143143
)
144144
file(TO_CMAKE_PATH "${tmplibs}" tmplibs)
145-
string(REGEX REPLACE "([$^.[|*+?()]|])" "\\\\\\1" pattern "${prefix}/")
146145
string(REGEX MATCHALL "${pattern}[^ ]+" LLVM_${var} ${tmplibs})
147146
endmacro()
148147

@@ -181,7 +180,7 @@ else()
181180
string(REPLACE "\n" " " LLVM_LDFLAGS "${LLVM_LDFLAGS} ${LLVM_SYSTEM_LIBS}")
182181
endif()
183182
llvm_set(LIBRARY_DIRS libdir true)
184-
llvm_set_libs(LIBRARIES libfiles "${LLVM_LIBRARY_DIRS}")
183+
llvm_set_libs(LIBRARIES libs)
185184
endif()
186185

187186
# On CMake builds of LLVM, the output of llvm-config --cxxflags does not

gen/nested.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ static void DtoCreateNestedContextType(FuncDeclaration* fd)
320320
// start with adding all enclosing parent frames until a static parent is reached
321321

322322
LLStructType* innerFrameType = NULL;
323-
int depth = 0;
323+
unsigned depth = 0;
324324

325325
if (parentFunc)
326326
{

gen/programs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ std::string getGcc()
6767
{
6868
#if defined(__FreeBSD__) && __FreeBSD__ >= 10
6969
// Default compiler on FreeBSD 10 is clang
70-
return getProgram("clang", gcc, "CC");
70+
return getProgram("clang", &gcc, "CC");
7171
#else
7272
return getProgram("gcc", &gcc, "CC");
7373
#endif

0 commit comments

Comments
 (0)