Skip to content

Commit e510e48

Browse files
author
Harlan Haskins
authored
---
yaml --- r: 270303 b: refs/heads/tensorflow-merge c: b29f1ee h: refs/heads/master i: 270301: 223576a 270299: 44a61a8 270295: 8057901 270287: 06d29ed 270271: bf8c1c3
1 parent eebb545 commit e510e48

File tree

99 files changed

+1305
-879
lines changed

Some content is hidden

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

99 files changed

+1305
-879
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1128,4 +1128,4 @@ refs/tags/swift-4.2.1-RELEASE: 02a6ca969ea1387475b6caeb69c31186df7d30b6
11281128
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-11-01-a: 3b0299288f8287094b9ef587f46df54f42a347af
11291129
refs/heads/5.0-add-libcxx-and-clang-tools-extra: eb6e6f9b0a551e7804e96d0dac83add11ec73977
11301130
refs/heads/Fix-DataCreateSmall: e15aff31b7406a5b2dadac9d7810941cec85035a
1131-
refs/heads/tensorflow-merge: 121f15b2ac2968f8fb212d63d8562c1d85e277b3
1131+
refs/heads/tensorflow-merge: b29f1ee1a26b6fe1d68bece094d3f962d44b4370

branches/tensorflow-merge/cmake/modules/SwiftSharedCMakeConfig.cmake

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ macro(swift_common_standalone_build_config_llvm product is_cross_compiling)
77
precondition_translate_flag(${product}_PATH_TO_LLVM_SOURCE PATH_TO_LLVM_SOURCE)
88
precondition_translate_flag(${product}_PATH_TO_LLVM_BUILD PATH_TO_LLVM_BUILD)
99

10+
file(TO_CMAKE_PATH "${PATH_TO_LLVM_BUILD}" PATH_TO_LLVM_BUILD)
11+
1012
set(SWIFT_LLVM_CMAKE_PATHS
1113
"${PATH_TO_LLVM_BUILD}/share/llvm/cmake"
1214
"${PATH_TO_LLVM_BUILD}/lib/cmake/llvm")
@@ -139,6 +141,9 @@ macro(swift_common_standalone_build_config_clang product is_cross_compiling)
139141
set(PATH_TO_CLANG_SOURCE "${${product}_PATH_TO_CLANG_SOURCE}")
140142
set(PATH_TO_CLANG_BUILD "${${product}_PATH_TO_CLANG_BUILD}")
141143

144+
file(TO_CMAKE_PATH "${PATH_TO_CLANG_SOURCE}" PATH_TO_CLANG_SOURCE)
145+
file(TO_CMAKE_PATH "${PATH_TO_CLANG_BUILD}" PATH_TO_CLANG_BUILD)
146+
142147
# Add all Clang CMake paths to our cmake module path.
143148
set(SWIFT_CLANG_CMAKE_PATHS
144149
"${PATH_TO_CLANG_BUILD}/share/clang/cmake"
@@ -188,12 +193,17 @@ macro(swift_common_standalone_build_config_cmark product)
188193
ABSOLUTE)
189194
get_filename_component(CMARK_LIBRARY_DIR "${${product}_CMARK_LIBRARY_DIR}"
190195
ABSOLUTE)
196+
191197
set(CMARK_MAIN_INCLUDE_DIR "${CMARK_MAIN_SRC_DIR}/src")
192198
set(CMARK_BUILD_INCLUDE_DIR "${PATH_TO_CMARK_BUILD}/src")
199+
200+
file(TO_CMAKE_PATH "${CMARK_MAIN_INCLUDE_DIR}" CMARK_MAIN_INCLUDE_DIR)
201+
file(TO_CMAKE_PATH "${CMARK_BUILD_INCLUDE_DIR}" CMARK_BUILD_INCLUDE_DIR)
202+
193203
include_directories("${CMARK_MAIN_INCLUDE_DIR}"
194204
"${CMARK_BUILD_INCLUDE_DIR}")
195205

196-
include(${${product}_PATH_TO_CMARK_BUILD}/src/CMarkExports.cmake)
206+
include(${PATH_TO_CMARK_BUILD}/src/CMarkExports.cmake)
197207
add_definitions(-DCMARK_STATIC_DEFINE)
198208
endmacro()
199209

