Commit Graph

2345 Commits

Author SHA1 Message Date
Michael Gottesman
05deb32e52 [docs] Add a section about debugging the typechecker to DebuggingTheCompiler.rst. 2017-12-08 18:38:00 -08:00
Michael Gottesman
b99ac1e4ff [docs] Be consistent about rst headings. 2017-12-08 18:29:12 -08:00
Slava Pestov
4d21d127aa Mangler: Add mangling for class metadata base offset 2017-12-08 13:50:56 -08:00
Erik Eckstein
97a361f867 docs: add ABI docs to contents 2017-12-05 09:17:45 -08:00
Erik Eckstein
c9f28c81c2 docs: fix sphinx build error 2017-12-05 09:17:44 -08:00
Doug Gregor
31723be232 Merge pull request #13264 from DougGregor/se-0143-better-fail-than-crash
[Runtime] Always fail to find a conditional conformance at runtime.
2017-12-04 21:50:25 -08:00
Doug Gregor
4f8edeb913 [Runtime] Always fail to find a conditional conformance at runtime.
Proper evaluation of conditional conformances at runtime (e.g., as part of
dynamic casting) is too large to tackle in the Swift 4.1 timeframe. For now,
record that a conformance is conditional in the protocol conformance record,
and always return "does not conform" to such types.

