Skip to content

Commit aa423eb

Browse files
authored
Merge pull request #125 from RadeonOpenCompute/roc-1.7.x-rc4
roc-1.7.x rc4 updates
2 parents 9a0a4eb + 7e7ae08 commit aa423eb

File tree

2,407 files changed

+147556
-46682
lines changed

Some content is hidden

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

2,407 files changed

+147556
-46682
lines changed

.gitattributes

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# binary files
2+
test/Object/Inputs/*.a-* binary
3+
test/tools/dsymutil/Inputs/* binary
4+
test/tools/llvm-ar/Inputs/*.lib binary
5+
test/tools/llvm-objdump/Inputs/*.a binary
6+
test/tools/llvm-rc/Inputs/* binary
7+
test/tools/llvm-strings/Inputs/numbers binary
8+
test/MC/AsmParser/incbin_abcd binary
9+
test/YAMLParser/spec-09-02.test binary
10+
11+
# Windows line ending test
12+
test/MC/AsmParser/preserve-comments-crlf.s text eol=crlf

CMakeLists.txt

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,20 @@
22

33
cmake_minimum_required(VERSION 3.4.3)
44

5-
if(POLICY CMP0022)
6-
cmake_policy(SET CMP0022 NEW) # automatic when 2.8.12 is required
7-
endif()
5+
cmake_policy(SET CMP0022 NEW)
86

9-
if (POLICY CMP0051)
10-
# CMake 3.1 and higher include generator expressions of the form
11-
# $<TARGETLIB:obj> in the SOURCES property. These need to be
12-
# stripped everywhere that access the SOURCES property, so we just
13-
# defer to the OLD behavior of not including generator expressions
14-
# in the output for now.
15-
cmake_policy(SET CMP0051 OLD)
16-
endif()
7+
cmake_policy(SET CMP0048 NEW)
178

18-
if(POLICY CMP0057)
19-
cmake_policy(SET CMP0057 NEW)
20-
endif()
9+
# CMake 3.1 and higher include generator expressions of the form
10+
# $<TARGETLIB:obj> in the SOURCES property. These need to be
11+
# stripped everywhere that access the SOURCES property, so we just
12+
# defer to the OLD behavior of not including generator expressions
13+
# in the output for now.
14+
cmake_policy(SET CMP0051 OLD)
15+
16+
cmake_policy(SET CMP0056 NEW)
17+
18+
cmake_policy(SET CMP0057 NEW)
2119

2220
if(NOT DEFINED LLVM_VERSION_MAJOR)
2321
set(LLVM_VERSION_MAJOR 6)
@@ -32,13 +30,6 @@ if(NOT DEFINED LLVM_VERSION_SUFFIX)
3230
set(LLVM_VERSION_SUFFIX svn)
3331
endif()
3432

35-
if (POLICY CMP0048)
36-
cmake_policy(SET CMP0048 NEW)
37-
set(cmake_3_0_PROJ_VERSION
38-
VERSION ${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH})
39-
set(cmake_3_0_LANGUAGES LANGUAGES)
40-
endif()
41-
4233
if (NOT PACKAGE_VERSION)
4334
set(PACKAGE_VERSION
4435
"${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}${LLVM_VERSION_SUFFIX}")
@@ -52,9 +43,8 @@ if ((CMAKE_GENERATOR MATCHES "Visual Studio") AND (CMAKE_GENERATOR_TOOLSET STREQ
5243
endif()
5344

5445
project(LLVM
55-
${cmake_3_0_PROJ_VERSION}
56-
${cmake_3_0_LANGUAGES}
57-
C CXX ASM)
46+
VERSION ${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}
47+
LANGUAGES C CXX ASM)
5848

5949
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
6050
message(STATUS "No build type selected, default to Debug")
@@ -177,6 +167,10 @@ if(LLVM_DEPENDENCY_DEBUGGING)
177167
endif()
178168

179169
option(LLVM_ENABLE_DAGISEL_COV "Debug: Prints tablegen patterns that were used for selecting" OFF)
170+
option(LLVM_ENABLE_GISEL_COV "Enable collection of GlobalISel rule coverage" OFF)
171+
if(LLVM_ENABLE_GISEL_COV)
172+
set(LLVM_GISEL_COV_PREFIX "${CMAKE_BINARY_DIR}/gisel-coverage-" CACHE STRING "Provide a filename prefix to collect the GlobalISel rule coverage")
173+
endif()
180174

181175
# Add path for custom modules
182176
set(CMAKE_MODULE_PATH
@@ -189,6 +183,9 @@ set(CMAKE_MODULE_PATH
189183
# for use by clang_complete, YouCompleteMe, etc.
190184
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
191185

186+
option(LLVM_INSTALL_BINUTILS_SYMLINKS
187+
"Install symlinks from the binutils tool names to the corresponding LLVM tools." OFF)
188+
192189
option(LLVM_INSTALL_UTILS "Include utility binaries in the 'install' target." OFF)
193190

194191
option(LLVM_INSTALL_TOOLCHAIN_ONLY "Only include toolchain files in the 'install' target." OFF)
@@ -354,7 +351,7 @@ set(LLVM_TARGET_ARCH "host"
354351

355352
option(LLVM_ENABLE_TERMINFO "Use terminfo database if available." ON)
356353

357-
option(LLVM_ENABLE_LIBXML2 "Use libxml2 if available." ON)
354+
set(LLVM_ENABLE_LIBXML2 "ON" CACHE STRING "Use libxml2 if available. Can be ON, OFF, or FORCE_ON")
358355

359356
option(LLVM_ENABLE_LIBEDIT "Use libedit if available." ON)
360357

@@ -762,6 +759,7 @@ configure_file(
762759
add_custom_target(srpm
763760
COMMAND cpack -G TGZ --config CPackSourceConfig.cmake -B ${LLVM_SRPM_DIR}/SOURCES
764761
COMMAND rpmbuild -bs --define '_topdir ${LLVM_SRPM_DIR}' ${LLVM_SRPM_BINARY_SPECFILE})
762+
set_target_properties(srpm PROPERTIES FOLDER "Misc")
765763

766764

767765
# They are not referenced. See set_output_directory().
@@ -974,6 +972,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
974972
# Installing the headers needs to depend on generating any public
975973
# tablegen'd headers.
976974
add_custom_target(llvm-headers DEPENDS intrinsics_gen)
975+
set_target_properties(llvm-headers PROPERTIES FOLDER "Misc")
977976

978977
if (NOT CMAKE_CONFIGURATION_TYPES)
979978
add_custom_target(install-llvm-headers
@@ -997,13 +996,13 @@ if(LLVM_DISTRIBUTION_COMPONENTS)
997996
if(TARGET ${target})
998997
add_dependencies(distribution ${target})
999998
else()
1000-
message(FATAL_ERROR "Specified distribution component '${target}' doesn't have a target")
999+
message(SEND_ERROR "Specified distribution component '${target}' doesn't have a target")
10011000
endif()
10021001

10031002
if(TARGET install-${target})
10041003
add_dependencies(install-distribution install-${target})
10051004
else()
1006-
message(FATAL_ERROR "Specified distribution component '${target}' doesn't have an install target")
1005+
message(SEND_ERROR "Specified distribution component '${target}' doesn't have an install target")
10071006
endif()
10081007
endforeach()
10091008
endif()

bindings/go/llvm/DIBuilderBindings.cpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,25 +29,6 @@ void LLVMDIBuilderDestroy(LLVMDIBuilderRef dref) {
2929
delete d;
3030
}
3131

32-
void LLVMDIBuilderFinalize(LLVMDIBuilderRef dref) { unwrap(dref)->finalize(); }
33-
34-
LLVMMetadataRef LLVMDIBuilderCreateCompileUnit(LLVMDIBuilderRef Dref,
35-
unsigned Lang, const char *File,
36-
const char *Dir,
37-
const char *Producer,
38-
int Optimized, const char *Flags,
39-
unsigned RuntimeVersion) {
40-
DIBuilder *D = unwrap(Dref);
41-
return wrap(D->createCompileUnit(Lang, D->createFile(File, Dir), Producer,
42-
Optimized, Flags, RuntimeVersion));
43-
}
44-
45-
LLVMMetadataRef LLVMDIBuilderCreateFile(LLVMDIBuilderRef Dref, const char *File,
46-
const char *Dir) {
47-
DIBuilder *D = unwrap(Dref);
48-
return wrap(D->createFile(File, Dir));
49-
}
50-
5132
LLVMMetadataRef LLVMDIBuilderCreateLexicalBlock(LLVMDIBuilderRef Dref,
5233
LLVMMetadataRef Scope,
5334
LLVMMetadataRef File,

bindings/go/llvm/DIBuilderBindings.h

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
#include "IRBindings.h"
1818
#include "llvm-c/Core.h"
19+
#include "llvm-c/DebugInfo.h"
1920

2021
#ifdef __cplusplus
2122
extern "C" {
@@ -30,16 +31,6 @@ typedef struct LLVMOpaqueDIBuilder *LLVMDIBuilderRef;
3031
LLVMDIBuilderRef LLVMNewDIBuilder(LLVMModuleRef m);
3132

3233
void LLVMDIBuilderDestroy(LLVMDIBuilderRef d);
33-
void LLVMDIBuilderFinalize(LLVMDIBuilderRef d);
34-
35-
LLVMMetadataRef
36-
LLVMDIBuilderCreateCompileUnit(LLVMDIBuilderRef D, unsigned Language,
37-
const char *File, const char *Dir,
38-
const char *Producer, int Optimized,
39-
const char *Flags, unsigned RuntimeVersion);
40-
41-
LLVMMetadataRef LLVMDIBuilderCreateFile(LLVMDIBuilderRef D, const char *File,
42-
const char *Dir);
4334

4435
LLVMMetadataRef LLVMDIBuilderCreateLexicalBlock(LLVMDIBuilderRef D,
4536
LLVMMetadataRef Scope,

bindings/go/llvm/dibuilder.go

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,17 @@ func (d *DIBuilder) CreateCompileUnit(cu DICompileUnit) Metadata {
132132
defer C.free(unsafe.Pointer(flags))
133133
result := C.LLVMDIBuilderCreateCompileUnit(
134134
d.ref,
135-
C.unsigned(cu.Language),
136-
file, dir,
137-
producer,
138-
boolToCInt(cu.Optimized),
139-
flags,
135+
C.LLVMDWARFSourceLanguage(cu.Language),
136+
C.LLVMDIBuilderCreateFile(d.ref, file, C.size_t(len(cu.File)), dir, C.size_t(len(cu.Dir))),
137+
producer, C.size_t(len(cu.Producer)),
138+
C.LLVMBool(boolToCInt(cu.Optimized)),
139+
flags, C.size_t(len(cu.Flags)),
140140
C.unsigned(cu.RuntimeVersion),
141+
/*SplitName=*/ nil, 0,
142+
C.LLVMDWARFEmissionFull,
143+
/*DWOId=*/ 0,
144+
/*SplitDebugInlining*/ C.LLVMBool(boolToCInt(true)),
145+
/*DebugInfoForProfiling*/ C.LLVMBool(boolToCInt(false)),
141146
)
142147
return Metadata{C: result}
143148
}
@@ -148,7 +153,9 @@ func (d *DIBuilder) CreateFile(filename, dir string) Metadata {
148153
defer C.free(unsafe.Pointer(cfilename))
149154
cdir := C.CString(dir)
150155
defer C.free(unsafe.Pointer(cdir))
151-
result := C.LLVMDIBuilderCreateFile(d.ref, cfilename, cdir)
156+
result := C.LLVMDIBuilderCreateFile(d.ref,
157+
cfilename, C.size_t(len(filename)),
158+
cdir, C.size_t(len(dir)))
152159
return Metadata{C: result}
153160
}
154161