branches/tensorflow-merge/docs/ByteTree.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@ For example, the string "Hello World" would be encoded as `(uint32_t)11` `"Hello
1313

1414
## Serialization of objects
1515

16-
An object consists of its size, measured in the number of fields and represented as a `uint_32t` in little endian order, followed by the direct concatenation of its fields. Because each field is again prefixed with its size, no delimites are necessary in between the fields.
16+
An object consists of its size, measured in the number of fields and represented as a `uint_32t` in little endian order, followed by the direct concatenation of its fields. Because each field is again prefixed with its size, no delimits are necessary in between the fields.
1717

18-
To distinguish scalars and objects, the size of objects has its most-siginificant bit set to 1. It must be ignored to retrieve the number of fields in the object.
18+
To distinguish scalars and objects, the size of objects has its most-significant bit set to 1. It must be ignored to retrieve the number of fields in the object.
1919

2020
Arrays are modelled as objects whose fields are all of the same type and whose length is variadic (and is indicated by the object's size).
2121

2222
## Versioning
2323

24-
The ByteTree format is prepended by a 4-byte protocol version number that describes the version of the object tree that was serialized. Its exact semantics are up to each specific application, but it is encouraged to interpret it as a two-comentent number where the first component, consisting of the three most significant bytes, is incremented for breaking changes and the last byte is incremented for backwards-compatible changes.
24+
The ByteTree format is prepended by a 4-byte protocol version number that describes the version of the object tree that was serialized. Its exact semantics are up to each specific application, but it is encouraged to interpret it as a two-component number where the first component, consisting of the three most significant bytes, is incremented for breaking changes and the last byte is incremented for backwards-compatible changes.
2525

26-
## Forward compatilibity
26+
## Forward compatibility
2727

2828
Fields may be added to the end of objects in a backwards compatible manner (older deserialisers will still be able to deserialise the format). It does so by skipping over all fields that are not read during deserialisation. Newer versions of the deserialiser can detect if recently added fields are not present in the serialised data by inspecting the `numFields` property passed during deserialisation.
2929

3030
## Serialization safety
3131

32-
Since all fields in objects are accessed by their index, issues quickly arise if a new field is accidentally added at the beginning of an object. To prevent issues like this, the ByteTree serialiser and deserialiser requires the explicit specification of each field's index within the object. These indicies are never serialised. Their sole purpose is to check that all fields are read in the correct order in assertion builds.
32+
Since all fields in objects are accessed by their index, issues quickly arise if a new field is accidentally added at the beginning of an object. To prevent issues like this, the ByteTree serialiser and deserialiser requires the explicit specification of each field's index within the object. These indices are never serialised. Their sole purpose is to check that all fields are read in the correct order in assertion builds.

branches/tensorflow-merge/docs/CompilerPerformance.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ files in `<directory>`.
695695
696696
This option also provides _some_ high-level counters that are "always available"
697697
regardless of whether you're using an assert or release build, though assert
698-
builds still get _more_ counters (all of those available thorugh
698+
builds still get _more_ counters (all of those available through
699699
`-print-stats`). If you are using a new-enough compiler, `-stats-output-dir`
700700
often simplifies analysis, since its output is machine-readable and aggregates
701701
all the jobs in a multi-job compilation, and there's a post-processing script
@@ -1322,7 +1322,7 @@ internals of the compiler, just time and patience.
13221322
13231323
- Add Open Source projects to the
13241324
[source-compatibility testsuite](https://swift.org/source-compatibility/).
1325-
Apple's internal CI infastructure is now tracking selected non-assert-build
1325+
Apple's internal CI infrastructure is now tracking selected non-assert-build
13261326
`UnifiedStatsReporter` counters on those projects, and the team is far
13271327
more likely to catch a regression if it's shown by a project in the testsuite.
13281328

branches/tensorflow-merge/docs/Random.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ following implementation details:
1313
- Linux, FreeBSD, and other UNIX-like platforms use `getrandom(2)` when available;
1414
otherwise, they read from `/dev/urandom`.
1515
- Fuchsia platforms use `getentropy(3)`.
16-
- Windows paltforms use `BCryptGenRandom`.
16+
- Windows platforms use `BCryptGenRandom`.

branches/tensorflow-merge/docs/SIL.rst

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,7 @@ Linkage
984984
sil-linkage ::= 'private'
985985
sil-linkage ::= 'public_external'
986986
sil-linkage ::= 'hidden_external'
987+
sil-linkage ::= 'non_abi'
987988

988989
A linkage specifier controls the situations in which two objects in
989990
different SIL modules are *linked*, i.e. treated as the same object.
@@ -1048,6 +1049,25 @@ not needed.
10481049
If an object has any uses, then it must be linked to a definition
10491050
with non-external linkage.
10501051

1052+
Public non-ABI linkage
1053+
``````````````````````
1054+
1055+
The `non_abi` linkage is a special linkage used for definitions which
1056+
only exist in serialized SIL, and do not define visible symbols in the
1057+
object file.
1058+
1059+
A definition with `non_abi` linkage behaves like it has `shared` linkage,
1060+
except that it must be serialized in the SIL module even if not referenced
1061+
from anywhere else in the module. For example, this means it is considered
1062+
a root for dead function elimination.
1063+
1064+
When a `non_abi` definition is deserialized, it will have `shared_external`
1065+
linkage.
1066+
1067+
There is no `non_abi_external` linkage. Instead, when referencing a
1068+
`non_abi` declaration that is defined in a different translation unit from
1069+
the same Swift module, you must use `hidden_external` linkage.
1070+
10511071
Summary
10521072
```````
10531073

