Skip to content

Commit 4e34cbd

Browse files
committed
---
yaml --- r: 294143 b: refs/heads/tensorflow c: 90d9721 h: refs/heads/master i: 294141: 22145bd 294139: 1095797 294135: 5470eb9 294127: 3772ca4 294111: 7e336a0 294079: 386fd99 294015: 3666438 293887: bed83aa
1 parent 24d0c12 commit 4e34cbd

File tree

257 files changed

+1678
-3938
lines changed

Some content is hidden

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

257 files changed

+1678
-3938
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-04-25-a: 22f738a831d43aff2b9c9773bcb65
816816
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-05-08-a: 7d98cc16689baba5c8a3b90a9329bdcc1a12b4e9
817817
refs/heads/cherr42: a566ad54b073c2c56ac0a705d0a5bed9743135a5
818818
"refs/heads/codable_test_comment_fix": fc8f6824f7f347e1e8db55bff62db385c5728b5a
819-
refs/heads/tensorflow: de4ebd33bed70887b598b28538c29be001b7c8f6
819+
refs/heads/tensorflow: 90d972147391df8b1b21ecacc0b0b5160b1ac114
820820
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-11-a: 8126fd7a652e2f70ad6d76505239e34fb2ef3e1a
821821
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-12-a: b3fd3dd84df6717f2e2e9df58c6d7e99fed57086
822822
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-13-a: 71135119579039dc321c5f65d870050fe36efda2

branches/tensorflow/CMakeLists.txt

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,6 @@ option(SWIFT_INCLUDE_DOCS
9393
"Create targets for building docs."
9494
TRUE)
9595

96-
set(_swift_include_apinotes_default FALSE)
97-
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
98-
set(_swift_include_apinotes_default TRUE)
99-
endif()
100-
101-
option(SWIFT_INCLUDE_APINOTES
102-
"Create targets for installing the remaining apinotes in the built toolchain."
103-
${_swift_include_apinotes_default})
104-
10596
#
10697
# Miscellaneous User-configurable options.
10798
#
@@ -1049,12 +1040,14 @@ endif()
10491040
# created. This then will cause SwiftSyntax to fail to build.
10501041
#
10511042
# https://bugs.swift.org/browse/SR-5975
1052-
if(SWIFT_BUILD_STDLIB)
1053-
add_subdirectory(stdlib)
1054-
endif()
1043+
add_subdirectory(stdlib)
10551044

1056-
if(SWIFT_INCLUDE_APINOTES)
1057-
add_subdirectory(apinotes)
1045+
if(SWIFT_BUILD_SDK_OVERLAY)
1046+
list_intersect("${SWIFT_APPLE_PLATFORMS}" "${SWIFT_SDKS}"
1047+
building_darwin_sdks)
1048+
if(building_darwin_sdks)
1049+
add_subdirectory(apinotes)
1050+
endif()
10581051
endif()
10591052

10601053
add_subdirectory(include)

branches/tensorflow/apinotes/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,15 @@ add_custom_command(
2323
COMMAND
2424
"${CMAKE_COMMAND}" "-E" "copy_if_different" ${inputs} "${output_dir}/")
2525

26-
add_custom_target("copy_apinotes" ALL
26+
add_custom_target("copy_apinotes"
2727
DEPENDS "${outputs}" "${output_dir}"
2828
COMMENT "Copying API notes to ${output_dir}"
2929
SOURCES "${sources}")
3030

31+
# This is treated as an OPTIONAL target because if we don't build the SDK
32+
# overlay, the files will be missing anyway. It also allows us to build
33+
# single overlays without installing the API notes.
3134
swift_install_in_component(DIRECTORY "${output_dir}"
3235
DESTINATION "lib/swift/"
33-
COMPONENT compiler)
36+
COMPONENT sdk-overlay
37+
OPTIONAL)

