Skip to content

Commit 36b8e0d

Browse files
committed
Creating branches/google/stable and tags/google/stable/2018-12-18 from r349201
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/google/stable@349597 91177308-0d34-0410-b5e6-96231b3b80d8
2 parents 985d9f1 + 878b42a commit 36b8e0d

File tree

5,059 files changed

+442657
-127521
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,059 files changed

+442657
-127521
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ cscope.out
4141
autoconf/aclocal.m4
4242
autoconf/autom4te.cache
4343
/compile_commands.json
44+
# Visual Studio built-in CMake configuration
45+
/CMakeSettings.json
4446

4547
#==============================================================================#
4648
# Directories to ignore (do not add trailing '/'s, they skip symlinks).

CMakeLists.txt

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ if(POLICY CMP0068)
77
set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON)
88
endif()
99

10+
if(POLICY CMP0075)
11+
cmake_policy(SET CMP0075 NEW)
12+
endif()
13+
1014
if(NOT DEFINED LLVM_VERSION_MAJOR)
1115
set(LLVM_VERSION_MAJOR 8)
1216
endif()
@@ -183,6 +187,11 @@ option(LLVM_INSTALL_UTILS "Include utility binaries in the 'install' target." OF
183187

184188
option(LLVM_INSTALL_TOOLCHAIN_ONLY "Only include toolchain files in the 'install' target." OFF)
185189

190+
# Unfortunatly Clang is too eager to search directories for module maps, which can cause the
191+
# installed version of the maps to be found when building LLVM from source. Therefore we turn off
192+
# the installation by default. See llvm.org/PR31905.
193+
option(LLVM_INSTALL_MODULEMAPS "Install the modulemap files in the 'install' target." OFF)
194+
186195
option(LLVM_USE_FOLDERS "Enable solution folders in Visual Studio. Disable for Express versions." ON)
187196
if ( LLVM_USE_FOLDERS )
188197
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
@@ -287,6 +296,7 @@ set(LLVM_ALL_TARGETS
287296
PowerPC
288297
Sparc
289298
SystemZ
299+
WebAssembly
290300
X86
291301
XCore
292302
)
@@ -394,8 +404,8 @@ option(LLVM_USE_OPROFILE
394404
option(LLVM_EXTERNALIZE_DEBUGINFO
395405
"Generate dSYM files and strip executables and libraries (Darwin Only)" OFF)
396406

397-
option(LLVM_CODESIGNING_IDENTITY
398-
"Sign executables and dylibs with the given identity (Darwin Only)" OFF)
407+
set(LLVM_CODESIGNING_IDENTITY "" CACHE STRING
408+
"Sign executables and dylibs with the given identity or skip if empty (Darwin Only)")
399409

400410
# If enabled, verify we are on a platform that supports oprofile.
401411
if( LLVM_USE_OPROFILE )
@@ -854,7 +864,7 @@ if( LLVM_INCLUDE_UTILS )
854864
else()
855865
if ( LLVM_INCLUDE_TESTS )
856866
message(FATAL_ERROR "Including tests when not building utils will not work.
857-
Either set LLVM_INCLUDE_UTILS to On, or set LLVM_INCLDE_TESTS to Off.")
867+
Either set LLVM_INCLUDE_UTILS to On, or set LLVM_INCLUDE_TESTS to Off.")
858868
endif()
859869
endif()
860870

@@ -968,12 +978,26 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
968978
PATTERN ".svn" EXCLUDE
969979
)
970980

981+
if (LLVM_INSTALL_MODULEMAPS)
982+
install(DIRECTORY include/llvm include/llvm-c
983+
DESTINATION include
984+
COMPONENT llvm-headers
985+
FILES_MATCHING
986+
PATTERN "module.modulemap"
987+
)
988+
install(FILES include/llvm/module.install.modulemap
989+
DESTINATION include/llvm
990+
COMPONENT llvm-headers
991+
RENAME "module.extern.modulemap"
992+
)
993+
endif(LLVM_INSTALL_MODULEMAPS)
994+
971995
# Installing the headers needs to depend on generating any public
972996
# tablegen'd headers.
973997
add_custom_target(llvm-headers DEPENDS intrinsics_gen)
974998
set_target_properties(llvm-headers PROPERTIES FOLDER "Misc")
975999

976-
if (NOT CMAKE_CONFIGURATION_TYPES)
1000+
if (NOT LLVM_ENABLE_IDE)
9771001
add_llvm_install_targets(install-llvm-headers
9781002
DEPENDS llvm-headers
9791003
COMPONENT llvm-headers)
@@ -983,7 +1007,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
9831007
add_custom_target(llvm-libraries)
9841008
set_target_properties(llvm-libraries PROPERTIES FOLDER "Misc")
9851009

986-
if (NOT CMAKE_CONFIGURATION_TYPES)
1010+
if (NOT LLVM_ENABLE_IDE)
9871011
add_llvm_install_targets(install-llvm-libraries
9881012
DEPENDS llvm-libraries
9891013
COMPONENT llvm-libraries)
@@ -994,7 +1018,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
9941018
list(REMOVE_DUPLICATES LLVM_LIBS)
9951019
foreach(lib ${LLVM_LIBS})
9961020
add_dependencies(llvm-libraries ${lib})
997-
if (NOT CMAKE_CONFIGURATION_TYPES)
1021+
if (NOT LLVM_ENABLE_IDE)
9981022
add_dependencies(install-llvm-libraries install-${lib})
9991023
endif()
10001024
endforeach()
@@ -1004,7 +1028,7 @@ endif()
10041028
# This must be at the end of the LLVM root CMakeLists file because it must run
10051029
# after all targets are created.
10061030
if(LLVM_DISTRIBUTION_COMPONENTS)
1007-
if(CMAKE_CONFIGURATION_TYPES)
1031+
if(LLVM_ENABLE_IDE)
10081032
message(FATAL_ERROR "LLVM_DISTRIBUTION_COMPONENTS cannot be specified with multi-configuration generators (i.e. Xcode or Visual Studio)")
10091033
endif()
10101034

CODE_OWNERS.TXT

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,3 +222,7 @@ D: C API, OCaml bindings
222222
N: Jake Ehrlich
223223
224224
D: llvm-objcopy (tools/llvm-objcopy)
225+
226+
N: Martin Storsjö
227+
228+
D: MinGW

CREDITS.TXT

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,8 +492,8 @@ D: Thread Local Storage implementation
492492
N: Bill Wendling
493493
I: wendling
494494
495-
D: Release manager, IR Linker, LTO
496-
D: Bunches of stuff
495+
D: Release manager, IR Linker, LTO.
496+
D: Bunches of stuff.
497497

498498
N: Bob Wilson
499499
@@ -502,3 +502,15 @@ D: Advanced SIMD (NEON) support in the ARM backend.
502502
N: QingShan Zhang
503503
504504
D: PowerPC Backend Developer
505+
506+
N: Li Jia He
507+
508+
D: PowerPC Backend Developer
509+
510+
N: Zixuan Wu
511+
512+
D: PowerPC Backend Developer
513+
514+
N: Kang Zhang
515+
516+
D: PowerPC Backend Developer

RELEASE_TESTERS.TXT

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ E: [email protected]
4141
T: x86
4242
O: Windows
4343

44-
N: Diana Picus
45-
44+
N: Diana Picus, Yvan Roux
45+
4646
T: ARM, AArch64
4747
O: Linux

bindings/go/llvm/ir.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,6 @@ func (v Value) IsAPHINode() (rv Value) { rv.C = C.LLVMIsAPHINode(v.C
739739
func (v Value) IsASelectInst() (rv Value) { rv.C = C.LLVMIsASelectInst(v.C); return }
740740
func (v Value) IsAShuffleVectorInst() (rv Value) { rv.C = C.LLVMIsAShuffleVectorInst(v.C); return }
741741
func (v Value) IsAStoreInst() (rv Value) { rv.C = C.LLVMIsAStoreInst(v.C); return }
742-
func (v Value) IsATerminatorInst() (rv Value) { rv.C = C.LLVMIsATerminatorInst(v.C); return }
743742
func (v Value) IsABranchInst() (rv Value) { rv.C = C.LLVMIsABranchInst(v.C); return }
744743
func (v Value) IsAInvokeInst() (rv Value) { rv.C = C.LLVMIsAInvokeInst(v.C); return }
745744
func (v Value) IsAReturnInst() (rv Value) { rv.C = C.LLVMIsAReturnInst(v.C); return }
@@ -1259,6 +1258,19 @@ func InlineAsm(t Type, asmString, constraints string, hasSideEffects, isAlignSta
12591258
return
12601259
}
12611260

1261+
// Operations on aggregates
1262+
func (v Value) Indices() []uint32 {
1263+
num := C.LLVMGetNumIndices(v.C)
1264+
indicesPtr := C.LLVMGetIndices(v.C)
1265+
// https://github.com/golang/go/wiki/cgo#turning-c-arrays-into-go-slices
1266+
rawIndices := (*[1 << 30]C.uint)(unsafe.Pointer(indicesPtr))[:num:num]
1267+
indices := make([]uint32, num)
1268+
for i := range indices {
1269+
indices[i] = uint32(rawIndices[i])
1270+
}
1271+
return indices
1272+
}
1273+
12621274
//-------------------------------------------------------------------------
12631275
// llvm.Builder
12641276
//-------------------------------------------------------------------------

bindings/ocaml/llvm/llvm.mli

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1887,16 +1887,16 @@ val set_volatile : bool -> llvalue -> unit
18871887
val is_terminator : llvalue -> bool
18881888

18891889
(** [successor v i] returns the successor at index [i] for the value [v].
1890-
See the method [llvm::TerminatorInst::getSuccessor]. *)
1890+
See the method [llvm::Instruction::getSuccessor]. *)
18911891
val successor : llvalue -> int -> llbasicblock
18921892

18931893
(** [set_successor v i o] sets the successor of the value [v] at the index [i] to
18941894
the value [o].
1895-
See the method [llvm::TerminatorInst::setSuccessor]. *)
1895+
See the method [llvm::Instruction::setSuccessor]. *)
18961896
val set_successor : llvalue -> int -> llbasicblock -> unit
18971897

18981898
(** [num_successors v] returns the number of successors for the value [v].
1899-
See the method [llvm::TerminatorInst::getNumSuccessors]. *)
1899+
See the method [llvm::Instruction::getNumSuccessors]. *)
19001900
val num_successors : llvalue -> int
19011901

19021902
(** [successors v] returns the successors of [v]. *)

bindings/ocaml/llvm/llvm_ocaml.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -483,9 +483,9 @@ CAMLprim value llvm_struct_set_body(LLVMTypeRef Ty,
483483
CAMLprim value llvm_struct_name(LLVMTypeRef Ty)
484484
{
485485
CAMLparam0();
486+
CAMLlocal1(result);
486487
const char *C = LLVMGetStructName(Ty);
487488
if (C) {
488-
CAMLlocal1(result);
489489
result = caml_alloc_small(1, 0);
490490
Store_field(result, 0, caml_copy_string(C));
491491
CAMLreturn(result);
@@ -636,6 +636,7 @@ enum ValueKind {
636636

637637
CAMLprim value llvm_classify_value(LLVMValueRef Val) {
638638
CAMLparam0();
639+
CAMLlocal1(result);
639640
if (!Val)
640641
CAMLreturn(Val_int(NullValue));
641642
if (LLVMIsAConstant(Val)) {
@@ -652,7 +653,6 @@ CAMLprim value llvm_classify_value(LLVMValueRef Val) {
652653
DEFINE_CASE(Val, ConstantVector);
653654
}
654655
if (LLVMIsAInstruction(Val)) {
655-
CAMLlocal1(result);
656656
result = caml_alloc_small(1, 0);
657657
Store_field(result, 0, Val_int(LLVMGetInstructionOpcode(Val)));
658658
CAMLreturn(result);
@@ -822,12 +822,11 @@ CAMLprim LLVMValueRef llvm_mdnull(LLVMContextRef C) {
822822
/* llvalue -> string option */
823823
CAMLprim value llvm_get_mdstring(LLVMValueRef V) {
824824
CAMLparam0();
825+
CAMLlocal2(Option, Str);
825826
const char *S;
826827
unsigned Len;
827828

828829
if ((S = LLVMGetMDString(V, &Len))) {
829-
CAMLlocal2(Option, Str);
830-
831830
Str = caml_alloc_string(Len);
832831
memcpy(String_val(Str), S, Len);
833832
Option = alloc(1,0);

cmake/config-ix.cmake

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ include(CheckIncludeFile)
77
include(CheckLibraryExists)
88
include(CheckSymbolExists)
99
include(CheckFunctionExists)
10+
include(CheckStructHasMember)
1011
include(CheckCCompilerFlag)
1112

1213
include(CheckCompilerVersion)
@@ -128,7 +129,7 @@ if(NOT LLVM_USE_SANITIZER MATCHES "Memory.*")
128129
endif()
129130
if(LLVM_ENABLE_TERMINFO)
130131
set(HAVE_TERMINFO 0)
131-
foreach(library tinfo terminfo curses ncurses ncursesw)
132+
foreach(library terminfo tinfo curses ncurses ncursesw)
132133
string(TOUPPER ${library} library_suffix)
133134
check_library_exists(${library} setupterm "" HAVE_TERMINFO_${library_suffix})
134135
if(HAVE_TERMINFO_${library_suffix})
@@ -248,6 +249,11 @@ if( HAVE_DLFCN_H )
248249
endif()
249250
endif()
250251

252+
CHECK_STRUCT_HAS_MEMBER("struct stat" st_mtimespec.tv_nsec
253+
"sys/types.h;sys/stat.h" HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC)
254+
CHECK_STRUCT_HAS_MEMBER("struct stat" st_mtim.tv_nsec
255+
"sys/types.h;sys/stat.h" HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC)
256+
251257
check_symbol_exists(__GLIBC__ stdio.h LLVM_USING_GLIBC)
252258
if( LLVM_USING_GLIBC )
253259
add_definitions( -D_GNU_SOURCE )

0 commit comments

Comments
 (0)