Fixes rdar://problem/35761301.
2017-12-04 16:51:52 -08:00
Erik Eckstein
ee608763c2 docs: small simplification and added comments in the mangling grammar doc. 2017-12-04 15:41:21 -08:00
Greg Parker
da14cd79a6 [runtime] Clean up symbol exports in libc functions. (#13202) 2017-12-01 17:49:11 -08:00
Jordan Rose
8f8f00012a Merge pull request #12834 from jrose-apple/restrict-cross-module-struct-initializers-2
Implementation of SE-0189 "Restrict cross-module struct initializers to be delegating"

rdar://problem/34777878
2017-11-30 13:32:45 -08:00
Thomas Roughton
01891c0ca8 Clarify Associated Type Inference and SE-0108
Just a minor edit for clarity while reading through the generics documentation. Previously, this read as if associated type inference itself, and not the proposal to remove it, was rejected.
2017-11-27 02:39:16 -05:00
Darío Hereñú
4dd8fc6c64 Minor fix on subtitle (styling) 2017-11-21 18:22:26 -08:00
Darío Hereñú
580eaae2ef Typo plus link added 2017-11-21 02:24:20 -03:00
Joe Shajrawi
d8289aa3ec Code size: destroy_addr outline 2017-11-17 16:10:27 -08:00
Joe Shajrawi
1d6c7c5bd2 Merge pull request #12953 from shajrawi/copyaddr_outline_part2_v3
Code size: copy_addr outline - Support Archetypes
2017-11-17 10:35:33 -08:00
eeckstein
73fc4b221b Merge pull request #12976 from eeckstein/remove-semantic
Remove @_semantics("optimize.sil.never")
2017-11-17 07:54:31 -08:00
Yuka Ezura
03a4171b95 Update "Nested generics" sample code 2017-11-17 11:09:06 +09:00
Erik Eckstein
76f281510f Remove @_semantics("optimize.sil.never")
The replacement is @_optimize(none)
2017-11-16 14:11:52 -08:00
Joe Shajrawi
5aff0891b7 Code size: copy_addr outline part 2 - Support Archetypes 2017-11-15 15:26:44 -08:00
Graydon Hoare
a5de4ccb8b Merge pull request #12927 from graydon/update-pr-testing-toc
[Docs] Update TOC and list in PR test docs.
2017-11-14 11:46:54 -08:00
Graydon Hoare
8d3835a770 [Docs] Update TOC and list in PR test docs. 2017-11-14 10:31:13 -08:00
Arnold Schwaighofer
e18bb9fad7 Fix SIL.rst 2017-11-13 07:38:46 -08:00
John McCall
045998544f Add begin_apply, abort_apply, and end_apply instructions to allow
yield_once coroutines to be executed.
2017-11-13 04:03:54 -05:00
John McCall
7743be30f6 Add a "token" type to SIL to allow dependencies to be expressed without
allowing abstraction.
2017-11-13 04:03:21 -05:00
Jordan Rose
1598a21e43 DI: Warn on non-delegating cross-module struct initializers
...as detected by initializing an individual field without having
initialized the whole object (via `self = value`).

This only applies in pre-Swift-5 mode because the next commit will
treat all cross-module struct initializers as delegating in Swift 5.
2017-11-09 11:24:28 -08:00
Pavel Yaskevich
fdc43cf151 [ABI/Metadata] Re-arrange space allocation of function metadata flags
This changes layout of the `TargetFunctionTypeFlags` to allocate
8 bits for flags, 8 bits for convesion and 16 bits for number of
parameters. Documentation is updated accordingly.
2017-11-08 23:42:59 -08:00
Erik Eckstein
934e0ea563 docs: fix title underlines 2017-11-07 13:49:36 -08:00
John McCall
14d6390352 Add "yield" and "unwind" instructions to SIL. 2017-11-07 03:51:54 -05:00
Doug Gregor
1d8bc93238 Merge pull request #12740 from DougGregor/abi-generic-signatures
[ABI] Initial draft of canonicalization and minimization of generic signatures
2017-11-03 22:28:31 -07:00
Doug Gregor
0790739a2f Describe a protocol requirement signature for the ABI 2017-11-03 22:27:33 -07:00
Doug Gregor
14db368827 Clarify discussion of canonical concrete types and type parameters.
Also address Slava's feedback on the first draft.
2017-11-03 22:09:07 -07:00
Arnold Schwaighofer
2e5b982c72 Merge pull request #12745 from aschwaighofer/runtime_swift_deallocUninitializedObject
runtime: Add and use swift_deallocUninitializedObject for uninitialized objects
2017-11-03 19:28:39 -07:00
Pavel Yaskevich
7a2117bdcf [Mangling] Preserve all parameter flags in single parameter function mangling
Currently if function has a single parameter we'd skip mangling some of the
parameter flags e.g. `__shared`, `inout` still works because it's part of
the type itself (currently) but would be broken too if that were to change.
2017-11-03 17:00:24 -07:00
Arnold Schwaighofer
b93e93900e Add _swift_deallocUninitializedObject to Runtime.md 2017-11-03 09:48:17 -07:00
Doug Gregor
488c6e868e [ABI] Initial draft of canonicalization and minimization of generic signatures 2017-11-02 23:46:47 -07:00
Joe Shajrawi
d851abeed8 Merge branch 'master' into outline_copyddr 2017-10-31 17:28:09 -07:00
Joe Shajrawi
f4db36426c Code Size: Outline copy addr instruction 2017-10-31 17:03:48 -07:00
Erik Eckstein
47e5a0757a A utility script to split long swift compiler command lines.
For details see the comment in split-cmdline

I put this under a new directory utils/dev-script because we have so much stuff in utils already.
Other, similar scripts can then be added in dev-scripts as well.
2017-10-29 15:27:32 -07:00
Michael Gottesman
36a8d0d5c0 [sil] Add support for the destructure_{struct,tuple} instructions.
rdar://31521023
2017-10-24 18:36:37 -07:00
Graydon Hoare
2536bbb788 [docs] Mention lit.py -vv option, helpful for diagnosis. 2017-10-20 15:38:07 -07:00
swift-ci
379afbdc37 Merge pull request #12491 from gottesmm/pr-b65b52572f0ab46374d54e693a93daaeec20fe77 2017-10-18 23:52:22 -07:00
Michael Gottesman
cc39b5ffdf [docs] Update DebuggingTheCompiler.rst section with info about vim/emacs integration for viewcfg. 2017-10-17 14:58:40 -07:00
Andrew Trick
d369aa4070 Support @noescape SIL function types. (#12420)
Support for @noescape SILFunctionTypes.

These are the underlying SIL changes necessary to implement the new
closure capture ABI.

Note: This includes a change to function name mangling that
primarily affects reabstraction thunks.

The new ABI will allow stack allocation of non-escaping closures as a
simple optimization.

The new ABI, and the stack allocation optimization, also require
closure context to be @guaranteed. That will be implemented as the
next step.

Many SIL passes pattern match partial_apply sequences. These all
needed to be fixed to handle the convert_function that SILGen now
emits. The conversion is now needed whenever a function declaration,
which has an escaping type, is passed into a @NoEscape argument.

In addition to supporting new SIL patterns, some optimizations like
inlining and SIL combine are now stronger which could perturb some
benchmark results.

These underlying SIL changes should be merged now to avoid conflicting
with other work. Minor benchmark discrepancies can be investigated as part of
the stack-allocation work.

* Add a noescape attribute to SILFunctionType.

And set this attribute correctly when lowering formal function types to SILFunctionTypes based on @escaping.

This will allow stack allocation of closures, and unblock a related ABI change.

* Flip the polarity on @noescape on SILFunctionType and clarify that
we don't default it.

* Emit withoutActuallyEscaping using a convert_function instruction.

It might be better to use a specialized instruction here, but I'll leave that up to Andy.

Andy: And I'll leave that to Arnold who is implementing SIL support for guaranteed ownership of thick function types.

* Fix SILGen and SIL Parsing.

* Fix the LoadableByAddress pass.

* Fix ClosureSpecializer.

* Fix performance inliner constant propagation.

* Fix the PartialApplyCombiner.

* Adjust SILFunctionType for thunks.

* Add mangling for @noescape/@escaping.

* Fix test cases for @noescape attribute, mangling, convert_function, etc.

* Fix exclusivity test cases.

* Fix AccessEnforcement.

* Fix SILCombine of convert_function -> apply.

* Fix ObjC bridging thunks.

* Various MandatoryInlining fixes.

* Fix SILCombine optimizeApplyOfConvertFunction.

* Fix more test cases after merging (again).

* Fix ClosureSpecializer. Hande convert_function cloning.

Be conservative when combining convert_function. Most of our code doesn't know
how to deal with function type mismatches yet.

* Fix MandatoryInlining.

Be conservative with function conversion. The inliner does not yet know how to
cast arguments or convert between throwing forms.

* Fix PartialApplyCombiner.
2017-10-17 13:07:25 -07:00
Erik Eckstein
e21b9124ee Demangler: fix demangling and remangling of associated type paths.
fixes SR-6138
2017-10-16 17:30:34 -07:00
Slava Pestov
0acf3ac8d9 SIL: Remove is_nonnull instruction 2017-10-13 17:38:32 -07:00
Pavel Yaskevich
0ccf4fabd7 Merge pull request #12320 from xedin/rdar-31408030
[IRGen/Runtime] Update Function Metadata
2017-10-12 17:45:09 -07:00
Pavel Yaskevich
c5cff769c7 [IRGen] Update Function Metadata to use AnyFunctionType::Param
This changes layout of the parameter metadata from single tuple record
(in case of materializable type) to N records each corresponding to
invididual function parameter, where functions with no parameters
`() -> Void` get 0 records allocated.
2017-10-12 15:58:19 -07:00
Jordan Rose
b5f20334ab [docs] LibraryEvolution: Tweak for Swift 4.0. (#11742) 2017-10-12 15:44:42 -07:00
Robert Widmann
24154254b5 Change a literal block to a colon
Lack of indentation on the bulleted list broke builds involving CMark.
2017-10-12 02:54:38 -04:00
Pavel Yaskevich
affbd5e4ea [AST] Fix function signature mangler to aways respect parens 2017-10-11 21:45:05 -07:00