branches/tensorflow/benchmark/single-source/ExistentialPerformance.swift

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,17 @@ func caRef1() { ca(Ref1.self) }
264264
func caRef2() { ca(Ref2.self) }
265265
func caRef3() { ca(Ref3.self) }
266266
func caRef4() { ca(Ref4.self) }
267+
@inline(never)
268+
func grabArray() -> [Existential] { // transfer array ownership to caller
269+
// FIXME: This is causing Illegal Instruction: 4 crash
270+
// defer { array = nil }
271+
// return array
272+
// This doesn't work either:
273+
// let a = array!
274+
// array = nil
275+
// return a
276+
return array!
277+
}
267278

268279
// `setUpFunctions` that determine which existential type will be tested
269280
var existentialType: Existential.Type!
@@ -529,7 +540,7 @@ func run_Array_init(_ N: Int) {
529540
}
530541

531542
func run_Array_method1x(_ N: Int) {
532-
let existentialArray = array!
543+
let existentialArray = grabArray()
533544
for _ in 0 ..< N * 100 {
534545
for elt in existentialArray {
535546
if !elt.doIt() {
@@ -540,7 +551,7 @@ func run_Array_method1x(_ N: Int) {
540551
}
541552

542553
func run_Array_method2x(_ N: Int) {
543-
let existentialArray = array!
554+
let existentialArray = grabArray()
544555
for _ in 0 ..< N * 100 {
545556
for elt in existentialArray {
546557
if !elt.doIt() || !elt.reallyDoIt() {
@@ -551,8 +562,8 @@ func run_Array_method2x(_ N: Int) {
551562
}
552563

553564
func run_ArrayMutating(_ N: Int) {
554-
var existentialArray = array!
555-
for _ in 0 ..< N * 500 {
565+
var existentialArray = grabArray()
566+
for _ in 0 ..< N * 100 {
556567
for i in 0 ..< existentialArray.count {
557568
if !existentialArray[i].mutateIt() {
558569
fatalError("expected true")
@@ -562,7 +573,7 @@ func run_ArrayMutating(_ N: Int) {
562573
}
563574

564575
func run_ArrayShift(_ N: Int) {
565-
var existentialArray = array!
576+
var existentialArray = grabArray()
566577
for _ in 0 ..< N * 25 {
567578
for i in 0 ..< existentialArray.count-1 {
568579
existentialArray.swapAt(i, i+1)
@@ -571,7 +582,7 @@ func run_ArrayShift(_ N: Int) {
571582
}
572583

573584
func run_ArrayConditionalShift(_ N: Int) {
574-
var existentialArray = array!
585+
var existentialArray = grabArray()
575586
for _ in 0 ..< N * 25 {
576587
for i in 0 ..< existentialArray.count-1 {
577588
let curr = existentialArray[i]

branches/tensorflow/benchmark/single-source/ExistentialPerformance.swift.gyb

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ Setup = """
3636
let existential = existentialType.init()
3737
let existential2 = existentialType.init()
3838
var existential = existentialType.init()
39-
let existentialArray = array!
40-
var existentialArray = array!
39+
let existentialArray = grabArray()
40+
var existentialArray = grabArray()
4141
""".splitlines()
4242
Setup = [Setup[0], Setup[1], '\n'.join(Setup[1:3]), Setup[3], Setup[4], Setup[5]]
4343

@@ -90,7 +90,7 @@ Workloads = [
9090
}
9191
}
9292
"""),
93-
('Array.Mutating', Setup[5], '500', """
93+
('Array.Mutating', Setup[5], '100', """
9494
for i in 0 ..< existentialArray.count {
9595
if !existentialArray[i].mutateIt() {
9696
fatalError("expected true")
@@ -151,6 +151,17 @@ func ca<T: Existential>(_: T.Type) {
151151
% for Variant in Vals + Refs:
152152
func ca${Variant}() { ca(${Variant}.self) }
153153
% end
154+
@inline(never)
155+
func grabArray() -> [Existential] { // transfer array ownership to caller
156+
// FIXME: This is causing Illegal Instruction: 4 crash
157+
// defer { array = nil }
158+
// return array
159+
// This doesn't work either:
160+
// let a = array!
161+
// array = nil
162+
// return a
163+
return array!
164+
}
154165

155166
// `setUpFunctions` that determine which existential type will be tested
156167
var existentialType: Existential.Type!

branches/tensorflow/cmake/modules/AddSwift.cmake

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ endfunction()
642642
# [LINK_LIBRARIES dep1 ...]
643643
# [FRAMEWORK_DEPENDS dep1 ...]
644644
# [FRAMEWORK_DEPENDS_WEAK dep1 ...]
645-
# [LLVM_LINK_COMPONENTS comp1 ...]
645+
# [LLVM_COMPONENT_DEPENDS comp1 ...]
646646
# [C_COMPILE_FLAGS flag1...]
647647
# [SWIFT_COMPILE_FLAGS flag1...]
648648
# [LINK_FLAGS flag1...]
@@ -688,7 +688,7 @@ endfunction()
688688
# FRAMEWORK_DEPENDS_WEAK
689689
# System frameworks this library depends on that should be weakly-linked.
690690
#
691-
# LLVM_LINK_COMPONENTS
691+
# LLVM_COMPONENT_DEPENDS
692692
# LLVM components this library depends on.
693693
#
694694
# C_COMPILE_FLAGS
@@ -750,9 +750,10 @@ function(_add_swift_library_single target name)
750750
GYB_SOURCES
751751
INCORPORATE_OBJECT_LIBRARIES
752752
INCORPORATE_OBJECT_LIBRARIES_SHARED_ONLY
753+
INTERFACE_LINK_LIBRARIES
753754
LINK_FLAGS
754755
LINK_LIBRARIES
755-
LLVM_LINK_COMPONENTS
756+
LLVM_COMPONENT_DEPENDS
756757
PRIVATE_LINK_LIBRARIES
757758
SWIFT_COMPILE_FLAGS)
758759

@@ -891,6 +892,7 @@ function(_add_swift_library_single target name)
891892
${SWIFTLIB_SINGLE_DEPENDS}
892893
${SWIFTLIB_SINGLE_FILE_DEPENDS}
893894
${SWIFTLIB_SINGLE_LINK_LIBRARIES}
895+
${SWIFTLIB_SINGLE_INTERFACE_LINK_LIBRARIES}
894896
SDK ${SWIFTLIB_SINGLE_SDK}
895897
ARCHITECTURE ${SWIFTLIB_SINGLE_ARCHITECTURE}
896898
MODULE_NAME ${module_name}
@@ -1188,7 +1190,7 @@ function(_add_swift_library_single target name)
11881190

11891191
if(NOT SWIFTLIB_SINGLE_TARGET_LIBRARY)
11901192
# Call llvm_config() only for libraries that are part of the compiler.
1191-
swift_common_llvm_config("${target}" ${SWIFTLIB_SINGLE_LLVM_LINK_COMPONENTS})
1193+
swift_common_llvm_config("${target}" ${SWIFTLIB_SINGLE_LLVM_COMPONENT_DEPENDS})
11921194
endif()
11931195

11941196
# Collect compile and link flags for the static and non-static targets.
@@ -1311,7 +1313,7 @@ function(_add_swift_library_single target name)
13111313
# import library targets when the library was added. Use that to adjust the
13121314
# link libraries.
13131315
if(SWIFTLIB_SINGLE_SDK STREQUAL WINDOWS AND NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
1314-
foreach(library_list LINK_LIBRARIES PRIVATE_LINK_LIBRARIES)
1316+
foreach(library_list LINK_LIBRARIES INTERFACE_LINK_LIBRARIES PRIVATE_LINK_LIBRARIES)
13151317
set(import_libraries)
13161318
foreach(library ${SWIFTLIB_SINGLE_${library_list}})
13171319
# Ensure that the library is a target. If an absolute path was given,
@@ -1340,6 +1342,14 @@ function(_add_swift_library_single target name)
13401342
target_link_libraries("${target}" PRIVATE
13411343
${SWIFTLIB_SINGLE_PRIVATE_LINK_LIBRARIES})
13421344
endif()
1345+
if("${libkind}" STREQUAL "OBJECT")
1346+
precondition_list_empty(
1347+
"${SWIFTLIB_SINGLE_INTERFACE_LINK_LIBRARIES}"
1348+
"OBJECT_LIBRARY may not link to anything")
1349+
else()
1350+
target_link_libraries("${target}" INTERFACE
1351+
${SWIFTLIB_SINGLE_INTERFACE_LINK_LIBRARIES})
1352+
endif()
13431353

13441354
set_property(TARGET "${target}" PROPERTY
13451355
LINKER_LANGUAGE "CXX")
@@ -1366,7 +1376,7 @@ endfunction()
13661376
# add_swift_host_library(name
13671377
# [SHARED]
13681378
# [STATIC]
1369-
# [LLVM_LINK_COMPONENTS comp1 ...]
1379+
# [LLVM_COMPONENT_DEPENDS comp1 ...]
13701380
# [FILE_DEPENDS target1 ...]
13711381
# source1 [source2 source3 ...])
13721382
#
@@ -1379,7 +1389,7 @@ endfunction()
13791389
# STATIC
13801390
# Build a static library.
13811391
#
1382-
# LLVM_LINK_COMPONENTS
1392+
# LLVM_COMPONENT_DEPENDS
13831393
# LLVM components this library depends on.
13841394
#
13851395
# FILE_DEPENDS
@@ -1397,8 +1407,9 @@ function(add_swift_host_library name)
13971407
C_COMPILE_FLAGS
13981408
DEPENDS
13991409
FILE_DEPENDS
1410+
INTERFACE_LINK_LIBRARIES
14001411
LINK_LIBRARIES
1401-
LLVM_LINK_COMPONENTS)
1412+
LLVM_COMPONENT_DEPENDS)
14021413

14031414
cmake_parse_arguments(ASHL
14041415
"${options}"
@@ -1413,6 +1424,9 @@ function(add_swift_host_library name)
14131424
if(ASHL_DEPENDS)
14141425
message(SEND_ERROR "library ${name} is using DEPENDS parameter which is deprecated. Please use add_dependencies instead")
14151426
endif()
1427+
if(ASHL_INTERFACE_LINK_LIBRARIES)
1428+
message(SEND_ERROR "library ${name} is using INTERFACE_LINK_LIBRARIES parameter which is deprecated. Please use target_link_libraries instead.")
1429+
endif()
14161430
if(ASHL_LINK_LIBRARIES)
14171431
message(SEND_ERROR "library ${name} is using LINK_LIBRARIES parameter which is deprecated. Please use target_link_libraries instead")
14181432
endif()
@@ -1432,7 +1446,7 @@ function(add_swift_host_library name)
14321446
${ASHL_FORCE_BUILD_OPTIMIZED_keyword}
14331447
SDK ${SWIFT_HOST_VARIANT_SDK}
14341448
ARCHITECTURE ${SWIFT_HOST_VARIANT_ARCH}
1435-
LLVM_LINK_COMPONENTS ${ASHL_LLVM_LINK_COMPONENTS}
1449+
LLVM_COMPONENT_DEPENDS ${ASHL_LLVM_COMPONENT_DEPENDS}
14361450
FILE_DEPENDS ${ASHL_FILE_DEPENDS}
14371451
INSTALL_IN_COMPONENT "dev"
14381452
)
@@ -1464,10 +1478,11 @@ endfunction()
14641478
# [STATIC]
14651479
# [DEPENDS dep1 ...]
14661480
# [LINK_LIBRARIES dep1 ...]
1481+
# [INTERFACE_LINK_LIBRARIES dep1 ...]
14671482
# [SWIFT_MODULE_DEPENDS dep1 ...]
14681483
# [FRAMEWORK_DEPENDS dep1 ...]
14691484
# [FRAMEWORK_DEPENDS_WEAK dep1 ...]
1470-
# [LLVM_LINK_COMPONENTS comp1 ...]
1485+
# [LLVM_COMPONENT_DEPENDS comp1 ...]
14711486
# [FILE_DEPENDS target1 ...]
14721487
# [TARGET_SDKS sdk1...]
14731488
# [C_COMPILE_FLAGS flag1...]
@@ -1533,7 +1548,7 @@ endfunction()
15331548
# FRAMEWORK_DEPENDS_WEAK
15341549
# System frameworks this library depends on that should be weak-linked
15351550
#
1536-
# LLVM_LINK_COMPONENTS
1551+
# LLVM_COMPONENT_DEPENDS
15371552
# LLVM components this library depends on.
15381553
#
15391554
# FILE_DEPENDS
@@ -1616,9 +1631,10 @@ function(add_swift_target_library name)
16161631
GYB_SOURCES
16171632
INCORPORATE_OBJECT_LIBRARIES
16181633
INCORPORATE_OBJECT_LIBRARIES_SHARED_ONLY
1634+
INTERFACE_LINK_LIBRARIES
16191635
LINK_FLAGS
16201636
LINK_LIBRARIES
1621-
LLVM_LINK_COMPONENTS
1637+
LLVM_COMPONENT_DEPENDS
16221638
PRIVATE_LINK_LIBRARIES
16231639
SWIFT_COMPILE_FLAGS
16241640
SWIFT_COMPILE_FLAGS_IOS
@@ -1890,7 +1906,7 @@ function(add_swift_target_library name)
18901906
LINK_LIBRARIES ${swiftlib_link_libraries}
18911907
FRAMEWORK_DEPENDS ${swiftlib_framework_depends_flattened}
18921908
FRAMEWORK_DEPENDS_WEAK ${SWIFTLIB_FRAMEWORK_DEPENDS_WEAK}
1893-
LLVM_LINK_COMPONENTS ${SWIFTLIB_LLVM_LINK_COMPONENTS}
1909+
LLVM_COMPONENT_DEPENDS ${SWIFTLIB_LLVM_COMPONENT_DEPENDS}
18941910
FILE_DEPENDS ${SWIFTLIB_FILE_DEPENDS} ${swiftlib_module_dependency_targets}
18951911
C_COMPILE_FLAGS ${swiftlib_c_compile_flags_all}
18961912
SWIFT_COMPILE_FLAGS ${swiftlib_swift_compile_flags_all} ${swiftlib_swift_compile_flags_arch} ${swiftlib_swift_compile_private_frameworks_flag}
@@ -2106,7 +2122,7 @@ function(_add_swift_executable_single name)
21062122
cmake_parse_arguments(SWIFTEXE_SINGLE
21072123
"EXCLUDE_FROM_ALL"
21082124
"SDK;ARCHITECTURE"
2109-
"DEPENDS;LLVM_LINK_COMPONENTS;LINK_LIBRARIES;COMPILE_FLAGS"
2125+
"DEPENDS;LLVM_COMPONENT_DEPENDS;LINK_LIBRARIES;COMPILE_FLAGS"
21102126
${ARGN})
21112127

21122128
set(SWIFTEXE_SINGLE_SOURCES ${SWIFTEXE_SINGLE_UNPARSED_ARGUMENTS})
@@ -2207,7 +2223,7 @@ function(_add_swift_executable_single name)
22072223
LIBRARY_DIR ${SWIFT_LIBRARY_OUTPUT_INTDIR})
22082224

22092225
target_link_libraries("${name}" PRIVATE ${SWIFTEXE_SINGLE_LINK_LIBRARIES})
2210-
swift_common_llvm_config("${name}" ${SWIFTEXE_SINGLE_LLVM_LINK_COMPONENTS})
2226+
swift_common_llvm_config("${name}" ${SWIFTEXE_SINGLE_LLVM_COMPONENT_DEPENDS})
22112227

22122228
set_target_properties(${name} PROPERTIES FOLDER "Swift executables")
22132229
endfunction()

branches/tensorflow/docs/archive/TuplesAsArguments.md

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)