Skip to content

Commit be7c9b5

Browse files
Merge pull request #387 from kateinoigakukun/merge/2020-03-13
Merge 2020-03-13
2 parents 71f03fb + cd734d1 commit be7c9b5

File tree

499 files changed

+13011
-3220
lines changed

Some content is hidden

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

499 files changed

+13011
-3220
lines changed

.github/workflows/main.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,12 @@ jobs:
2020
- uses: actions/cache@v1
2121
with:
2222
path: ../build-cache
23-
key: ${{ runner.os }}-sccache-v2
23+
key: ${{ runner.os }}-sccache-v3
2424
- name: Build Linux installable archive
25-
run: ./utils/webassembly/ci.sh
25+
run: |
26+
./utils/webassembly/ci.sh
27+
echo "Cleanup build directory to free disk space"
28+
rm -rf ../build
2629
- name: Upload Linux installable archive
2730
uses: actions/upload-artifact@v1
2831
with:
@@ -47,7 +50,7 @@ jobs:
4750
- uses: actions/cache@v1
4851
with:
4952
path: ../build-cache
50-
key: ${{ runner.os }}-sccache-v2
53+
key: ${{ runner.os }}-sccache-v3
5154
- name: Build macOS installable archive
5255
run: ./utils/webassembly/ci.sh
5356
- name: Upload macOS installable archive

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,6 @@ endif()
477477
include(SwiftComponents)
478478
include(SwiftHandleGybSources)
479479
include(SwiftSetIfArchBitness)
480-
include(SwiftSource)
481480
include(AddSwift)
482481
include(SwiftConfigureSDK)
483482
include(SwiftComponents)

benchmark/cmake/modules/AddSwiftBenchmarkSuite.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ endmacro()
106106

107107
macro(configure_sdks_darwin)
108108
set(macosx_arch "x86_64")
109-
set(iphoneos_arch "arm64" "armv7")
109+
set(iphoneos_arch "arm64" "arm64e" "armv7")
110110
set(appletvos_arch "arm64")
111111
set(watchos_arch "armv7k")
112112

cmake/modules/AddSwift.cmake

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -742,26 +742,18 @@ function(_add_swift_host_library_single target)
742742
# Include LLVM Bitcode slices for iOS, Watch OS, and Apple TV OS device libraries.
743743
if(SWIFT_EMBED_BITCODE_SECTION)
744744
if(${SWIFT_HOST_VARIANT_SDK} MATCHES "(I|TV|WATCH)OS")
745-
# The two branches of this if statement accomplish the same end result
746-
# We are simply accounting for the fact that on CMake < 3.16
747-
# using a generator expression to
748-
# specify a LINKER: argument does not work,
745+
target_link_options(${target} PRIVATE
746+
"LINKER:-bitcode_bundle"
747+
"LINKER:-lto_library,${LLVM_LIBRARY_DIR}/libLTO.dylib")
748+
749+
# Please note that using a generator expression to fit
750+
# this in a single target_link_options does not work
751+
# (at least in CMake 3.15 and 3.16),
749752
# since that seems not to allow the LINKER: prefix to be
750753
# evaluated (i.e. it will be added as-is to the linker parameters)
751-
if(CMAKE_VERSION VERSION_LESS 3.16)
752-
target_link_options(${target} PRIVATE
753-
"LINKER:-bitcode_bundle"
754-
"LINKER:-lto_library,${LLVM_LIBRARY_DIR}/libLTO.dylib")
755-
756-
if(SWIFT_EMBED_BITCODE_SECTION_HIDE_SYMBOLS)
757-
target_link_options(${target} PRIVATE
758-
"LINKER:-bitcode_hide_symbols")
759-
endif()
760-
else()
754+
if(SWIFT_EMBED_BITCODE_SECTION_HIDE_SYMBOLS)
761755
target_link_options(${target} PRIVATE
762-
"LINKER:-bitcode_bundle"
763-
$<$<BOOL:SWIFT_EMBED_BITCODE_SECTION_HIDE_SYMBOLS>:"LINKER:-bitcode_hide_symbols">
764-
"LINKER:-lto_library,${LLVM_LIBRARY_DIR}/libLTO.dylib")
756+
"LINKER:-bitcode_hide_symbols")
765757
endif()
766758
endif()
767759
endif()

cmake/modules/DarwinSDKs.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ option(SWIFT_ENABLE_IOS32
33
TRUE)
44

55
if(SWIFT_ENABLE_IOS32)
6-
set(SUPPORTED_IOS_ARCHS "armv7;armv7s;arm64")
6+
set(SUPPORTED_IOS_ARCHS "armv7;armv7s;arm64;arm64e")
77
set(SUPPORTED_IOS_SIMULATOR_ARCHS "i386;x86_64")
88
else()
9-
set(SUPPORTED_IOS_ARCHS "arm64")
9+
set(SUPPORTED_IOS_ARCHS "arm64;arm64e")
1010
set(SUPPORTED_IOS_SIMULATOR_ARCHS "x86_64")
1111
endif()
1212

