Skip to content

Commit cbeeefc

Browse files
authored
Merge pull request #136 from RadeonOpenCompute/roc-1.7.1
roc-1.7.1 updates
2 parents aa423eb + 375235d commit cbeeefc

File tree

5,191 files changed

+454021
-169678
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

5,191 files changed

+454021
-169678
lines changed

.arcconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2+
"repository.callsign" : "L",
23
"conduit_uri" : "https://reviews.llvm.org/"
34
}

CMakeLists.txt

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ cmake_policy(SET CMP0056 NEW)
1818
cmake_policy(SET CMP0057 NEW)
1919

2020
if(NOT DEFINED LLVM_VERSION_MAJOR)
21-
set(LLVM_VERSION_MAJOR 6)
21+
set(LLVM_VERSION_MAJOR 7)
2222
endif()
2323
if(NOT DEFINED LLVM_VERSION_MINOR)
2424
set(LLVM_VERSION_MINOR 0)
@@ -110,7 +110,7 @@ endif()
110110
# LLVM_EXTERNAL_${project}_SOURCE_DIR using LLVM_ALL_PROJECTS
111111
# This allows an easy way of setting up a build directory for llvm and another
112112
# one for llvm+clang+... using the same sources.
113-
set(LLVM_ALL_PROJECTS "clang;libcxx;libcxxabi;lldb;compiler-rt;lld;polly")
113+
set(LLVM_ALL_PROJECTS "clang;libcxx;libcxxabi;lldb;compiler-rt;lld;polly;debuginfo-tests")
114114
set(LLVM_ENABLE_PROJECTS "" CACHE STRING
115115
"Semicolon-separated list of projects to build (${LLVM_ALL_PROJECTS}), or \"all\".")
116116
if( LLVM_ENABLE_PROJECTS STREQUAL "all" )
@@ -276,9 +276,9 @@ set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name
276276
set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')")
277277
mark_as_advanced(LLVM_TOOLS_INSTALL_DIR)
278278

279-
set(LLVM_UTILS_INSTALL_DIR "bin" CACHE STRING
279+
set(LLVM_UTILS_INSTALL_DIR "${LLVM_TOOLS_INSTALL_DIR}" CACHE STRING
280280
"Path to install LLVM utilities (enabled by LLVM_INSTALL_UTILS=ON) (defaults to LLVM_TOOLS_INSTALL_DIR)")
281-
mark_as_advanced(LLVM_TOOLS_INSTALL_DIR)
281+
mark_as_advanced(LLVM_UTILS_INSTALL_DIR)
282282

283283
# They are used as destination of target generators.
284284
set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)
@@ -385,18 +385,14 @@ option(LLVM_ENABLE_LLD "Use lld as C and C++ linker." OFF)
385385
option(LLVM_ENABLE_PEDANTIC "Compile with pedantic enabled." ON)
386386
option(LLVM_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF)
387387

388-
option(LLVM_ENABLE_DUMP "Enable dump functions in release builds" OFF)
388+
option(LLVM_ENABLE_DUMP "Enable dump functions even when assertions are disabled" OFF)
389389

