Skip to content

Commit 353db38

Browse files
Merge pull request #4463 from swiftwasm/katei/merge-main-2022-04-20
Merge main 2022-04-20
2 parents 60a357c + 07506bf commit 353db38

File tree

272 files changed

+2485
-843
lines changed

Some content is hidden

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

272 files changed

+2485
-843
lines changed

benchmark/scripts/run_smoke_bench

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -307,11 +307,12 @@ def report_code_size(opt_level, old_dir, new_dir, architecture, platform, output
307307

308308

309309
def get_codesize(filename):
310-
output = subprocess.check_output(["size", filename]).splitlines()
311-
header_line = output[0]
312-
data_line = output[1]
310+
output = subprocess.check_output(["size", filename])
311+
lines = output.decode('utf-8').splitlines()
312+
header_line = lines[0]
313+
data_line = lines[1]
313314
if header_line.find("__TEXT") != 0:
314-
sys.exit("unexpected output from size command:\n" + output)
315+
sys.exit("unexpected output from size command:\n" + lines)
315316
return int(data_line.split("\t")[0])
316317

317318

@@ -361,7 +362,8 @@ performance team (@eeckstein).
361362
<summary><strong>Hardware Overview</strong></summary>
362363
363364
"""
364-
po = subprocess.check_output(["system_profiler", "SPHardwareDataType"])
365+
output = subprocess.check_output(["system_profiler", "SPHardwareDataType"])
366+
po = output.decode('utf-8')
365367
for line in po.splitlines():
366368
selection = [
367369
"Model Name",

benchmark/utils/TestsUtils.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,11 +324,13 @@ public func someProtocolFactory() -> SomeProtocol { return MyStruct() }
324324
// It's important that this function is in another module than the tests
325325
// which are using it.
326326
@inline(never)
327+
@_semantics("optimize.no.crossmodule")
327328
public func blackHole<T>(_ x: T) {
328329
}
329330

330331
// Return the passed argument without letting the optimizer know that.
331332
@inline(never)
333+
@_semantics("optimize.no.crossmodule")
332334
public func identity<T>(_ x: T) -> T {
333335
return x
334336
}
@@ -337,12 +339,15 @@ public func identity<T>(_ x: T) -> T {
337339
// It's important that this function is in another module than the tests
338340
// which are using it.
339341
@inline(never)
342+
@_semantics("optimize.no.crossmodule")
340343
public func getInt(_ x: Int) -> Int { return x }
341344

342345
// The same for String.
343346
@inline(never)
347+
@_semantics("optimize.no.crossmodule")
344348
public func getString(_ s: String) -> String { return s }
345349

346350
// The same for Substring.
347351
@inline(never)
352+
@_semantics("optimize.no.crossmodule")
348353
public func getSubstring(_ s: Substring) -> Substring { return s }

cmake/modules/StandaloneOverlay.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ include(SwiftConfigureSDK)
132132
include(SwiftComponents)
133133
include(DarwinSDKs)
134134

135-
find_package(Python2 COMPONENTS Interpreter REQUIRED)
136135
find_package(Python3 COMPONENTS Interpreter REQUIRED)
137136

138137
# Without this line, installing components is broken. This needs refactoring.

docs/ABI/Mangling.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ witness functions for a type.
305305
AUTODIFF-FUNCTION-KIND ::= 'd' // differential
306306
AUTODIFF-FUNCTION-KIND ::= 'p' // pullback
307307

308-
``<AUTODIFF-FUNCTION-KIND>`` differentiates the kinds of functions assocaited
308+
``<AUTODIFF-FUNCTION-KIND>`` differentiates the kinds of functions associated
309309
with a differentiable function used for differentiable programming.
310310

311311
::
@@ -596,7 +596,7 @@ Types
596596
FUNCTION-KIND ::= 'zB' C-TYPE // objc block type with non-canonical C type
597597
FUNCTION-KIND ::= 'L' // objc block function type with canonical C type (escaping) (DWARF only; otherwise use 'B' or 'zB' C-TYPE)
598598
FUNCTION-KIND ::= 'C' // C function pointer / C++ method type
599-
FUNCTION-KIND ::= 'zC' C-TYPE // C function pointer / C++ method type with with non-canonical C type
599+
FUNCTION-KIND ::= 'zC' C-TYPE // C function pointer / C++ method type with non-canonical C type
600600
FUNCTION-KIND ::= 'A' // @auto_closure function type (escaping)
601601
FUNCTION-KIND ::= 'E' // function type (noescape)
602602

docs/CppInteroperability/CppInteroperabilityManifesto.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1625,7 +1625,7 @@ is ergonomics.
16251625
16261626
While Swift structs are a bad match for non-movable C++ classes, Swift classes
16271627
match semantics better. For example, instances of Swift classes, once allocated,
1628-
stay at the same address until `deinit`. Instances of Swift clasess are always
1628+
stay at the same address until `deinit`. Instances of Swift classes are always
16291629
worked with indirectly, eliminating the need to move them around in memory.
16301630
16311631
Although user-defined Swift classes have a certain memory layout determined by
@@ -2524,7 +2524,7 @@ there the Swift compiler infers the attribute for all users.
25242524
This analysis relies on over-approximating the dynamic callgraph with the static
25252525
callgraph. The static callgraph is feasible to compute in most cases, since
25262526
Swift has very limited ways to abstract over an unspecialized generic function.
2527-
Speicifically, Swift does not have generic closures. Swift does allow protocols
2527+
Specifically, Swift does not have generic closures. Swift does allow protocols
25282528
to have requirements for generic functions though.
25292529

25302530
### Function templates: importing as real generic functions
@@ -2963,7 +2963,7 @@ This brief sketch obviously leaves many questions unanswered on the detailed
29632963
semantics that a `throws!` feature would have, for example whether user-written
29642964
Swift code should be allowed to use `throws!` -- see also [this forum
29652965
discussion](https://forums.swift.org/t/handling-c-exceptions/34823). Before we
2966-
take any steps towards implementing C++ exception proagation, we will submit a
2966+
take any steps towards implementing C++ exception propagation, we will submit a
29672967
formal Swift Evolution proposal for the `throws!` feature.
29682968

29692969
The other question to answer is how we would map the C++ exception to a

docs/CppInteroperability/GettingStartedWithC++Interop.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ This document is designed to get you started with bidirectional API-level intero
1818
```
1919
//In module.modulemap
2020
module Cxx {
21-
//note that your header should be the file that containts your method implementations
21+
//note that your header should be the file that contains your method implementations
2222
header "Cxx.hpp"
2323
requires cplusplus
2424
}

docs/CppInteroperability/InteropOddities.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ are bridged as value types. ⚠️ This will change as soon as Swift has a way t
1212

1313
Currently, lifetimes are extended to the end of the lexical scope if any unsafe pointers are used in that scope. TODO:
1414
this should be updated to extend lifetimes whenever a C++ type is used in that scope. Currently, if there is no
15-
unsafe pointer used in teh scope, then normal Swift lifetime rules apply.
15+
unsafe pointer used in the scope, then normal Swift lifetime rules apply.
1616

1717
**Borrowing Self**
1818

docs/DebuggingTheCompiler.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ find MyProject/Sources -name '*.swift' -type f > input-files.txt
599599
# In some cases, projects may use multiple files with the same
600600
# name but in different directories (for different schemes),
601601
# which can be a problem. Having a file list makes working around
602-
# this convenient as you can manually manually edit out the files
602+
# this convenient as you can manually edit out the files
603603
# that are not of interest at this stage.
604604
605605
mkdir Output

docs/DevelopmentTips.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Given the size of artifacts generated, you might also want to bump the cache siz
4242

4343
You can run some compiles to see if it is actually doing something by running `sccache --show-stats`. Depending on the exact compilation task you're running, you might see very different cache hit rates. For example, `sccache` is particularly effective if you're rebuilding LLVM, which doesn't change so frequently from the Swift compiler's perspective. On the other hand, if you're changing the compiler's AST, the cache hit rate is likely to be much lower.
4444

45-
One known issue with `sccache` is that you might occassionally get an "error: Connection to server timed out", even though you didn't stop the server. Simply re-running the build command usually works.
45+
One known issue with `sccache` is that you might occasionally get an "error: Connection to server timed out", even though you didn't stop the server. Simply re-running the build command usually works.
4646

4747
## Memory usage
4848

docs/Lexicon.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ Describes contributions which fix code that is not executed
239239
Provides context for interpreting a type that may have generic parameters
240240
in it. Generic parameter types are normally just represented as "first
241241
generic parameter in the outermost context" (or similar), so it's up to the
242-
generic environment to note that that type must be a Collection. (Another
242+
generic environment to note that type must be a Collection. (Another
243243
way of looking at it is that the generic environment connects
244244
[interface types](#interface-type) with
245245
[contextual types](#contextual-type)).

0 commit comments

Comments
 (0)