Permalink
Browse files

Updating branches/google/stable to r305862

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/google/stable@306026 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information...
2 parents 7d2db0d + 09ff5f2 commit 8fa03b953809b3d7ab83bf4430879b517ff2f5d7 @djasper djasper committed Jun 22, 2017
Showing 3,917 changed files with 487,965 additions and 177,015 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
View
@@ -44,6 +44,13 @@ if (NOT PACKAGE_VERSION)
"${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}${LLVM_VERSION_SUFFIX}")
endif()
+if ((CMAKE_GENERATOR MATCHES "Visual Studio") AND (CMAKE_GENERATOR_TOOLSET STREQUAL ""))
+ message(WARNING "Visual Studio generators use the x86 host compiler by "
+ "default, even for 64-bit targets. This can result in linker "
+ "instability and out of memory errors. To use the 64-bit "
+ "host compiler, pass -Thost=x64 on the CMake command line.")
+endif()
+
project(LLVM
${cmake_3_0_PROJ_VERSION}
${cmake_3_0_LANGUAGES}
@@ -378,6 +385,7 @@ else()
option(LLVM_ENABLE_LOCAL_SUBMODULE_VISIBILITY "Compile with -fmodules-local-submodule-visibility." ON)
endif()
option(LLVM_ENABLE_CXX1Y "Compile with C++1y enabled." OFF)
+option(LLVM_ENABLE_CXX1Z "Compile with C++1z enabled." OFF)
option(LLVM_ENABLE_LIBCXX "Use libc++ if available." OFF)
option(LLVM_ENABLE_LLD "Use lld as C and C++ linker." OFF)
option(LLVM_ENABLE_PEDANTIC "Compile with pedantic enabled." ON)
@@ -530,6 +538,8 @@ if(LLVM_LINK_LLVM_DYLIB OR LLVM_BUILD_LLVM_C_DYLIB)
endif()
option(LLVM_BUILD_LLVM_DYLIB "Build libllvm dynamic library" ${LLVM_BUILD_LLVM_DYLIB_default})
+option(LLVM_DYLIB_SYMBOL_VERSIONING OFF)
+
option(LLVM_OPTIMIZED_TABLEGEN "Force TableGen to be built with optimization" OFF)
if(CMAKE_CROSSCOMPILING OR (LLVM_OPTIMIZED_TABLEGEN AND (LLVM_ENABLE_ASSERTIONS OR CMAKE_CONFIGURATION_TYPES)))
set(LLVM_USE_HOST_TOOLS ON)
@@ -560,6 +570,10 @@ if (LLVM_BUILD_STATIC)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
endif()
+# Override the default target with an environment variable named by LLVM_TARGET_TRIPLE_ENV.
+set(LLVM_TARGET_TRIPLE_ENV CACHE STRING "The name of environment variable to override default target. Disabled by blank.")
+mark_as_advanced(LLVM_TARGET_TRIPLE_ENV)
+
# All options referred to from HandleLLVMOptions have to be specified
# BEFORE this include, otherwise options will not be correctly set on
# first cmake run
@@ -844,7 +858,6 @@ if( LLVM_INCLUDE_UTILS )
add_subdirectory(utils/not)
add_subdirectory(utils/llvm-lit)
add_subdirectory(utils/yaml-bench)
- add_subdirectory(utils/unittest)
else()
if ( LLVM_INCLUDE_TESTS )
message(FATAL_ERROR "Including tests when not building utils will not work.
@@ -888,6 +901,10 @@ if( LLVM_INCLUDE_TESTS )
endif()
add_subdirectory(test)
add_subdirectory(unittests)
+ if( LLVM_INCLUDE_UTILS )
+ add_subdirectory(utils/unittest)
+ endif()
+
if (WIN32)
# This utility is used to prevent crashing tests from calling Dr. Watson on
# Windows.
View
@@ -265,7 +265,7 @@ D: Release manager (1.7+)
N: Sylvestre Ledru
E: sylvestre@debian.org
W: http://sylvestre.ledru.info/
-W: http://llvm.org/apt/
+W: http://apt.llvm.org/
D: Debian and Ubuntu packaging
D: Continuous integration with jenkins
View
@@ -611,6 +611,12 @@ func (t Type) StructElementTypes() []Type {
}
// Operations on array, pointer, and vector types (sequence types)
+func (t Type) Subtypes() (ret []Type) {
+ ret = make([]Type, C.LLVMGetNumContainedTypes(t.C))
+ C.LLVMGetSubtypes(t.C, llvmTypeRefPtr(&ret[0]))
+ return
+}
+
func ArrayType(elementType Type, elementCount int) (t Type) {
t.C = C.LLVMArrayType(elementType.C, C.unsigned(elementCount))
return
@@ -134,3 +134,29 @@ func TestDebugLoc(t *testing.T) {
t.Errorf("Got metadata %v as scope, though wanted %v", loc.Scope.C, scope.C)
}
}
+
+func TestSubtypes(t *testing.T) {
+ cont := NewContext()
+ defer cont.Dispose()
+
+ int_pointer := PointerType(cont.Int32Type(), 0)
+ int_inner := int_pointer.Subtypes()
+ if len(int_inner) != 1 {
+ t.Errorf("Got size %d, though wanted 1")
+ }
+ if int_inner[0] != cont.Int32Type() {
+ t.Errorf("Expected int32 type")
+ }
+
+ 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")
+ }
+ if st_inner[0] != cont.Int32Type() {
+ t.Errorf("Expected first struct field to be int32")
+ }
+ if st_inner[1] != cont.Int8Type() {
+ t.Errorf("Expected second struct field to be int8")
+ }
+}
@@ -459,6 +459,8 @@ external is_packed : lltype -> bool = "llvm_is_packed"
external is_opaque : lltype -> bool = "llvm_is_opaque"
(*--... Operations on pointer, vector, and array types .....................--*)
+
+external subtypes : lltype -> lltype array = "llvm_subtypes"
external array_type : lltype -> int -> lltype = "llvm_array_type"
external pointer_type : lltype -> lltype = "llvm_pointer_type"
external qualified_pointer_type : lltype -> int -> lltype
@@ -658,6 +658,9 @@ val is_opaque : lltype -> bool
(** {7 Operations on pointer, vector, and array types} *)
+(** [subtypes ty] returns [ty]'s subtypes *)
+val subtypes : lltype -> lltype array
+
(** [array_type ty n] returns the array type containing [n] elements of type
[ty]. See the method [llvm::ArrayType::get]. *)
val array_type : lltype -> int -> lltype
@@ -506,6 +506,20 @@ CAMLprim value llvm_is_opaque(LLVMTypeRef StructTy) {
/*--... Operations on array, pointer, and vector types .....................--*/
+/* lltype -> lltype array */
+CAMLprim value llvm_subtypes(LLVMTypeRef Ty) {
+ CAMLparam0();
+ CAMLlocal1(Arr);
+
+ unsigned Size = LLVMGetNumContainedTypes(Ty);
+
+ Arr = caml_alloc(Size, 0);
+
+ LLVMGetSubtypes(Ty, (LLVMTypeRef *) Arr);
+
+ CAMLreturn(Arr);
+}
+
/* lltype -> int -> lltype */
CAMLprim LLVMTypeRef llvm_array_type(LLVMTypeRef ElementTy, value Count) {
return LLVMArrayType(ElementTy, Int_val(Count));
View
10 cmake/config-ix.cmake 100755 → 100644
@@ -530,16 +530,6 @@ else()
message(STATUS "Doxygen disabled.")
endif()
-if (LLVM_ENABLE_SPHINX)
- message(STATUS "Sphinx enabled.")
- find_package(Sphinx REQUIRED)
- if (LLVM_BUILD_DOCS)
- add_custom_target(sphinx ALL)
- endif()
-else()
- message(STATUS "Sphinx disabled.")
-endif()
-
set(LLVM_BINDINGS "")
if(WIN32)
message(STATUS "Go bindings disabled.")
@@ -1133,6 +1133,19 @@ function(configure_lit_site_cfg input output)
set(LIT_SITE_CFG_IN_HEADER "## Autogenerated from ${input}\n## Do not edit!")
+ # Override config_target_triple (and the env)
+ if(LLVM_TARGET_TRIPLE_ENV)
+ # This is expanded into the heading.
+ string(CONCAT LIT_SITE_CFG_IN_HEADER "${LIT_SITE_CFG_IN_HEADER}\n\n"
+ "import os\n"
+ "target_env = \"${LLVM_TARGET_TRIPLE_ENV}\"\n"
+ "config.target_triple = config.environment[target_env] = os.environ.get(target_env, \"${TARGET_TRIPLE}\")\n"
+ )
+
+ # This is expanded to; config.target_triple = ""+config.target_triple+""
+ set(TARGET_TRIPLE "\"+config.target_triple+\"")
+ endif()
+
configure_file(${input} ${output} @ONLY)
endfunction()
@@ -1,3 +1,16 @@
+
+# Create sphinx target
+if (LLVM_ENABLE_SPHINX)
+ message(STATUS "Sphinx enabled.")
+ find_package(Sphinx REQUIRED)
+ if (LLVM_BUILD_DOCS AND NOT TARGET sphinx)
+ add_custom_target(sphinx ALL)
+ endif()
+else()
+ message(STATUS "Sphinx disabled.")
+endif()
+
+
# Handy function for creating the different Sphinx targets.
#
# ``builder`` should be one of the supported builders used by
@@ -101,6 +101,10 @@ else()
message(FATAL_ERROR "Unknown value for LLVM_ABI_BREAKING_CHECKS: \"${LLVM_ABI_BREAKING_CHECKS}\"!")
endif()
+if( LLVM_REVERSE_ITERATION )
+ set( LLVM_ENABLE_REVERSE_ITERATION 1 )
+endif()
+
if(WIN32)
set(LLVM_HAVE_LINK_VERSION_SCRIPT 0)
if(CYGWIN)
@@ -381,6 +385,9 @@ elseif( LLVM_COMPILER_IS_GCC_COMPATIBLE )
if (LLVM_ENABLE_CXX1Y)
check_cxx_compiler_flag("-std=c++1y" CXX_SUPPORTS_CXX1Y)
append_if(CXX_SUPPORTS_CXX1Y "-std=c++1y" CMAKE_CXX_FLAGS)
+ elseif(LLVM_ENABLE_CXX1Z)
+ check_cxx_compiler_flag("-std=c++1z" CXX_SUPPORTS_CXX1Z)
+ append_if(CXX_SUPPORTS_CXX1Z "-std=c++1z" CMAKE_CXX_FLAGS)
else()
check_cxx_compiler_flag("-std=c++11" CXX_SUPPORTS_CXX11)
if (CXX_SUPPORTS_CXX11)
@@ -635,6 +642,9 @@ if(LLVM_USE_SANITIZER)
append_common_sanitizer_flags()
append("-fsanitize=address,undefined -fno-sanitize=vptr,function -fno-sanitize-recover=all"
CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+ elseif (LLVM_USE_SANITIZER STREQUAL "Leaks")
+ append_common_sanitizer_flags()
+ append("-fsanitize=leak" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
else()
message(FATAL_ERROR "Unsupported value of LLVM_USE_SANITIZER: ${LLVM_USE_SANITIZER}")
endif()
@@ -30,16 +30,26 @@ function(tablegen project ofn)
endif()
endif()
+ # We need both _TABLEGEN_TARGET and _TABLEGEN_EXE in the DEPENDS list
+ # (both the target and the file) to have .inc files rebuilt on
+ # a tablegen change, as cmake does not propagate file-level dependencies
+ # of custom targets. See the following ticket for more information:
+ # https://cmake.org/Bug/view.php?id=15858
+ # The dependency on both, the target and the file, produces the same
+ # dependency twice in the result file when
+ # ("${${project}_TABLEGEN_TARGET}" STREQUAL "${${project}_TABLEGEN_EXE}")
+ # but lets us having smaller and cleaner code here.
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
# Generate tablegen output in a temporary file.
COMMAND ${${project}_TABLEGEN_EXE} ${ARGN} -I ${CMAKE_CURRENT_SOURCE_DIR}
- ${LLVM_TABLEGEN_FLAGS}
+ ${LLVM_TABLEGEN_FLAGS}
${LLVM_TARGET_DEFINITIONS_ABSOLUTE}
-o ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
# The file in LLVM_TARGET_DEFINITIONS may be not in the current
# directory and local_tds may not contain it, so we must
# explicitly list it here:
- DEPENDS ${${project}_TABLEGEN_TARGET} ${local_tds} ${global_tds}
+ DEPENDS ${${project}_TABLEGEN_TARGET} ${${project}_TABLEGEN_EXE}
+ ${local_tds} ${global_tds}
${LLVM_TARGET_DEFINITIONS_ABSOLUTE}
COMMENT "Building ${ofn}..."
)
@@ -94,7 +104,8 @@ macro(add_tablegen target project)
set(${target}_OLD_LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS})
set(LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS} TableGen)
- if(NOT XCODE)
+ # CMake-3.9 doesn't let compilation units depend on their dependent libraries.
+ if(NOT (CMAKE_GENERATOR STREQUAL "Ninja" AND NOT CMAKE_VERSION VERSION_LESS 3.9) AND NOT XCODE)
# FIXME: It leaks to user, callee of add_tablegen.
set(LLVM_ENABLE_OBJLIB ON)
endif()
Oops, something went wrong.

0 comments on commit 8fa03b9

Please sign in to comment.