390390
if( NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" )
391391
option(LLVM_ENABLE_ASSERTIONS "Enable assertions" OFF)
392392
else()
393393
option(LLVM_ENABLE_ASSERTIONS "Enable assertions" ON)
394394
endif()
395395

396-
if( LLVM_ENABLE_ASSERTIONS )
397-
set(LLVM_ENABLE_DUMP ON)
398-
endif()
399-
400396
option(LLVM_ENABLE_EXPENSIVE_CHECKS "Enable expensive checks" OFF)
401397

402398
set(LLVM_ABI_BREAKING_CHECKS "WITH_ASSERTS" CACHE STRING
@@ -682,9 +678,13 @@ foreach(t ${LLVM_TARGETS_TO_BUILD})
682678

683679
list(FIND LLVM_ALL_TARGETS ${t} idx)
684680
list(FIND LLVM_EXPERIMENTAL_TARGETS_TO_BUILD ${t} idy)
681+
# At this point, LLVMBUILDTOOL already checked all the targets passed in
682+
# LLVM_TARGETS_TO_BUILD and LLVM_EXPERIMENTAL_TARGETS_TO_BUILD, so
683+
# this test just makes sure that any experimental targets were passed via
684+
# LLVM_EXPERIMENTAL_TARGETS_TO_BUILD, not LLVM_TARGETS_TO_BUILD.
685685
if( idx LESS 0 AND idy LESS 0 )
686-
message(FATAL_ERROR "The target `${t}' does not exist.
687-
It should be one of\n${LLVM_ALL_TARGETS}")
686+
message(FATAL_ERROR "The target `${t}' is experimental and must be passed "
687+
"via LLVM_EXPERIMENTAL_TARGETS_TO_BUILD.")
688688
else()
689689
set(LLVM_ENUM_TARGETS "${LLVM_ENUM_TARGETS}LLVM_TARGET(${t})\n")
690690
endif()
@@ -975,11 +975,8 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
975975
set_target_properties(llvm-headers PROPERTIES FOLDER "Misc")
976976

977977
if (NOT CMAKE_CONFIGURATION_TYPES)
978-
add_custom_target(install-llvm-headers
979-
DEPENDS llvm-headers
980-
COMMAND "${CMAKE_COMMAND}"
981-
-DCMAKE_INSTALL_COMPONENT=llvm-headers
982-
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
978+
add_llvm_install_targets(install-llvm-headers
979+
COMPONENT llvm-headers)
983980
endif()
984981
endif()
985982

@@ -992,6 +989,7 @@ if(LLVM_DISTRIBUTION_COMPONENTS)
992989

993990
add_custom_target(distribution)
994991
add_custom_target(install-distribution)
992+
add_custom_target(install-distribution-stripped)
995993
foreach(target ${LLVM_DISTRIBUTION_COMPONENTS})
996994
if(TARGET ${target})
997995
add_dependencies(distribution ${target})
@@ -1004,11 +1002,19 @@ if(LLVM_DISTRIBUTION_COMPONENTS)
10041002
else()
10051003
message(SEND_ERROR "Specified distribution component '${target}' doesn't have an install target")
10061004
endif()
1005+
1006+
if(TARGET install-${target}-stripped)
1007+
add_dependencies(install-distribution-stripped install-${target}-stripped)
1008+
else()
1009+
message(SEND_ERROR "Specified distribution component '${target}' doesn't have an install-stripped target."
1010+
" Its installation target creation should be changed to use add_llvm_install_targets,"
1011+
" or you should manually create the 'install-${target}-stripped' target.")
1012+
endif()
10071013
endforeach()
10081014
endif()
10091015

10101016
# This allows us to deploy the Universal CRT DLLs by passing -DCMAKE_INSTALL_UCRT_LIBRARIES=ON to CMake
1011-
if (MSVC)
1017+
if (MSVC AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
10121018
include(InstallRequiredSystemLibraries)
10131019
endif()
10141020

CREDITS.TXT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ D: Release manager (1.7+)
269269
N: Sylvestre Ledru
270270
271271
W: http://sylvestre.ledru.info/
272-
W: http://apt.llvm.org/
272+
W: https://apt.llvm.org/
273273
D: Debian and Ubuntu packaging
274274
D: Continuous integration with jenkins
275275

bindings/go/llvm/ir_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ func TestSubtypes(t *testing.T) {
142142
int_pointer := PointerType(cont.Int32Type(), 0)
143143
int_inner := int_pointer.Subtypes()
144144
if len(int_inner) != 1 {
145-
t.Errorf("Got size %d, though wanted 1")
145+
t.Errorf("Got size %d, though wanted 1", len(int_inner))
146146
}
147147
if int_inner[0] != cont.Int32Type() {
148148
t.Errorf("Expected int32 type")
@@ -151,7 +151,7 @@ func TestSubtypes(t *testing.T) {
151151
st_pointer := cont.StructType([]Type{cont.Int32Type(), cont.Int8Type()}, false)
152152
st_inner := st_pointer.Subtypes()
153153
if len(st_inner) != 2 {
154-
t.Errorf("Got size %d, though wanted 2")
154+
t.Errorf("Got size %d, though wanted 2", len(int_inner))
155155
}
156156
if st_inner[0] != cont.Int32Type() {
157157
t.Errorf("Expected first struct field to be int32")

cmake/config-ix.cmake

Lines changed: 79 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ include(HandleLLVMStdlib)
1717

1818
if( UNIX AND NOT (BEOS OR HAIKU) )
1919
# Used by check_symbol_exists:
20-
set(CMAKE_REQUIRED_LIBRARIES m)
20+
list(APPEND CMAKE_REQUIRED_LIBRARIES "m")
2121
endif()
2222
# x86_64 FreeBSD 9.2 requires libcxxrt to be specified explicitly.
2323
if( CMAKE_SYSTEM MATCHES "FreeBSD-9.2-RELEASE" AND
@@ -127,45 +127,55 @@ if(HAVE_LIBPTHREAD)
127127
set(LLVM_PTHREAD_LIB ${CMAKE_THREAD_LIBS_INIT})
128128
endif()
129129

130-
# Don't look for these libraries on Windows. Also don't look for them if we're
131-
# using MSan, since uninstrumented third party code may call MSan interceptors
132-
# like strlen, leading to false positives.
133-
if( NOT PURE_WINDOWS AND NOT LLVM_USE_SANITIZER MATCHES "Memory.*")
134-
if (LLVM_ENABLE_ZLIB)
135-
check_library_exists(z compress2 "" HAVE_LIBZ)
136-
else()
137-
set(HAVE_LIBZ 0)
138-
endif()
139-
# Skip libedit if using ASan as it contains memory leaks.
140-
if (LLVM_ENABLE_LIBEDIT AND HAVE_HISTEDIT_H AND NOT LLVM_USE_SANITIZER MATCHES ".*Address.*")
141-
check_library_exists(edit el_init "" HAVE_LIBEDIT)
142-
else()
143-
set(HAVE_LIBEDIT 0)
144-
endif()
145-
if(LLVM_ENABLE_TERMINFO)
146-
set(HAVE_TERMINFO 0)
147-
foreach(library tinfo terminfo curses ncurses ncursesw)
130+
# Don't look for these libraries if we're using MSan, since uninstrumented third
131+
# party code may call MSan interceptors like strlen, leading to false positives.
132+
if(NOT LLVM_USE_SANITIZER MATCHES "Memory.*")
133+
set(HAVE_LIBZ 0)
134+
if(LLVM_ENABLE_ZLIB)
135+
foreach(library z zlib_static zlib)
148136
string(TOUPPER ${library} library_suffix)
149-
check_library_exists(${library} setupterm "" HAVE_TERMINFO_${library_suffix})
150-
if(HAVE_TERMINFO_${library_suffix})
151-
set(HAVE_TERMINFO 1)
152-
set(TERMINFO_LIBS "${library}")
137+
check_library_exists(${library} compress2 "" HAVE_LIBZ_${library_suffix})
138+
if(HAVE_LIBZ_${library_suffix})
139+
set(HAVE_LIBZ 1)
140+
set(ZLIB_LIBRARIES "${library}")
153141
break()
154142
endif()
155143
endforeach()
156-
else()
157-
set(HAVE_TERMINFO 0)
158144
endif()
159145

160-
find_library(ICONV_LIBRARY_PATH NAMES iconv libiconv libiconv-2 c)
161-
set(LLVM_LIBXML2_ENABLED 0)
162-
set(LIBXML2_FOUND 0)
163-
if((LLVM_ENABLE_LIBXML2) AND ((CMAKE_SYSTEM_NAME MATCHES "Linux") AND (ICONV_LIBRARY_PATH) OR APPLE))
164-
find_package(LibXml2)
165-
if (LIBXML2_FOUND)
166-
set(LLVM_LIBXML2_ENABLED 1)
167-
include_directories(${LIBXML2_INCLUDE_DIR})
168-
set(LIBXML2_LIBS "xml2")
146+
# Don't look for these libraries on Windows.
147+
if (NOT PURE_WINDOWS)
148+
# Skip libedit if using ASan as it contains memory leaks.
149+
if (LLVM_ENABLE_LIBEDIT AND HAVE_HISTEDIT_H AND NOT LLVM_USE_SANITIZER MATCHES ".*Address.*")
150+
check_library_exists(edit el_init "" HAVE_LIBEDIT)
151+
else()
152+
set(HAVE_LIBEDIT 0)
153+
endif()
154+
if(LLVM_ENABLE_TERMINFO)
155+
set(HAVE_TERMINFO 0)
156+
foreach(library tinfo terminfo curses ncurses ncursesw)
157+
string(TOUPPER ${library} library_suffix)
158+
check_library_exists(${library} setupterm "" HAVE_TERMINFO_${library_suffix})
159+
if(HAVE_TERMINFO_${library_suffix})
160+
set(HAVE_TERMINFO 1)
161+
set(TERMINFO_LIBS "${library}")
162+
break()
163+
endif()
164+
endforeach()
165+
else()
166+
set(HAVE_TERMINFO 0)
167+
endif()
168+
169+
find_library(ICONV_LIBRARY_PATH NAMES iconv libiconv libiconv-2 c)
170+
set(LLVM_LIBXML2_ENABLED 0)
171+
set(LIBXML2_FOUND 0)
172+
if((LLVM_ENABLE_LIBXML2) AND ((CMAKE_SYSTEM_NAME MATCHES "Linux") AND (ICONV_LIBRARY_PATH) OR APPLE))
173+
find_package(LibXml2)
174+
if (LIBXML2_FOUND)
175+
set(LLVM_LIBXML2_ENABLED 1)
176+
include_directories(${LIBXML2_INCLUDE_DIR})
177+
set(LIBXML2_LIBS "xml2")
178+
endif()
169179
endif()
170180
endif()
171181
endif()
@@ -628,3 +638,38 @@ else()
628638
endif()
629639

630640
string(REPLACE " " ";" LLVM_BINDINGS_LIST "${LLVM_BINDINGS}")
641+
642+
function(find_python_module module)
643+
string(REPLACE "." "_" module_name ${module})
644+
string(TOUPPER ${module_name} module_upper)
645+
set(FOUND_VAR PY_${module_upper}_FOUND)
646+
647+
execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c" "import ${module}"
648+
RESULT_VARIABLE status
649+
ERROR_QUIET)
650+
651+
if(status)
652+
set(${FOUND_VAR} 0 PARENT_SCOPE)
653+
message(STATUS "Could NOT find Python module ${module}")
654+
else()
655+
set(${FOUND_VAR} 1 PARENT_SCOPE)
656+
message(STATUS "Found Python module ${module}")
657+
endif()
658+
endfunction()
659+
660+
set (PYTHON_MODULES
661+
pygments
662+
# Some systems still don't have pygments.lexers.c_cpp which was introduced in
663+
# version 2.0 in 2014...
664+
pygments.lexers.c_cpp
665+
yaml
666+
)
667+
foreach(module ${PYTHON_MODULES})
668+
find_python_module(${module})
669+
endforeach()
670+
671+
if(PY_PYGMENTS_FOUND AND PY_PYGMENTS_LEXERS_C_CPP_FOUND AND PY_YAML_FOUND)
672+
set (LLVM_HAVE_OPT_VIEWER_MODULES 1)
673+
else()
674+
set (LLVM_HAVE_OPT_VIEWER_MODULES 0)
675+
endif()

0 commit comments

Comments
 (0)