Skip to content
Permalink
Browse files

Merge LLVM 325000

  • Loading branch information...
yrnkrn committed Jul 25, 2018
1 parent 6646fe3 commit 75357c201af30fc02897d139173ae17b2ac9d40c
Showing 6,203 changed files with 381,105 additions and 149,023 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
@@ -1,3 +1,4 @@
{
"repository.callsign" : "L",
"conduit_uri" : "https://reviews.llvm.org/"
}
@@ -17,8 +17,13 @@ cmake_policy(SET CMP0056 NEW)

cmake_policy(SET CMP0057 NEW)

if(POLICY CMP0068)
cmake_policy(SET CMP0068 NEW)
set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON)
endif()

if(NOT DEFINED LLVM_VERSION_MAJOR)
set(LLVM_VERSION_MAJOR 6)
set(LLVM_VERSION_MAJOR 7)
endif()
if(NOT DEFINED LLVM_VERSION_MINOR)
set(LLVM_VERSION_MINOR 0)
@@ -137,11 +142,14 @@ set(LLVM_CCACHE_BUILD OFF CACHE BOOL "Set to ON for a ccache enabled build")
if(LLVM_CCACHE_BUILD)
find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM)
set(LLVM_CCACHE_SIZE "" CACHE STRING "Size of ccache")
set(LLVM_CCACHE_MAXSIZE "" CACHE STRING "Size of ccache")
set(LLVM_CCACHE_DIR "" CACHE STRING "Directory to keep ccached data")
set(CCACHE_PROGRAM "CCACHE_CPP2=yes CCACHE_HASHDIR=yes ${CCACHE_PROGRAM}")
if (LLVM_CCACHE_SIZE)
set(CCACHE_PROGRAM "CCACHE_SIZE=${LLVM_CCACHE_SIZE} ${CCACHE_PROGRAM}")
set(LLVM_CCACHE_PARAMS "CCACHE_CPP2=yes CCACHE_HASHDIR=yes"
CACHE STRING "Parameters to pass through to ccache")

set(CCACHE_PROGRAM "${LLVM_CCACHE_PARAMS} ${CCACHE_PROGRAM}")
if (LLVM_CCACHE_MAXSIZE)
set(CCACHE_PROGRAM "CCACHE_MAXSIZE=${LLVM_CCACHE_MAXSIZE} ${CCACHE_PROGRAM}")
endif()
if (LLVM_CCACHE_DIR)
set(CCACHE_PROGRAM "CCACHE_DIR=${LLVM_CCACHE_DIR} ${CCACHE_PROGRAM}")
@@ -202,7 +210,7 @@ option(LLVM_APPEND_VC_REV

set(PACKAGE_NAME LLVM)
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
set(PACKAGE_BUGREPORT "http://llvm.org/bugs/")
set(PACKAGE_BUGREPORT "https://bugs.llvm.org/")

set(BUG_REPORT_URL "${PACKAGE_BUGREPORT}" CACHE STRING
"Default URL where bug reports are to be submitted.")
@@ -276,9 +284,9 @@ set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name
set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')")
mark_as_advanced(LLVM_TOOLS_INSTALL_DIR)

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

# They are used as destination of target generators.
set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)
@@ -678,9 +686,13 @@ foreach(t ${LLVM_TARGETS_TO_BUILD})

