Skip to content

Commit 0b7752e

Browse files
committed
Creating branches/google/stable and tags/google/stable/2019-05-14 from r360103
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/google/stable@360714 91177308-0d34-0410-b5e6-96231b3b80d8
2 parents 85d6388 + 352106f commit 0b7752e

File tree

10,703 files changed

+620528
-299041
lines changed

Some content is hidden

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

10,703 files changed

+620528
-299041
lines changed

.clang-tidy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Checks: '-*,clang-diagnostic-*,llvm-*,misc-*,-misc-unused-parameters,readability-identifier-naming'
1+
Checks: '-*,clang-diagnostic-*,llvm-*,misc-*,-misc-unused-parameters,-misc-non-private-member-variables-in-classes,readability-identifier-naming'
22
CheckOptions:
33
- key: readability-identifier-naming.ClassCase
44
value: CamelCase

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ docs/_build
7272
# VS2017 and VSCode config files.
7373
.vscode
7474
.vs
75+
# clangd index
76+
.clangd
7577

7678
#==============================================================================#
7779
# Files created in tree by the Go bindings.

CMakeLists.txt

Lines changed: 95 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ if(POLICY CMP0075)
1212
endif()
1313

1414
if(NOT DEFINED LLVM_VERSION_MAJOR)
15-
set(LLVM_VERSION_MAJOR 8)
15+
set(LLVM_VERSION_MAJOR 9)
1616
endif()
1717
if(NOT DEFINED LLVM_VERSION_MINOR)
1818
set(LLVM_VERSION_MINOR 0)
@@ -104,27 +104,60 @@ endif()
104104
# LLVM_EXTERNAL_${project}_SOURCE_DIR using LLVM_ALL_PROJECTS
105105
# This allows an easy way of setting up a build directory for llvm and another
106106
# one for llvm+clang+... using the same sources.
107-
set(LLVM_ALL_PROJECTS "clang;libcxx;libcxxabi;libunwind;lldb;compiler-rt;lld;polly;debuginfo-tests")
107+
set(LLVM_ALL_PROJECTS "clang;clang-tools-extra;compiler-rt;debuginfo-tests;libclc;libcxx;libcxxabi;libunwind;lld;lldb;llgo;openmp;parallel-libs;polly;pstl")
108108
set(LLVM_ENABLE_PROJECTS "" CACHE STRING
109109
"Semicolon-separated list of projects to build (${LLVM_ALL_PROJECTS}), or \"all\".")
110110
if( LLVM_ENABLE_PROJECTS STREQUAL "all" )
111111
set( LLVM_ENABLE_PROJECTS ${LLVM_ALL_PROJECTS})
112112
endif()
113-
foreach(proj ${LLVM_ENABLE_PROJECTS})
114-
set(PROJ_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../${proj}")
115-
if(NOT EXISTS "${PROJ_DIR}" OR NOT IS_DIRECTORY "${PROJ_DIR}")
116-
message(FATAL_ERROR "LLVM_ENABLE_PROJECTS requests ${proj} but directory not found: ${PROJ_DIR}")
117-
endif()
118-
string(TOUPPER "${proj}" upper_proj)
119-
STRING(REGEX REPLACE "-" "_" upper_proj ${upper_proj})
120-
set(LLVM_EXTERNAL_${upper_proj}_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../${proj}")
121-
# There is a widely spread opinion that clang-tools-extra should be merged
122-
# into clang. The following simulates it by always enabling clang-tools-extra
123-
# when enabling clang.
124-
if (proj STREQUAL "clang")
125-
set(LLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../clang-tools-extra")
126-
endif()
127-
endforeach()
113+
114+
# LLVM_ENABLE_PROJECTS_USED is `ON` if the user has ever used the
115+
# `LLVM_ENABLE_PROJECTS` CMake cache variable. This exists for
116+
# several reasons:
117+
#
118+
# * As an indicator that the `LLVM_ENABLE_PROJECTS` list is now the single
119+
# source of truth for which projects to build. This means we will ignore user
120+
# supplied `LLVM_TOOL_<project>_BUILD` CMake cache variables and overwrite
121+
# them.
122+
#
123+
# * The case where the user previously had `LLVM_ENABLE_PROJECTS` set to a
124+
# non-empty list but now the user wishes to disable building all other projects
125+
# by setting `LLVM_ENABLE_PROJECTS` to an empty string. In that case we still
126+
# need to set the `LLVM_TOOL_${upper_proj}_BUILD` variables so that we disable
127+
# building all the projects that were previously enabled.
128+
set(LLVM_ENABLE_PROJECTS_USED OFF CACHE BOOL "")
129+
mark_as_advanced(LLVM_ENABLE_PROJECTS_USED)
130+
131+
if (LLVM_ENABLE_PROJECTS_USED OR NOT LLVM_ENABLE_PROJECTS STREQUAL "")
132+
set(LLVM_ENABLE_PROJECTS_USED ON CACHE BOOL "" FORCE)
133+
foreach(proj ${LLVM_ALL_PROJECTS} ${LLVM_EXTERNAL_PROJECTS})
134+
string(TOUPPER "${proj}" upper_proj)
135+
string(REGEX REPLACE "-" "_" upper_proj ${upper_proj})
136+
if ("${proj}" IN_LIST LLVM_ENABLE_PROJECTS)
137+
message(STATUS "${proj} project is enabled")
138+
set(SHOULD_ENABLE_PROJECT TRUE)
139+
set(PROJ_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../${proj}")
140+
if(NOT EXISTS "${PROJ_DIR}" OR NOT IS_DIRECTORY "${PROJ_DIR}")
141+
message(FATAL_ERROR "LLVM_ENABLE_PROJECTS requests ${proj} but directory not found: ${PROJ_DIR}")
142+
endif()
143+
set(LLVM_EXTERNAL_${upper_proj}_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../${proj}" CACHE STRING "")
144+
else()
145+
message(STATUS "${proj} project is disabled")
146+
set(SHOULD_ENABLE_PROJECT FALSE)
147+
endif()
148+
# Force `LLVM_TOOL_${upper_proj}_BUILD` variables to have values that
149+
# corresponds with `LLVM_ENABLE_PROJECTS`. This prevents the user setting
150+
# `LLVM_TOOL_${upper_proj}_BUILD` variables externally. At some point
151+
# we should deprecate allowing users to set these variables by turning them
152+
# into normal CMake variables rather than cache variables.
153+
set(LLVM_TOOL_${upper_proj}_BUILD
154+
${SHOULD_ENABLE_PROJECT}
155+
CACHE
156+
BOOL "Whether to build ${upper_proj} as part of LLVM" FORCE
157+
)
158+
endforeach()
159+
endif()
160+
unset(SHOULD_ENABLE_PROJECT)
128161

129162
# Build llvm with ccache if the package is present
130163
set(LLVM_CCACHE_BUILD OFF CACHE BOOL "Set to ON for a ccache enabled build")
@@ -200,7 +233,7 @@ endif()
200233
include(VersionFromVCS)
201234

202235
option(LLVM_APPEND_VC_REV
203-
"Embed the version control system revision id in LLVM" ON)
236+
"Embed the version control system revision in LLVM" ON)
204237

205238
set(PACKAGE_NAME LLVM)
206239
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
@@ -318,6 +351,8 @@ if(LLVM_ENABLE_BACKTRACES)
318351
set(ENABLE_BACKTRACES 1)
319352
endif()
320353

354+
option(LLVM_ENABLE_UNWIND_TABLES "Emit unwind tables for the libraries" ON)
355+
321356
option(LLVM_ENABLE_CRASH_OVERRIDES "Enable crash overrides." ON)
322357
if(LLVM_ENABLE_CRASH_OVERRIDES)
323358
set(ENABLE_CRASH_OVERRIDES 1)
@@ -344,6 +379,31 @@ option(LLVM_ENABLE_THREADS "Use threads if available." ON)
344379

345380
option(LLVM_ENABLE_ZLIB "Use zlib for compression/decompression if available." ON)
346381

382+
set(LLVM_Z3_INSTALL_DIR "" CACHE STRING "Install directory of the Z3 solver.")
383+
384+
find_package(Z3 4.7.1)
385+
386+
if (LLVM_Z3_INSTALL_DIR)
387+
if (NOT Z3_FOUND)
388+
message(FATAL_ERROR "Z3 >= 4.7.1 has not been found in LLVM_Z3_INSTALL_DIR: ${LLVM_Z3_INSTALL_DIR}.")
389+
endif()
390+
endif()
391+
392+
set(LLVM_ENABLE_Z3_SOLVER_DEFAULT "${Z3_FOUND}")
393+
394+
option(LLVM_ENABLE_Z3_SOLVER
395+
"Enable Support for the Z3 constraint solver in LLVM."
396+
${LLVM_ENABLE_Z3_SOLVER_DEFAULT}
397+
)
398+
399+
if (LLVM_ENABLE_Z3_SOLVER)
400+
if (NOT Z3_FOUND)
401+
message(FATAL_ERROR "LLVM_ENABLE_Z3_SOLVER cannot be enabled when Z3 is not available.")
402+
endif()
403+
404+
set(LLVM_WITH_Z3 1)
405+
endif()
406+
347407
if( LLVM_TARGETS_TO_BUILD STREQUAL "all" )
348408
set( LLVM_TARGETS_TO_BUILD ${LLVM_ALL_TARGETS} )
349409
endif()
@@ -363,8 +423,6 @@ else()
363423
option(LLVM_ENABLE_MODULE_DEBUGGING "Compile with -gmodules." OFF)
364424
option(LLVM_ENABLE_LOCAL_SUBMODULE_VISIBILITY "Compile with -fmodules-local-submodule-visibility." ON)
365425
endif()
366-
option(LLVM_ENABLE_CXX1Y "Compile with C++1y enabled." OFF)
367-
option(LLVM_ENABLE_CXX1Z "Compile with C++1z enabled." OFF)
368426
option(LLVM_ENABLE_LIBCXX "Use libc++ if available." OFF)
369427
option(LLVM_ENABLE_LLD "Use lld as C and C++ linker." OFF)
370428
option(LLVM_ENABLE_PEDANTIC "Compile with pedantic enabled." ON)
@@ -383,9 +441,12 @@ option(LLVM_ENABLE_EXPENSIVE_CHECKS "Enable expensive checks" OFF)
383441
set(LLVM_ABI_BREAKING_CHECKS "WITH_ASSERTS" CACHE STRING
384442
"Enable abi-breaking checks. Can be WITH_ASSERTS, FORCE_ON or FORCE_OFF.")
385443

386-
option(LLVM_FORCE_USE_OLD_HOST_TOOLCHAIN
444+
option(LLVM_FORCE_USE_OLD_TOOLCHAIN
387445
"Set to ON to force using an old, unsupported host toolchain." OFF)
388446

447+
option(LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN
448+
"Set to ON to only warn when using a toolchain which is about to be deprecated, instead of emitting an error." OFF)
449+
389450
option(LLVM_USE_INTEL_JITEVENTS
390451
"Use Intel JIT API to inform Intel(R) VTune(TM) Amplifier XE 2011 about JIT code"
391452
OFF)
@@ -534,7 +595,7 @@ if(NOT DEFINED LLVM_DYLIB_COMPONENTS)
534595
endif()
535596
option(LLVM_LINK_LLVM_DYLIB "Link tools against the libllvm dynamic library" OFF)
536597
if(MSVC)
537-
option(LLVM_BUILD_LLVM_C_DYLIB "Build LLVM-C.dll (Windows only)" OFF)
598+
option(LLVM_BUILD_LLVM_C_DYLIB "Build LLVM-C.dll (Windows only)" ON)
538599
else()
539600
option(LLVM_BUILD_LLVM_C_DYLIB "Build libllvm-c re-export library (Darwin only)" OFF)
540601
endif()
@@ -568,6 +629,12 @@ if (LLVM_BUILD_INSTRUMENTED OR LLVM_BUILD_INSTRUMENTED_COVERAGE OR
568629
endif()
569630
file(TO_NATIVE_PATH "${LLVM_PROFILE_DATA_DIR}/%${LLVM_PROFILE_MERGE_POOL_SIZE}m.profraw" LLVM_PROFILE_FILE_PATTERN)
570631
endif()
632+
if(NOT LLVM_CSPROFILE_FILE_PATTERN)
633+
if(NOT LLVM_CSPROFILE_DATA_DIR)
634+
file(TO_NATIVE_PATH "${LLVM_BINARY_DIR}/csprofiles" LLVM_CSPROFILE_DATA_DIR)
635+
endif()
636+
file(TO_NATIVE_PATH "${LLVM_CSPROFILE_DATA_DIR}/%${LLVM_PROFILE_MERGE_POOL_SIZE}m.profraw" LLVM_CSPROFILE_FILE_PATTERN)
637+
endif()
571638
endif()
572639

573640
if (LLVM_BUILD_STATIC)
@@ -752,13 +819,12 @@ set(LLVM_SRPM_USER_BINARY_SPECFILE ${CMAKE_CURRENT_SOURCE_DIR}/llvm.spec.in
752819
set(LLVM_SRPM_BINARY_SPECFILE ${CMAKE_CURRENT_BINARY_DIR}/llvm.spec)
753820
set(LLVM_SRPM_DIR "${CMAKE_CURRENT_BINARY_DIR}/srpm")
754821

755-
# SVN_REVISION and GIT_COMMIT get set by the call to add_version_info_from_vcs.
756-
# DUMMY_VAR contains a version string which we don't care about.
757-
add_version_info_from_vcs(DUMMY_VAR)
758-
if ( SVN_REVISION )
759-
set(LLVM_RPM_SPEC_REVISION "r${SVN_REVISION}")
760-
elseif ( GIT_COMMIT )
761-
set (LLVM_RPM_SPEC_REVISION "g${GIT_COMMIT}")
822+
get_source_info(${CMAKE_CURRENT_SOURCE_DIR} revision repository)
823+
string(LENGTH "${revision}" revision_length)
824+
if(revision MATCHES "^[0-9]+$" AND revision_length LESS 40)
825+
set(LLVM_RPM_SPEC_REVISION "r${revision}")
826+
else()
827+
set(LLVM_RPM_SPEC_REVISION "${revision}")
762828
endif()
763829

764830
configure_file(

CREDITS.TXT

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
This file is a partial list of people who have contributed to the LLVM
2-
project. If you have contributed a patch or made some other contribution to
2+
project. If you have contributed a patch or made some other contribution to
33
LLVM, please submit a patch to this file to add yourself, and it will be
44
done!
55

@@ -132,7 +132,7 @@ D: Basic-block autovectorization, PowerPC backend improvements
132132

133133
N: Eric Fiselier
134134
E: eric@efcs.ca
135-
D: LIT patches and documentation.
135+
D: LIT patches and documentation
136136

137137
N: Ryan Flynn
138138
E: pizza@parseerror.com
@@ -167,6 +167,17 @@ E: sunfish@mozilla.com
167167
D: Miscellaneous bug fixes
168168
D: WebAssembly Backend
169169

170+
N: Renato Golin
171+
E: rengolin@systemcall.eu
172+
E: renato.golin@linaro.org
173+
E: rengolin@gmail.com
174+
D: ARM/AArch64 back-end improvements
175+
D: Loop Vectorizer improvements
176+
D: Regression and Test Suite improvements
177+
D: Linux compatibility (GNU, musl, etc)
178+
D: Initial Linux kernel / Android support effort
179+
I: rengolin
180+
170181
N: David Goodwin
171182
E: david@goodwinz.net
172183
D: Thumb-2 code generator
@@ -514,3 +525,11 @@ D: PowerPC Backend Developer
514525
N: Kang Zhang
515526
E: shkzhang@cn.ibm.com
516527
D: PowerPC Backend Developer
528+
529+
N: Zheng Chen
530+
E: czhengsz@cn.ibm.com
531+
D: PowerPC Backend Developer
532+
533+
N: Qiu Chaofan
534+
E: qiucf@cn.ibm.com
535+
D: PowerPC Backend Developer

0 commit comments

Comments
 (0)