@@ -4750,7 +4770,7 @@ A ``convert_escape_to_noescape [not_guaranteed] %opd`` indicates that the
47504770
lifetime of its operand was not guaranteed by SILGen and a mandatory pass must
47514771
be run to ensure the lifetime of ``%opd``` for the conversion's uses.
47524772

4753-
A ``convert_escape_to_noescape [escaped]`` indiciates that the result was
4773+
A ``convert_escape_to_noescape [escaped]`` indicates that the result was
47544774
passed to a function (materializeForSet) which escapes the closure in a way not
47554775
expressed by the convert's users. The mandatory pass must ensure the lifetime
47564776
in a conservative way.

branches/tensorflow-merge/docs/SILProgrammersManual.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ TBD: Possibly link to a separate document explaining the architecture of IRGen.
172172
## SILAnalysis and the PassManager
173173

174174
TBD: describe the mechanism by which passes invalidate and update the
175-
PassManager and its avaiable analyses.
175+
PassManager and its available analyses.
176176

177177
## High Level SIL Optimizations
178178

branches/tensorflow-merge/docs/Testing.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,23 +56,23 @@ development cycle. To invoke LLVM's `lit.py` script directly, it must be
5656
configured to use your local build directory. For example:
5757

5858
```
59-
% ${LLVM_SOURCE_ROOT}/utils/lit/lit.py -sv ${SWIFT_BUILD_DIR}/test-iphonesimulator-i386/Parse/
59+
% ${LLVM_SOURCE_ROOT}/utils/lit/lit.py -sv ${SWIFT_BUILD_DIR}/test-macosx-x86_64/Parse/
6060
```
6161

62-
This runs the tests in the 'test/Parse/' directory targeting the 32-bit iOS
63-
Simulator. The ``-sv`` options give you a nice progress bar and only show you
62+
This runs the tests in the 'test/Parse/' directory targeting 64-bit macOS.
63+
The ``-sv`` options give you a nice progress bar and only show you
6464
output from the tests that fail.
6565

6666
One downside of using this form is that you're appending relative paths from
6767
the source directory to the test directory in your build directory. (That is,
6868
there may not actually be a directory named 'Parse' in
69-
'test-iphonesimulator-i386/'; the invocation works because there is one in the
69+
'test-macosx-x86_64/'; the invocation works because there is one in the
7070
source 'test/' directory.) There is a more verbose form that specifies the
7171
testing configuration explicitly, which then allows you to test files
7272
regardless of location.
7373

7474
```
75-
% ${LLVM_SOURCE_ROOT}/utils/lit/lit.py -sv --param swift_site_config=${SWIFT_BUILD_DIR}/test-iphonesimulator-i386/lit.site.cfg ${SWIFT_SOURCE_ROOT}/test/Parse/
75+
% ${LLVM_SOURCE_ROOT}/utils/lit/lit.py -sv --param swift_site_config=${SWIFT_BUILD_DIR}/test-macosx-x86_64/lit.site.cfg ${SWIFT_SOURCE_ROOT}/test/Parse/
7676
```
7777

7878
For more complicated configuration, copy the invocation from one of the build

branches/tensorflow-merge/docs/Windows.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Currently there are three supported ways to build Swift for Windows.
1919
`clang-cl` is recommended over MSVC for building Swift on Windows.
2020
Although it is possible to build the compiler and the standard library with
2121
MSVC to use those built products to compile a Swift program, it won't be
22-
possible to run the binary without seperately obtaining the Swift runtime. On
22+
possible to run the binary without separately obtaining the Swift runtime. On
2323
the other hand, `clang-cl` is able to build the runtime, which makes it
2424
possible to build and run all the components required for Swift natively on
2525
Windows.

branches/tensorflow-merge/docs/WindowsBuild.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,31 @@ it provides some of the needed headers and libraries.
3030
installation.
3131

3232
### 2. Clone the repositories
33+
1. Configure git to work with Unix file endings
3334
1. Create a folder to contain all the Swift repositories
3435
1. Clone `apple/swift-cmark` into a folder named `cmark`
3536
1. Clone `apple/swift-clang` into a folder named `clang`
3637
1. Clone `apple/swift-llvm` into a folder named `llvm`
3738
1. Clone `apple/swift-compiler-rt` into a folder named `compiler-rt`
3839
1. Clone `apple/swift` into a folder named `swift`
3940
1. Clone `apple/swift-corelibs-libdispatch` into a folder named `swift-corelibs-libdispatch`
41+
1. Clone `apple/swift-corelibs-foundation` into a folder name `swift-corelibs-foundation`
42+
4043
- Currently, other repositories in the Swift project have not been tested and
4144
may not be supported.
4245

46+
```cmd
47+
git config --global core.autocrlf input
48+
S:
49+
git clone https://github.com/apple/swift-cmark cmark
50+
git clone https://github.com/apple/swift-clang clang
51+
git clone https://github.com/apple/swift-llvm llvm
52+
git clone https://github.com/apple/swift-compiler-rt compiler-rt
53+
git clone https://github.com/apple/swift
54+
git clone https://github.com/apple/swift-corelibs-libdispatch
55+
git clone https://github.com/apple/swift-corelibs-foundation
56+
```
57+
4358
### 3. Acquire ICU
4459
1. Download ICU from [ICU Project](http://site.icu-project.org) for Windows x64 and extract the binaries.
4560
1. Add the `bin64` folder to your `Path` environment variable.
@@ -186,8 +201,9 @@ Running the testsuite on Windows has additional external dependencies. You must
186201

187202
1. coreutils
188203
2. diffutils
189-
3. grep
190-
4. sed
204+
3. file
205+
4. grep
206+
5. sed
191207

192208
```cmd
193209
ninja -C "S:/build/Ninja-DebugAssert/swift-windows-amd64" check-swift