cmake/config-ix.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ if( NOT PURE_WINDOWS AND NOT LLVM_USE_SANITIZER MATCHES "Memory.*")
157157
set(HAVE_TERMINFO 0)
158158
endif()
159159

160-
find_library(ICONV_LIBRARY_PATH NAMES iconv libiconv libiconv-2)
160+
find_library(ICONV_LIBRARY_PATH NAMES iconv libiconv libiconv-2 c)
161161
set(LLVM_LIBXML2_ENABLED 0)
162162
set(LIBXML2_FOUND 0)
163163
if((LLVM_ENABLE_LIBXML2) AND ((CMAKE_SYSTEM_NAME MATCHES "Linux") AND (ICONV_LIBRARY_PATH) OR APPLE))
@@ -170,6 +170,10 @@ if( NOT PURE_WINDOWS AND NOT LLVM_USE_SANITIZER MATCHES "Memory.*")
170170
endif()
171171
endif()
172172

173+
if (LLVM_ENABLE_LIBXML2 STREQUAL "FORCE_ON" AND NOT LLVM_LIBXML2_ENABLED)
174+
message(FATAL_ERROR "Failed to congifure libxml2")
175+
endif()
176+
173177
check_library_exists(xar xar_open "" HAVE_LIBXAR)
174178
if(HAVE_LIBXAR)
175179
set(XAR_LIB xar)