cmake/modules/StandaloneOverlay.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ include(SwiftSharedCMakeConfig)
112112
include(AddSwift)
113113
include(SwiftHandleGybSources)
114114
include(SwiftConfigureSDK)
115-
include(SwiftSource)
116115
include(SwiftComponents)
117116
include(DarwinSDKs)
118117

cmake/modules/SwiftSetIfArchBitness.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ function(set_if_arch_bitness var_name)
1717
set("${var_name}" "${SIA_CASE_32_BIT}" PARENT_SCOPE)
1818
elseif("${SIA_ARCH}" STREQUAL "x86_64" OR
1919
"${SIA_ARCH}" STREQUAL "arm64" OR
20+
"${SIA_ARCH}" STREQUAL "arm64e" OR
2021
"${SIA_ARCH}" STREQUAL "aarch64" OR
2122
"${SIA_ARCH}" STREQUAL "powerpc64" OR
2223
"${SIA_ARCH}" STREQUAL "powerpc64le" OR

docs/ABI/Mangling.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -583,10 +583,12 @@ mangled in to disambiguate.
583583
::
584584

585585
impl-function-type ::= type* 'I' FUNC-ATTRIBUTES '_'
586-
impl-function-type ::= type* generic-signature 'I' PSEUDO-GENERIC? FUNC-ATTRIBUTES '_'
586+
impl-function-type ::= type* generic-signature 'I' FUNC-ATTRIBUTES '_'
587587

588-
FUNC-ATTRIBUTES ::= CALLEE-ESCAPE? CALLEE-CONVENTION FUNC-REPRESENTATION? COROUTINE-KIND? PARAM-CONVENTION* RESULT-CONVENTION* ('Y' PARAM-CONVENTION)* ('z' RESULT-CONVENTION)?
588+
FUNC-ATTRIBUTES ::= PATTERN-SUBS? INVOCATION-SUBS? PSEUDO-GENERIC? CALLEE-ESCAPE? CALLEE-CONVENTION FUNC-REPRESENTATION? COROUTINE-KIND? PARAM-CONVENTION* RESULT-CONVENTION* ('Y' PARAM-CONVENTION)* ('z' RESULT-CONVENTION)?
589589

590+
PATTERN-SUBS ::= 's' // has pattern substitutions
591+
INVOCATION-SUB ::= 'I' // has invocation substitutions
590592
PSEUDO-GENERIC ::= 'P'
591593

592594
CALLEE-ESCAPE ::= 'e' // @escaping (inverse of SIL @noescape)

docs/SIL.rst

Lines changed: 170 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,46 @@ autorelease in the callee.
592592
importer only imports non-native methods and types as ``throws``
593593
when it is possible to do this automatically.
594594

595+
- SIL function types may provide a pattern signature and substitutions
596+
to express that values of the type use a particular generic abstraction
597+
pattern. Both must be provided together. If a pattern signature is
598+
present, the component types (parameters, yields, and results) must be
599+
expressed in terms of the generic parameters of that signature.
600+
The pattern substitutions should be expressed in terms of the generic
601+
parameters of the overall generic signature, if any, or else
602+
the enclosing generic context, if any.
603+
604+
A pattern signature follows the ``@substituted`` attribute, which
605+
must be the final attribute preceding the function type. Pattern
606+
substitutions follow the function type, preceded by the ``for``
607+
keyword. For example::
608+
609+
@substituted <T: Collection> (@in T) -> @out T.Element for Array<Int>
610+
611+
The low-level representation of a value of this type may not match
612+
the representation of a value of the substituted-through version of it::
613+
614+
(@in Array<Int>) -> @out Int
615+
616+
Substitution differences at the outermost level of a function value
617+
may be adjusted using the ``convert_function`` instruction. Note that
618+
this only works at the outermost level and not in nested positions.
619+
For example, a function which takes a parameter of the first type above
620+
cannot be converted by ``convert_function`` to a function which takes
621+
a parameter of the second type; such a conversion must be done with a
622+
thunk.
623+
624+
Type substitution on a function type with a pattern signature and
625+
substitutions only substitutes into the substitutions; the component
626+
types are preserved with their exact original structure.
627+
628+
- In the implementation, a SIL function type may also carry substitutions
629+
for its generic signature. This is a convenience for working with
630+
applied generic types and is not generally a formal part of the SIL
631+
language; in particular, values should not have such types. Such a
632+
type behaves like a non-generic type, as if the substitutions were
633+
actually applied to the underlying function type.
634+
595635
Coroutine Types
596636
```````````````
597637

@@ -815,7 +855,8 @@ Functions
815855
::
816856

817857
decl ::= sil-function
818-
sil-function ::= 'sil' sil-linkage? sil-function-name ':' sil-type
858+
sil-function ::= 'sil' sil-linkage? sil-function-attribute+
859+
sil-function-name ':' sil-type
819860
'{' sil-basic-block+ '}'
820861
sil-function-name ::= '@' [A-Za-z_0-9]+
821862

@@ -827,6 +868,134 @@ The ``sil`` syntax declares the function's name and SIL type, and
827868
defines the body of the function inside braces. The declared type must
828869
be a function type, which may be generic.
829870

871+
872+
Function Attributes
873+
```````````````````
874+
::
875+
876+
sil-function-attribute ::= '[canonical]'
877+
878+
The function is in canonical SIL even if the module is still in raw SIL.
879+
::
880+
881+
sil-function-attribute ::= '[ossa]'
882+
883+
The function is in OSSA (ownership SSA) form.
884+
::
885+
886+
sil-function-attribute ::= '[transparent]'
887+
888+
Transparent functions are always inlined and don't keep their source
889+
information when inlined.
890+
::
891+
892+
sil-function-attribute ::= '[' sil-function-thunk ']'
893+
sil-function-thunk ::= 'thunk'
894+
sil-function-thunk ::= 'signature_optimized_thunk'
895+
sil-function-thunk ::= 'reabstraction_thunk'
896+
897+
The function is a compiler generated thunk.
898+
::
899+
900+
sil-function-attribute ::= '[dynamically_replacable]'
901+
902+
The function can be replaced at runtime with a different implementation.
903+
Optimizations must not assume anything about such a function, even if the SIL
904+
of the function body is available.
905+
::
906+
907+
sil-function-attribute ::= '[dynamic_replacement_for' identifier ']'
908+
sil-function-attribute ::= '[objc_replacement_for' identifier ']'
909+
910+
Specifies for which function this function is a replacement.
911+
::
912+
913+
sil-function-attribute ::= '[exact_self_class]'
914+
915+
The function is a designated initializers, where it is known that the static
916+
type being allocated is the type of the class that defines the designated
917+
initializer.
918+
::
919+
920+
sil-function-attribute ::= '[without_actually_escaping]'
921+
922+
The function is a thunk for closures which are not actually escaping.
923+
::
924+
925+
sil-function-attribute ::= '[' sil-function-purpose ']'
926+
sil-function-purpose ::= 'global_init'
927+
928+
The implied semantics are:
929+
930+
- side-effects can occur any time before the first invocation.
931+
- all calls to the same ``global_init`` function have the same side-effects.
932+
- any operation that may observe the initializer's side-effects must be
933+
preceded by a call to the initializer.
934+
935+
This is currently true if the function is an addressor that was lazily
936+
generated from a global variable access. Note that the initialization
937+
function itself does not need this attribute. It is private and only
938+
called within the addressor.
939+
::
940+
941+
sil-function-attribute ::= '[weak_imported]'
942+
943+
Cross-module references to this function should always use weak linking.
944+
::
945+
946+
sil-function-attribute ::= '[available' sil-version-tuple ']'
947+
sil-version-tuple ::= [0-9]+ ('.' [0-9]+)*
948+
949+
The minimal OS-version where the function is available.
950+
::
951+
952+
sil-function-attribute ::= '[' sil-function-inlining ']'
953+
sil-function-inlining ::= 'never'
954+
955+
The function is never inlined.
956+
::
957+
958+
sil-function-inlining ::= 'always'
959+
960+
The function is always inlined, even in a ``Onone`` build.
961+
::
962+
963+
sil-function-attribute ::= '[' sil-function-optimization ']'
964+
sil-function-inlining ::= 'Onone'
965+
sil-function-inlining ::= 'Ospeed'
966+
sil-function-inlining ::= 'Osize'
967+
968+
The function is optimized according to this attribute, overriding the setting
969+
from the command line.
970+
::
971+
972+
sil-function-attribute ::= '[' sil-function-effects ']'
973+
sil-function-effects ::= 'readonly'
974+
sil-function-effects ::= 'readnone'
975+
sil-function-effects ::= 'readwrite'
976+
sil-function-effects ::= 'releasenone'
977+
978+
The specified memory effects of the function.
979+
::
980+
981+
sil-function-attribute ::= '[_semantics "' [A-Za-z._0-9]+ '"]'
982+
983+
The specified high-level semantics of the function. The optimizer can use this
984+
information to perform high-level optimizations before such functions are
985+
inlined. For example, ``Array`` operations are annotated with semantic
986+
attributes to let the optimizer perform redundant bounds check elimination and
987+
similar optimizations.
988+
::
989+
990+
sil-function-attribute ::= '[_specialize "' [A-Za-z._0-9]+ '"]'
991+
992+
Specifies for which types specialized code should be generated.
993+
::
994+
995+
sil-function-attribute ::= '[clang "' identifier '"]'
996+
997+
The clang node owner.
998+
830999
Basic Blocks
8311000
~~~~~~~~~~~~
8321001
::

docs/WindowsBuild.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The following must take place in the **developer command prompt** (provided by V
1313
2. Microsoft.VisualStudio.Component.Windows10SDK.17763
1414
3. Microsoft.VisualStudio.Component.VC.Tools.x86.x64
1515

16-
The following [link](https://docs.microsoft.com/visualstudio/install/workload-component-id-vs-build-tools?view=vs-2019)) helps in finding the component name given its ID for Visual Studio 2019.
16+
The following [link](https://docs.microsoft.com/visualstudio/install/workload-component-id-vs-build-tools?view=vs-2019) helps in finding the component name given its ID for Visual Studio 2019.
1717

1818
## Clone the repositories
1919

@@ -92,7 +92,25 @@ Warning: Creating the above links usually requires administrator privileges. The
9292

9393
```cmd
9494
md "S:\b\toolchain"
95-
cmake -B "S:\b\toolchain" -G Ninja -S S:\toolchain\llvm -C S:\windows-swift\cmake\caches\Windows-x86_64.cmake -C S:\windows-swift\cmake\caches\org.compnerd.dt.cmake -DLLVM_ENABLE_ASSERTIONS=YES -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;cmark;swift;lldb;lld" -DLLVM_EXTERNAL_PROJECTS="cmark;swift" -DSWIFT_PATH_TO_LIBDISPATCH_SOURCE=S:\toolchain\swift-corelibs-libdispatch -DLLVM_ENABLE_PDB=YES -DLLDB_DISABLE_PYTHON=YES -DSWIFT_WINDOWS_x86_64_ICU_UC_INCLUDE="S:/Library/icu-64/usr/include" -DSWIFT_WINDOWS_x86_64_ICU_UC="S:/Library/icu-64/usr/lib/icuuc64.lib" -DSWIFT_WINDOWS_x86_64_ICU_I18N_INCLUDE="S:/Library/icu-64/usr/include" -DSWIFT_WINDOWS_x86_64_ICU_I18N="S:/Library/icu-64/usr/lib/icuin64.lib" -DCMAKE_INSTALL_PREFIX="C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr" -DPYTHON_EXECUTABLE=C:\Python27\python.exe -DSWIFT_BUILD_DYNAMIC_STDLIB=YES -DSWIFT_BUILD_DYNAMIC_SDK_OVERLAY=YES
95+
cmake -B "S:\b\toolchain" -G Ninja -S S:\toolchain\llvm ^
96+
-C S:\windows-swift\cmake\caches\Windows-x86_64.cmake ^
97+
-C S:\windows-swift\cmake\caches\org.compnerd.dt.cmake ^
98+
-DLLVM_ENABLE_ASSERTIONS=YES ^
99+
-DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;cmark;swift;lldb;lld" ^
100+
-DLLVM_EXTERNAL_PROJECTS="cmark;swift" ^
101+
-DSWIFT_PATH_TO_LIBDISPATCH_SOURCE=S:\toolchain\swift-corelibs-libdispatch ^
102+
-DLLVM_ENABLE_PDB=YES ^
103+
-DLLVM_ENABLE_LIBEDIT=NO ^
104+
-DLLDB_DISABLE_PYTHON=YES ^
105+
-DSWIFT_WINDOWS_x86_64_ICU_UC_INCLUDE="S:/Library/icu-64/usr/include" ^
106+
-DSWIFT_WINDOWS_x86_64_ICU_UC="S:/Library/icu-64/usr/lib/icuuc64.lib" ^
107+
-DSWIFT_WINDOWS_x86_64_ICU_I18N_INCLUDE="S:/Library/icu-64/usr/include" ^
108+
-DSWIFT_WINDOWS_x86_64_ICU_I18N="S:/Library/icu-64/usr/lib/icuin64.lib" ^
109+
-DCMAKE_INSTALL_PREFIX="C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr" ^
110+
-DPYTHON_EXECUTABLE=C:\Python27\python.exe ^
111+
-DSWIFT_BUILD_DYNAMIC_STDLIB=YES ^
112+
-DSWIFT_BUILD_DYNAMIC_SDK_OVERLAY=YES
113+
96114
ninja -C S:\b\toolchain
97115
```
98116

0 commit comments

Comments
 (0)