branches/tensorflow-merge/include/swift/AST/DiagnosticsSema.def

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4103,6 +4103,9 @@ ERROR(inlinable_decl_not_public,
41034103
"but %0 is %select{private|fileprivate|internal|%error|%error}1",
41044104
(DeclBaseName, AccessLevel))
41054105

4106+
ERROR(inlinable_resilient_deinit,
4107+
none, "deinitializer can only be '@inlinable' if the class is '@_fixed_layout'", ())
4108+
41064109
//------------------------------------------------------------------------------
41074110
// MARK: @_specialize diagnostics
41084111
//------------------------------------------------------------------------------

branches/tensorflow-merge/include/swift/Basic/type_traits.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace swift {
3030
/// is not intended to be specialized.
3131
template<typename T>
3232
struct IsTriviallyCopyable {
33-
#if _LIBCPP_VERSION || SWIFT_COMPILER_IS_MSVC
33+
#if defined(_LIBCPP_VERSION) || SWIFT_COMPILER_IS_MSVC
3434
// libc++ and MSVC implement is_trivially_copyable.
3535
static const bool value = std::is_trivially_copyable<T>::value;
3636
#elif __has_feature(is_trivially_copyable) || __GNUC__ >= 5
@@ -42,7 +42,7 @@ struct IsTriviallyCopyable {
4242

4343
template<typename T>
4444
struct IsTriviallyConstructible {
45-
#if _LIBCPP_VERSION || SWIFT_COMPILER_IS_MSVC
45+
#if defined(_LIBCPP_VERSION) || SWIFT_COMPILER_IS_MSVC
4646
// libc++ and MSVC implement is_trivially_constructible.
4747
static const bool value = std::is_trivially_constructible<T>::value;
4848
#elif __has_feature(has_trivial_constructor) || __GNUC__ >= 5
@@ -54,7 +54,7 @@ struct IsTriviallyConstructible {
5454

5555
template<typename T>
5656
struct IsTriviallyDestructible {
57-
#if _LIBCPP_VERSION || SWIFT_COMPILER_IS_MSVC
57+
#if defined(_LIBCPP_VERSION) || SWIFT_COMPILER_IS_MSVC
5858
// libc++ and MSVC implement is_trivially_destructible.
5959
static const bool value = std::is_trivially_destructible<T>::value;
6060
#elif __has_feature(has_trivial_destructor) || __GNUC__ >= 5

branches/tensorflow-merge/include/swift/SIL/SILInstruction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ class SILInstruction
326326
/// Update this instruction's SILDebugScope. This function should
327327
/// never be called directly. Use SILBuilder, SILBuilderWithScope or
328328
/// SILClonerWithScope instead.
329-
void setDebugScope(SILBuilder &B, const SILDebugScope *DS);
329+
void setDebugScope(const SILDebugScope *DS);
330330

331331
/// Total number of created and deleted SILInstructions.
332332
/// It is used only for collecting the compiler statistics.

0 commit comments

Comments
 (0)