cmake/modules/AddLLVM.cmake

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,13 @@ endfunction(add_llvm_symbol_exports)
149149

150150
if(NOT WIN32 AND NOT APPLE)
151151
# Detect what linker we have here
152+
if( LLVM_USE_LINKER )
153+
set(command ${CMAKE_C_COMPILER} -fuse-ld=${LLVM_USE_LINKER} -Wl,--version)
154+
else()
155+
set(command ${CMAKE_C_COMPILER} -Wl,--version)
156+
endif()
152157
execute_process(
153-
COMMAND ${CMAKE_C_COMPILER} -Wl,--version
158+
COMMAND ${command}
154159
OUTPUT_VARIABLE stdout
155160
ERROR_VARIABLE stderr
156161
)
@@ -164,7 +169,8 @@ if(NOT WIN32 AND NOT APPLE)
164169
elseif("${stdout}" MATCHES "GNU ld")
165170
set(LLVM_LINKER_IS_GNULD ON)
166171
message(STATUS "Linker detection: GNU ld")
167-
elseif("${stderr}" MATCHES "Solaris Link Editors")
172+
elseif("${stderr}" MATCHES "Solaris Link Editors" OR
173+
"${stdout}" MATCHES "Solaris Link Editors")
168174
set(LLVM_LINKER_IS_SOLARISLD ON)
169175
message(STATUS "Linker detection: Solaris ld")
170176
else()
@@ -1037,6 +1043,13 @@ function(add_unittest test_suite test_name)
10371043
set(EXCLUDE_FROM_ALL ON)
10381044
endif()
10391045

