Skip to content
This repository was archived by the owner on Sep 2, 2018. It is now read-only.

Commit 06faf0a

Browse files
authored
Merge pull request #218 from shepmaster/with-llvm-3.9
Merge in LLVM 3.9 release branch
2 parents 2860030 + 22a3f6c commit 06faf0a

File tree

4,240 files changed

+258401
-100730
lines changed

Some content is hidden

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

4,240 files changed

+258401
-100730
lines changed

.arcconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"project_id" : "llvm",
3-
"conduit_uri" : "http://reviews.llvm.org/"
3+
"conduit_uri" : "https://reviews.llvm.org/"
44
}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ autoconf/autom4te.cache
4646
projects/*
4747
!projects/*.*
4848
!projects/Makefile
49+
runtimes/*
50+
!runtimes/*.*
4951
# Clang, which is tracked independently.
5052
tools/clang
5153
# LLDB, which is tracked independently.

.travis.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
dist: trusty
21
language: cpp
32
script: cmake
43

@@ -10,14 +9,20 @@ addons:
109
packages:
1110
- gcc-5
1211
- g++-5
13-
- cmake
12+
13+
before_install:
14+
- wget --no-check-certificate https://cmake.org/files/v3.6/cmake-3.6.1-Linux-x86_64.tar.gz
15+
- tar -zxf cmake-3.6.1-Linux-x86_64.tar.gz
1416

1517
install:
16-
- export CC="gcc-5" CXX="g++-5"
18+
- export CC="gcc-5" CXX="g++-5" PATH="${PWD}/cmake-3.6.1-Linux-x86_64/bin:${PATH}"
19+
- ${CC} --version
20+
- ${CXX} --version
21+
- cmake --version
1722

1823
script:
19-
- git clone https://github.com/avr-llvm/clang.git tools/clang
20-
- git clone https://github.com/avr-llvm/compiler-rt.git projects/compiler-rt
24+
#- git clone https://github.com/avr-llvm/clang.git tools/clang
25+
#- git clone https://github.com/avr-llvm/compiler-rt.git projects/compiler-rt
2126
- mkdir build && cd build
2227
# Build shared libs - faster linking
2328
- cmake ../ -DLLVM_TARGETS_TO_BUILD="AVR" -DBUILD_SHARED_LIBS="ON"

CMakeLists.txt

Lines changed: 46 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# See docs/CMake.html for instructions about how to build LLVM with CMake.
22

3-
cmake_minimum_required(VERSION 2.8.12.2)
3+
cmake_minimum_required(VERSION 3.4.3)
44

55
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
66
message(STATUS "No build type selected, default to Debug")
@@ -20,12 +20,6 @@ if (POLICY CMP0051)
2020
cmake_policy(SET CMP0051 OLD)
2121
endif()
2222

23-
if(CMAKE_VERSION VERSION_LESS 3.1.20141117)
24-
set(cmake_3_2_USES_TERMINAL)
25-
else()
26-
set(cmake_3_2_USES_TERMINAL USES_TERMINAL)
27-
endif()
28-
2923
if(NOT DEFINED LLVM_VERSION_MAJOR)
3024
set(LLVM_VERSION_MAJOR 3)
3125
endif()
@@ -36,7 +30,7 @@ if(NOT DEFINED LLVM_VERSION_PATCH)
3630
set(LLVM_VERSION_PATCH 0)
3731
endif()
3832
if(NOT DEFINED LLVM_VERSION_SUFFIX)
39-
set(LLVM_VERSION_SUFFIX svn)
33+
set(LLVM_VERSION_SUFFIX "")
4034
endif()
4135

4236
if (POLICY CMP0048)
@@ -75,8 +69,8 @@ endif()
7569
set(LLVM_PARALLEL_COMPILE_JOBS "" CACHE STRING
7670
"Define the maximum number of concurrent compilation jobs.")
7771
if(LLVM_PARALLEL_COMPILE_JOBS)
78-
if(CMAKE_VERSION VERSION_LESS 3.0 OR NOT CMAKE_MAKE_PROGRAM MATCHES "ninja")
79-
message(WARNING "Job pooling is only available with Ninja generators and CMake 3.0 and later.")
72+
if(NOT CMAKE_MAKE_PROGRAM MATCHES "ninja")
73+
message(WARNING "Job pooling is only available with Ninja generators.")
8074
else()
8175
set_property(GLOBAL APPEND PROPERTY JOB_POOLS compile_job_pool=${LLVM_PARALLEL_COMPILE_JOBS})
8276
set(CMAKE_JOB_POOL_COMPILE compile_job_pool)
@@ -91,8 +85,8 @@ endif()
9185
set(LLVM_PARALLEL_LINK_JOBS "" CACHE STRING
9286
"Define the maximum number of concurrent link jobs.")
9387
if(LLVM_PARALLEL_LINK_JOBS)
94-
if(CMAKE_VERSION VERSION_LESS 3.0 OR NOT CMAKE_MAKE_PROGRAM MATCHES "ninja")
95-
message(WARNING "Job pooling is only available with Ninja generators and CMake 3.0 and later.")
88+
if(NOT CMAKE_MAKE_PROGRAM MATCHES "ninja")
89+
message(WARNING "Job pooling is only available with Ninja generators.")
9690
else()
9791
set_property(GLOBAL APPEND PROPERTY JOB_POOLS link_job_pool=${LLVM_PARALLEL_LINK_JOBS})
9892
set(CMAKE_JOB_POOL_LINK link_job_pool)
@@ -201,6 +195,9 @@ endif()
201195

202196
set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" )
203197

198+
set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')")
199+
mark_as_advanced(LLVM_TOOLS_INSTALL_DIR)
200+
204201
# They are used as destination of target generators.
205202
set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)
206203
set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX})
@@ -287,6 +284,13 @@ include(AddLLVMDefinitions)
287284
option(LLVM_ENABLE_PIC "Build Position-Independent Code" ON)
288285
option(LLVM_ENABLE_WARNINGS "Enable compiler warnings." ON)
289286
option(LLVM_ENABLE_MODULES "Compile with C++ modules enabled." OFF)
287+
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
288+
option(LLVM_ENABLE_MODULE_DEBUGGING "Compile with -gmodules." ON)
289+
option(LLVM_ENABLE_LOCAL_SUBMODULE_VISIBILITY "Compile with -fmodules-local-submodule-visibility." OFF)
290+
else()
291+
option(LLVM_ENABLE_MODULE_DEBUGGING "Compile with -gmodules." OFF)
292+
option(LLVM_ENABLE_LOCAL_SUBMODULE_VISIBILITY "Compile with -fmodules-local-submodule-visibility." ON)
293+
endif()
290294
option(LLVM_ENABLE_CXX1Y "Compile with C++1y enabled." OFF)
291295
option(LLVM_ENABLE_LIBCXX "Use libc++ if available." OFF)
292296
option(LLVM_ENABLE_LIBCXXABI "Use libc++abi when using libc++." OFF)
@@ -388,6 +392,8 @@ option(LLVM_BUILD_TOOLS
388392
"Build the LLVM tools. If OFF, just generate build targets." ON)
389393

390394
option(LLVM_INCLUDE_UTILS "Generate build targets for the LLVM utils." ON)
395+
option(LLVM_BUILD_UTILS
396+
"Build LLVM utility binaries. If OFF, just generate build targets." ON)
391397

392398
option(LLVM_BUILD_RUNTIME
393399
"Build the LLVM runtime libraries." ON)
@@ -434,6 +440,21 @@ else()
434440
set(LLVM_ADD_NATIVE_VISUALIZERS_TO_SOLUTION FALSE CACHE INTERNAL "For Visual Studio 2013, manually copy natvis files to Documents\\Visual Studio 2013\\Visualizers" FORCE)
435441
endif()
436442

443+
if (LLVM_BUILD_INSTRUMENTED OR LLVM_BUILD_INSTRUMENTED_COVERAGE)
444+
if(NOT LLVM_PROFILE_MERGE_POOL_SIZE)
445+
# A pool size of 1-2 is probably sufficient on a SSD. 3-4 should be fine
446+
# for spining disks. Anything higher may only help on slower mediums.
447+
set(LLVM_PROFILE_MERGE_POOL_SIZE "4")
448+
endif()
449+
if(NOT LLVM_PROFILE_FILE_PATTERN)
450+
if(NOT LLVM_PROFILE_DATA_DIR)
451+
set(LLVM_PROFILE_FILE_PATTERN "%${LLVM_PROFILE_MERGE_POOL_SIZE}m.profraw")
452+
else()
453+
file(TO_NATIVE_PATH "${LLVM_PROFILE_DATA_DIR}/%${LLVM_PROFILE_MERGE_POOL_SIZE}m.profraw" LLVM_PROFILE_FILE_PATTERN)
454+
endif()
455+
endif()
456+
endif()
457+
437458
# All options referred to from HandleLLVMOptions have to be specified
438459
# BEFORE this include, otherwise options will not be correctly set on
439460
# first cmake run
@@ -682,6 +703,15 @@ add_subdirectory(lib/TableGen)
682703

683704
add_subdirectory(utils/TableGen)
684705

706+
# Force target to be built as soon as possible. Clang modules builds depend
707+
# header-wise on it as they ship all headers from the umbrella folders. Building
708+
# an entire module might include header, which depends on intrinsics_gen. This
709+
# should be right after LLVMSupport and LLVMTableGen otherwise we introduce a
710+
# circular dependence.
711+
if (LLVM_ENABLE_MODULES)
712+
list(APPEND LLVM_COMMON_DEPENDS intrinsics_gen)
713+
endif(LLVM_ENABLE_MODULES)
714+
685715
add_subdirectory(include/llvm)
686716

687717
add_subdirectory(lib)
@@ -721,6 +751,8 @@ if( LLVM_INCLUDE_TOOLS )
721751
add_subdirectory(tools)
722752
endif()
723753

754+
add_subdirectory(runtimes)
755+
724756
if( LLVM_INCLUDE_EXAMPLES )
725757
add_subdirectory(examples)
726758
endif()
@@ -731,7 +763,8 @@ if( LLVM_INCLUDE_TESTS )
731763
llvm_ExternalProject_Add(test-suite ${LLVM_MAIN_SRC_DIR}/projects/test-suite
732764
USE_TOOLCHAIN
733765
EXCLUDE_FROM_ALL
734-
NO_INSTALL)
766+
NO_INSTALL
767+
ALWAYS_CLEAN)
735768
endif()
736769
add_subdirectory(test)
737770
add_subdirectory(unittests)

CODE_OWNERS.TXT

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,10 @@ N: Joe Abbey
1212
E: jabbey@arxan.com
1313
D: LLVM Bitcode (lib/Bitcode/* include/llvm/Bitcode/*)
1414

15-
N: Owen Anderson
16-
E: resistor@mac.com
17-
D: SelectionDAG (lib/CodeGen/SelectionDAG/*)
18-
19-
N: Rafael Avila de Espindola
20-
E: rafael.espindola@gmail.com
21-
D: Gold plugin (tools/gold/*)
22-
2315
N: Justin Bogner
2416
E: mail@justinbogner.com
2517
D: InstrProfiling and related parts of ProfileData
18+
D: SelectionDAG (lib/CodeGen/SelectionDAG/*)
2619

2720
N: Chandler Carruth
2821
E: chandlerc@gmail.com
@@ -41,9 +34,9 @@ N: Greg Clayton
4134
E: gclayton@apple.com
4235
D: LLDB
4336

44-
N: Hans Wennborg
45-
E: hans@chromium.org
46-
D: Release management (x.y.0 releases)
37+
N: Sanjoy Das
38+
E: sanjoy@playingwithpointers.com
39+
D: IndVar Simplify, Scalar Evolution
4740

4841
N: Marshall Clow
4942
E: mclow.lists@gmail.com
@@ -93,6 +86,10 @@ N: Lang Hames
9386
E: lhames@gmail.com
9487
D: MCJIT, RuntimeDyld and JIT event listeners, Orcish Warchief
9588

89+
N: Teresa Johnson
90+
E: tejohnson@google.com
91+
D: Gold plugin (tools/gold/*)
92+
9693
N: Galina Kistanova
9794
E: gkistanova@gmail.com
9895
D: LLVM Buildbot
@@ -189,7 +186,7 @@ D: MemorySanitizer (LLVM part)
189186

190187
N: Andrew Trick
191188
E: atrick@apple.com
192-
D: IndVar Simplify, Loop Strength Reduction, Instruction Scheduling
189+
D: Loop Strength Reduction, Instruction Scheduling
193190

194191
N: Ulrich Weigand
195192
E: uweigand@de.ibm.com
@@ -199,6 +196,10 @@ N: Bill Wendling
199196
E: isanbard@gmail.com
200197
D: libLTO, IR Linker
201198

199+
N: Hans Wennborg
200+
E: hans@chromium.org
201+
D: Release management (x.y.0 releases)
202+
202203
N: Peter Zotov
203204
E: whitequark@whitequark.org
204205
D: OCaml bindings

bindings/ocaml/llvm/llvm.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,8 @@ external mdstring : llcontext -> string -> llvalue = "llvm_mdstring"
483483
external mdnode : llcontext -> llvalue array -> llvalue = "llvm_mdnode"
484484
external mdnull : llcontext -> llvalue = "llvm_mdnull"
485485
external get_mdstring : llvalue -> string option = "llvm_get_mdstring"
486+
external get_mdnode_operands : llvalue -> llvalue array
487+
= "llvm_get_mdnode_operands"
486488
external get_named_metadata : llmodule -> string -> llvalue array
487489
= "llvm_get_namedmd"
488490
external add_named_metadata_operand : llmodule -> string -> llvalue -> unit

bindings/ocaml/llvm/llvm.mli

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -852,6 +852,10 @@ val mdnull : llcontext -> llvalue
852852
See the method [llvm::MDString::getString] *)
853853
val get_mdstring : llvalue -> string option
854854

855+
(** [get_mdnode_operands v] returns the operands in the MDNode. *)
856+
(* See the method [llvm::MDNode::getOperand] *)
857+
val get_mdnode_operands : llvalue -> llvalue array
858+
855859
(** [get_named_metadata m name] returns all the MDNodes belonging to the named
856860
metadata (if any).
857861
See the method [llvm::NamedMDNode::getOperand]. *)

bindings/ocaml/llvm/llvm_ocaml.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,17 @@ CAMLprim value llvm_get_mdstring(LLVMValueRef V) {
734734
CAMLreturn(Val_int(0));
735735
}
736736

737+
CAMLprim value llvm_get_mdnode_operands(LLVMValueRef V) {
738+
CAMLparam0();
739+
CAMLlocal1(Operands);
740+
unsigned int n;
741+
742+
n = LLVMGetMDNodeNumOperands(V);
743+
Operands = alloc(n, 0);
744+
LLVMGetMDNodeOperands(V, (LLVMValueRef *) Operands);
745+
CAMLreturn(Operands);
746+
}
747+
737748
/* llmodule -> string -> llvalue array */
738749
CAMLprim value llvm_get_namedmd(LLVMModuleRef M, value Name)
739750
{

bindings/ocaml/transforms/scalar_opts/llvm_scalar_opts.mli

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,17 +127,17 @@ external add_sccp
127127
: [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
128128
= "llvm_add_sccp"
129129

130-
(** See the [llvm::createScalarReplAggregatesPass] function. *)
130+
(** See the [llvm::createSROAPass] function. *)
131131
external add_scalar_repl_aggregation
132132
: [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
133133
= "llvm_add_scalar_repl_aggregates"
134134

135-
(** See the [llvm::createScalarReplAggregatesPassSSA] function. *)
135+
(** See the [llvm::createSROAPass] function. *)
136136
external add_scalar_repl_aggregation_ssa
137137
: [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
138138
= "llvm_add_scalar_repl_aggregates_ssa"
139139

140-
(** See the [llvm::createScalarReplAggregatesWithThreshold] function. *)
140+
(** See the [llvm::createSROAPass] function. *)
141141
external add_scalar_repl_aggregation_with_threshold
142142
: int -> [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
143143
= "llvm_add_scalar_repl_aggregates_with_threshold"

cmake/config-ix.cmake

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,13 @@ if( NOT PURE_WINDOWS )
110110
endif()
111111

112112
if(HAVE_LIBPTHREAD)
113-
set(PTHREAD_LIB pthread)
113+
# We want to find pthreads library and at the moment we do want to
114+
# have it reported as '-l<lib>' instead of '-pthread'.
115+
# TODO: switch to -pthread once the rest of the build system can deal with it.
116+
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
117+
set(THREADS_HAVE_PTHREAD_ARG Off)
118+
find_package(Threads REQUIRED)
119+
set(PTHREAD_LIB ${CMAKE_THREAD_LIBS_INIT})
114120
endif()
115121

116122
# Don't look for these libraries on Windows. Also don't look for them if we're
@@ -141,6 +147,11 @@ if( NOT PURE_WINDOWS AND NOT LLVM_USE_SANITIZER MATCHES "Memory.*")
141147
endif()
142148
endif()
143149

150+
check_library_exists(xar xar_open "" HAVE_LIBXAR)
151+
if(HAVE_LIBXAR)
152+
set(XAR_LIB xar)
153+
endif()
154+
144155
# function checks
145156
check_symbol_exists(arc4random "stdlib.h" HAVE_DECL_ARC4RANDOM)
146157
check_symbol_exists(backtrace "execinfo.h" HAVE_BACKTRACE)
@@ -157,6 +168,9 @@ if( HAVE_SETJMP_H )
157168
check_symbol_exists(siglongjmp setjmp.h HAVE_SIGLONGJMP)
158169
check_symbol_exists(sigsetjmp setjmp.h HAVE_SIGSETJMP)
159170
endif()
171+
if( HAVE_SIGNAL_H )
172+
check_symbol_exists(sigaltstack signal.h HAVE_SIGALTSTACK)
173+
endif()
160174
if( HAVE_SYS_UIO_H )
161175
check_symbol_exists(writev sys/uio.h HAVE_WRITEV)
162176
endif()
@@ -404,12 +418,12 @@ else ()
404418
set(LLVM_NATIVE_ASMPRINTER LLVMInitialize${LLVM_NATIVE_ARCH}AsmPrinter)
405419

406420
# We don't have an ASM parser for all architectures yet.
407-
if (EXISTS ${CMAKE_SOURCE_DIR}/lib/Target/${LLVM_NATIVE_ARCH}/AsmParser/CMakeLists.txt)
421+
if (EXISTS ${PROJECT_SOURCE_DIR}/lib/Target/${LLVM_NATIVE_ARCH}/AsmParser/CMakeLists.txt)
408422
set(LLVM_NATIVE_ASMPARSER LLVMInitialize${LLVM_NATIVE_ARCH}AsmParser)
409423
endif ()
410424

411425
# We don't have an disassembler for all architectures yet.
412-
if (EXISTS ${CMAKE_SOURCE_DIR}/lib/Target/${LLVM_NATIVE_ARCH}/Disassembler/CMakeLists.txt)
426+
if (EXISTS ${PROJECT_SOURCE_DIR}/lib/Target/${LLVM_NATIVE_ARCH}/Disassembler/CMakeLists.txt)
413427
set(LLVM_NATIVE_DISASSEMBLER LLVMInitialize${LLVM_NATIVE_ARCH}Disassembler)
414428
endif ()
415429
endif ()
@@ -520,7 +534,7 @@ else()
520534
if(GO_EXECUTABLE STREQUAL "GO_EXECUTABLE-NOTFOUND")
521535
message(STATUS "Go bindings disabled.")
522536
else()
523-
execute_process(COMMAND ${GO_EXECUTABLE} run ${CMAKE_SOURCE_DIR}/bindings/go/conftest.go
537+
execute_process(COMMAND ${GO_EXECUTABLE} run ${PROJECT_SOURCE_DIR}/bindings/go/conftest.go
524538
RESULT_VARIABLE GO_CONFTEST)
525539
if(GO_CONFTEST STREQUAL "0")
526540
set(LLVM_BINDINGS "${LLVM_BINDINGS} go")

0 commit comments

Comments
 (0)