list(FIND LLVM_ALL_TARGETS ${t} idx)
list(FIND LLVM_EXPERIMENTAL_TARGETS_TO_BUILD ${t} idy)
# At this point, LLVMBUILDTOOL already checked all the targets passed in
# LLVM_TARGETS_TO_BUILD and LLVM_EXPERIMENTAL_TARGETS_TO_BUILD, so
# this test just makes sure that any experimental targets were passed via
# LLVM_EXPERIMENTAL_TARGETS_TO_BUILD, not LLVM_TARGETS_TO_BUILD.
if( idx LESS 0 AND idy LESS 0 )
message(FATAL_ERROR "The target `${t}' does not exist.
It should be one of\n${LLVM_ALL_TARGETS}")
message(FATAL_ERROR "The target `${t}' is experimental and must be passed "
"via LLVM_EXPERIMENTAL_TARGETS_TO_BUILD.")
else()
set(LLVM_ENUM_TARGETS "${LLVM_ENUM_TARGETS}LLVM_TARGET(${t})\n")
endif()
@@ -825,7 +837,7 @@ endif()
include(AddLLVM)
include(TableGen)

if( MINGW )
if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
# People report that -O3 is unreliable on MinGW. The traditional
# build also uses -O2 for that reason:
llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
@@ -1013,4 +1025,3 @@ endif()
if (MSVC AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
include(InstallRequiredSystemLibraries)
endif()

@@ -203,6 +203,11 @@ N: Patrick Jenkins
E: patjenk@wam.umd.edu
D: Nightly Tester

N: Tony(Yanjun) Jiang
E: jtony@ca.ibm.com
D: PowerPC Backend Developer
D: Improvements to the PPC backend and miscellaneous bug fixes

N: Dale Johannesen
E: dalej@apple.com
D: ARM constant islands improvements
@@ -269,7 +274,7 @@ D: Release manager (1.7+)
N: Sylvestre Ledru
E: sylvestre@debian.org
W: http://sylvestre.ledru.info/
W: http://apt.llvm.org/
W: https://apt.llvm.org/
D: Debian and Ubuntu packaging
D: Continuous integration with jenkins

@@ -64,7 +64,7 @@ Please make sure first your project compiles successfully with Clang. If your pr

### Are the sanitizers supported?

Currently, no.
No.

### Which operating systems are supported?

@@ -106,4 +106,4 @@ Additional zapcc-only code in

### When was the source last merged with LLVM trunk?

This open-source release was last merged with LLVM 321000 on 2017-12-18.
This open-source release was last merged with LLVM 325000 on 2018-02-13.
@@ -1872,7 +1872,7 @@ func (pm PassManager) InitializeFunc() bool { return C.LLVMInitializeFunctionPas
// See llvm::FunctionPassManager::run(Function&).
func (pm PassManager) RunFunc(f Value) bool { return C.LLVMRunFunctionPassManager(pm.C, f.C) != 0 }

// Finalizes all of the function passes scheduled in in the function pass
// Finalizes all of the function passes scheduled in the function pass
// manager. Returns 1 if any of the passes modified the module, 0 otherwise.
// See llvm::FunctionPassManager::doFinalization.
func (pm PassManager) FinalizeFunc() bool { return C.LLVMFinalizeFunctionPassManager(pm.C) != 0 }
@@ -142,7 +142,7 @@ func TestSubtypes(t *testing.T) {
int_pointer := PointerType(cont.Int32Type(), 0)
int_inner := int_pointer.Subtypes()
if len(int_inner) != 1 {
t.Errorf("Got size %d, though wanted 1")
t.Errorf("Got size %d, though wanted 1", len(int_inner))
}
if int_inner[0] != cont.Int32Type() {
t.Errorf("Expected int32 type")
@@ -151,7 +151,7 @@ func TestSubtypes(t *testing.T) {
st_pointer := cont.StructType([]Type{cont.Int32Type(), cont.Int8Type()}, false)
st_inner := st_pointer.Subtypes()
if len(st_inner) != 2 {
t.Errorf("Got size %d, though wanted 2")
t.Errorf("Got size %d, though wanted 2", len(int_inner))
}
if st_inner[0] != cont.Int32Type() {
t.Errorf("Expected first struct field to be int32")
@@ -2619,7 +2619,7 @@ module PassManager : sig
See the [llvm::FunctionPassManager::run] method. *)
val run_function : llvalue -> [ `Function ] t -> bool

(** [finalize fpm] finalizes all of the function passes scheduled in in the
(** [finalize fpm] finalizes all of the function passes scheduled in the
function pass manager [fpm]. Returns [true] if any of the passes
modified the module, [false] otherwise.
See the [llvm::FunctionPassManager::doFinalization] method. *)
@@ -17,7 +17,7 @@ include(HandleLLVMStdlib)

if( UNIX AND NOT (BEOS OR HAIKU) )
# Used by check_symbol_exists:
set(CMAKE_REQUIRED_LIBRARIES m)
list(APPEND CMAKE_REQUIRED_LIBRARIES "m")
endif()
# x86_64 FreeBSD 9.2 requires libcxxrt to be specified explicitly.
if( CMAKE_SYSTEM MATCHES "FreeBSD-9.2-RELEASE" AND
@@ -640,7 +640,8 @@ endif()
string(REPLACE " " ";" LLVM_BINDINGS_LIST "${LLVM_BINDINGS}")

function(find_python_module module)
string(TOUPPER ${module} module_upper)
string(REPLACE "." "_" module_name ${module})
string(TOUPPER ${module_name} module_upper)
set(FOUND_VAR PY_${module_upper}_FOUND)

execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c" "import ${module}"
@@ -658,13 +659,16 @@ endfunction()

set (PYTHON_MODULES
pygments
# Some systems still don't have pygments.lexers.c_cpp which was introduced in
# version 2.0 in 2014...
pygments.lexers.c_cpp
yaml
)
foreach(module ${PYTHON_MODULES})
find_python_module(${module})
endforeach()

if(PY_PYGMENTS_FOUND AND PY_YAML_FOUND)
if(PY_PYGMENTS_FOUND AND PY_PYGMENTS_LEXERS_C_CPP_FOUND AND PY_YAML_FOUND)
set (LLVM_HAVE_OPT_VIEWER_MODULES 1)
else()
set (LLVM_HAVE_OPT_VIEWER_MODULES 0)
@@ -1473,7 +1473,7 @@ function(add_llvm_tool_symlink link_name target)
if(NOT ARG_OUTPUT_DIR)
# If you're not overriding the OUTPUT_DIR, we can make the link relative in
# the same directory.
if(UNIX)
if(CMAKE_HOST_UNIX)
set(dest_binary "$<TARGET_FILE_NAME:${target}>")
endif()
if(CMAKE_CONFIGURATION_TYPES)
@@ -1499,7 +1499,7 @@ function(add_llvm_tool_symlink link_name target)
endif()
endif()

if(UNIX)
if(CMAKE_HOST_UNIX)
set(LLVM_LINK_OR_COPY create_symlink)
else()
set(LLVM_LINK_OR_COPY copy)
@@ -8,7 +8,7 @@ INCLUDE(CheckLibraryExists)

function(check_working_cxx_atomics varname)
set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
set(CMAKE_REQUIRED_FLAGS "-std=c++11")
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -std=c++11")
CHECK_CXX_SOURCE_COMPILES("
#include <atomic>
std::atomic<int> x;
@@ -28,7 +28,7 @@ if(NOT DEFINED LLVM_COMPILER_CHECKED)
# bug in libstdc++4.6 that is fixed in libstdc++4.7.
set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
set(OLD_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
set(CMAKE_REQUIRED_FLAGS "-std=c++0x")
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -std=c++0x")
check_cxx_source_compiles("
#include <atomic>
std::atomic<float> x(0.0f);
@@ -45,10 +45,13 @@ function(llvm_create_cross_target_internal target_name toolchain buildtype)

add_custom_command(OUTPUT ${LLVM_${target_name}_BUILD}/CMakeCache.txt
COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}"
-DCMAKE_MAKE_PROGRAM="${CMAKE_MAKE_PROGRAM}"
${CROSS_TOOLCHAIN_FLAGS_${target_name}} ${CMAKE_SOURCE_DIR}
-DLLVM_TARGET_IS_CROSSCOMPILE_HOST=TRUE
-DLLVM_TARGETS_TO_BUILD="${targets_to_build_arg}"
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="${experimental_targets_to_build_arg}"
-DLLVM_DEFAULT_TARGET_TRIPLE="${TARGET_TRIPLE}"
-DLLVM_TARGET_ARCH="${LLVM_TARGET_ARCH}"
${build_type_flags} ${linker_flag} ${external_clang_dir}
WORKING_DIRECTORY ${LLVM_${target_name}_BUILD}
DEPENDS CREATE_LLVM_${target_name}
@@ -353,6 +353,12 @@ if( MSVC )

append("/Zc:inline" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)

# Generate PDB even in release for profiling.
if (uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE")
append("/Zi" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
append("/DEBUG" CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
endif (uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE")

# /Zc:strictStrings is incompatible with VS12's (Visual Studio 2013's)
# debug mode headers. Instead of only enabling them in VS2013's debug mode,
# we'll just enable them for Visual Studio 2015 (VS 14, MSVC_VERSION 1900)
@@ -849,6 +855,13 @@ else()
set(LLVM_ENABLE_PLUGINS ON)
endif()

set(LLVM_ENABLE_IDE_default OFF)
if (XCODE OR MSVC_IDE OR CMAKE_EXTRA_GENERATOR)
set(LLVM_ENABLE_IDE_default ON)
endif()
option(LLVM_ENABLE_IDE "Generate targets and process sources for use with an IDE"
${LLVM_ENABLE_IDE_default})

function(get_compile_definitions)
get_directory_property(top_dir_definitions DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITIONS)
foreach(definition ${top_dir_definitions})
@@ -37,6 +37,8 @@ set(LLVM_ENABLE_THREADS @LLVM_ENABLE_THREADS@)

set(LLVM_ENABLE_ZLIB @LLVM_ENABLE_ZLIB@)

set(LLVM_LIBXML2_ENABLED @LLVM_LIBXML2_ENABLED@)

set(LLVM_ENABLE_DIA_SDK @LLVM_ENABLE_DIA_SDK@)

set(LLVM_NATIVE_ARCH @LLVM_NATIVE_ARCH@)
@@ -102,7 +102,7 @@ function(llvm_ExternalProject_Add name source_dir)
endforeach()
endforeach()

if(ARG_USE_TOOLCHAIN)
if(ARG_USE_TOOLCHAIN AND NOT CMAKE_CROSSCOMPILING)
if(CLANG_IN_TOOLCHAIN)
set(compiler_args -DCMAKE_C_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang
-DCMAKE_CXX_COMPILER=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++)
@@ -136,6 +136,16 @@ function(llvm_ExternalProject_Add name source_dir)
set(sysroot_arg -DCMAKE_SYSROOT=${CMAKE_SYSROOT})
endif()

if(CMAKE_CROSSCOMPILING)
set(compiler_args -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_AR=${CMAKE_AR}
-DCMAKE_RANLIB=${CMAKE_RANLIB})
set(llvm_config_path ${LLVM_CONFIG_PATH})
else()
set(llvm_config_path "$<TARGET_FILE:llvm-config>")
endif()

ExternalProject_Add(${name}
DEPENDS ${ARG_DEPENDS} llvm-config
${name}-clobber
@@ -149,7 +159,7 @@ function(llvm_ExternalProject_Add name source_dir)
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
${sysroot_arg}
-DLLVM_BINARY_DIR=${PROJECT_BINARY_DIR}
-DLLVM_CONFIG_PATH=$<TARGET_FILE:llvm-config>
-DLLVM_CONFIG_PATH=${llvm_config_path}
-DLLVM_ENABLE_WERROR=${LLVM_ENABLE_WERROR}
-DLLVM_HOST_TRIPLE=${LLVM_HOST_TRIPLE}
-DLLVM_HAVE_LINK_VERSION_SCRIPT=${LLVM_HAVE_LINK_VERSION_SCRIPT}
@@ -3,7 +3,7 @@
# See PR8397.

function(install_symlink name target outdir)
if(UNIX)
if(CMAKE_HOST_UNIX)
set(LINK_OR_COPY create_symlink)
set(DESTDIR $ENV{DESTDIR})
else()
@@ -52,7 +52,7 @@ function(llvm_process_sources OUT_VAR)
cmake_parse_arguments(ARG "" "" "ADDITIONAL_HEADERS;ADDITIONAL_HEADER_DIRS" ${ARGN})
set(sources ${ARG_UNPARSED_ARGUMENTS})
llvm_check_source_file_list( ${sources} )
if( MSVC_IDE OR XCODE )
if( LLVM_ENABLE_IDE )
# This adds .td and .h files to the Visual Studio solution:
add_td_sources(sources)
find_all_header_files(hdrs "${ARG_ADDITIONAL_HEADER_DIRS}")

0 comments on commit 75357c2

Please sign in to comment.
You can’t perform that action at this time.