1046+
# Our current version of gtest does not properly recognize C++11 support
1047+
# with MSVC, so it falls back to tr1 / experimental classes. Since LLVM
1048+
# itself requires C++11, we can safely force it on unconditionally so that
1049+
# we don't have to fight with the buggy gtest check.
1050+
add_definitions(-DGTEST_LANG_CXX11=1)
1051+
add_definitions(-DGTEST_HAS_TR1_TUPLE=0)
1052+
10401053
include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include)
10411054
include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googlemock/include)
10421055
if (NOT LLVM_ENABLE_THREADS)
@@ -1112,6 +1125,15 @@ function(llvm_canonicalize_cmake_booleans)
11121125
endforeach()
11131126
endfunction(llvm_canonicalize_cmake_booleans)
11141127

1128+
macro(set_llvm_build_mode)
1129+
# Configuration-time: See Unit/lit.site.cfg.in
1130+
if (CMAKE_CFG_INTDIR STREQUAL ".")
1131+
set(LLVM_BUILD_MODE ".")
1132+
else ()
1133+
set(LLVM_BUILD_MODE "%(build_mode)s")
1134+
endif ()
1135+
endmacro()
1136+
11151137
# This function provides an automatic way to 'configure'-like generate a file
11161138
# based on a set of common and custom variables, specifically targeting the
11171139
# variables needed for the 'lit.site.cfg' files. This function bundles the
@@ -1135,12 +1157,7 @@ function(configure_lit_site_cfg site_in site_out)
11351157

11361158
set(SHLIBEXT "${LTDL_SHLIB_EXT}")
11371159

1138-
# Configuration-time: See Unit/lit.site.cfg.in
1139-
if (CMAKE_CFG_INTDIR STREQUAL ".")
1140-
set(LLVM_BUILD_MODE ".")
1141-
else ()
1142-
set(LLVM_BUILD_MODE "%(build_mode)s")
1143-
endif ()
1160+
set_llvm_build_mode()
11441161

11451162
# They below might not be the build tree but provided binary tree.
11461163
set(LLVM_SOURCE_DIR ${LLVM_MAIN_SRC_DIR})

cmake/modules/AddOCaml.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,3 +221,4 @@ add_custom_target(ocaml_make_directory
221221
COMMAND "${CMAKE_COMMAND}" "-E" "make_directory" "${LLVM_LIBRARY_DIR}/ocaml/llvm")
222222
add_custom_target("ocaml_all")
223223
set_target_properties(ocaml_all PROPERTIES FOLDER "Misc")
224+
set_target_properties(ocaml_make_directory PROPERTIES FOLDER "Misc")
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
include(CheckCXXCompilerFlag)
22

33
function(check_linker_flag flag out_var)
4-
set(OLD_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
5-
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${flag}")
4+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${flag}")
65
check_cxx_compiler_flag("" ${out_var})
7-
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
86
endfunction()

cmake/modules/CrossCompile.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,15 @@ function(llvm_create_cross_target_internal target_name toolchain buildtype)
1616
COMMAND ${CMAKE_COMMAND} -E make_directory ${LLVM_${target_name}_BUILD}
1717
COMMENT "Creating ${LLVM_${target_name}_BUILD}...")
1818

19+
add_custom_target(CREATE_LLVM_${target_name}
20+
DEPENDS ${LLVM_${target_name}_BUILD})
21+
1922
add_custom_command(OUTPUT ${LLVM_${target_name}_BUILD}/CMakeCache.txt
2023
COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}"
2124
${CROSS_TOOLCHAIN_FLAGS_${target_name}} ${CMAKE_SOURCE_DIR}
2225
-DLLVM_TARGET_IS_CROSSCOMPILE_HOST=TRUE
2326
WORKING_DIRECTORY ${LLVM_${target_name}_BUILD}
24-
DEPENDS ${LLVM_${target_name}_BUILD}
27+
DEPENDS CREATE_LLVM_${target_name}
2528
COMMENT "Configuring ${target_name} LLVM...")
2629

2730
add_custom_target(CONFIGURE_LLVM_${target_name}

0 commit comments

Comments
 (0)