Commit Graph

2517 Commits

Author SHA1 Message Date
swift-ci
c1c5931130 Merge pull request #15105 from gonsolo/patch-1 2018-03-10 16:52:12 -08:00
Miguel Salinas
6c8f2aa1b0 Add -Osize optimization documentation 2018-03-10 09:51:44 -06:00
Arnold Schwaighofer
1e4f55de8d Merge pull request #15046 from aschwaighofer/without_actually_escaping_verification
Implement withoutActuallyEscaping verification
2018-03-09 09:34:06 -08:00
Gonsolo
0e041918ed Remove wrong statement
This statement and the build commands below contradict each other.
2018-03-09 11:32:38 +01:00
swift-ci
0b9c973017 Merge pull request #15077 from atrick/noescape-doc 2018-03-08 16:00:16 -08:00
Andrew Trick
2aebd75786 Document the @noescape SIL function type attribute. 2018-03-08 13:41:24 -08:00
Arnold Schwaighofer
e616f0a6a8 Add documentation to SIL.rst for convert_function to clarify escaping and not escaping types 2018-03-08 07:44:00 -08:00
Huon Wilson
b330c6078f Merge pull request #14948 from huonw/at-owned
Make __owned functional, maybe
2018-03-08 13:18:19 +11:00
Huon Wilson
e307e54098 [AST] Explicitly track things marked __owned. 2018-03-08 12:36:24 +11:00
Jake Petroules
96c0083d02 [Driver] Provide executed command as an actual array (#15012)
This patch adds additional entries to the JSON command messages output
by the Swift compiler. It's now possible to get the command executable
("command_executable") and arguments ("command_arguments") as a single
string and array, respectively, rather than having to parse the
shell-escaped command line provided in the "command" key.

<rdar://problem/35701809>
2018-03-07 10:40:38 -08:00
Arnold Schwaighofer
5940796cc1 SIL: Add an is_escaping_closure instruction
Will be used to verify that withoutActuallyEscaping's block does not
escape the closure.

``%escaping = is_escaping_closure %closure`` tests the reference count. If the
closure is not uniquely referenced it prints out and error message and
returns true. Otherwise, it returns false. The returned result can be
used with a ``cond_fail %escaping`` instruction to abort the program.

rdar://35525730
2018-03-07 08:56:00 -08:00
John McCall
9a4540e84d Split the instantiation function into two phases.
The allocation phase is guaranteed to succeed and just puts enough
of the structure together to make things work.

The completion phase does any component metadata lookups that are
necessary (for the superclass, fields, etc.) and performs layout;
it can fail and require restart.

Next up is to support this in the runtime; then we can start the
process of making metadata accessors actually allow incomplete
metadata to be fetched.
2018-03-06 03:07:55 -05:00
Arnold Schwaighofer
ee68d4edb7 Merge pull request #14924 from aschwaighofer/wip_effects_release_none
Add an effects(releasenone) function effects attribute
2018-03-05 12:06:17 -08:00
Arnold Schwaighofer
93ab9302a6 Fix rst error 2018-03-05 09:29:43 -08:00
elk941
aa207ad5c2 Fix grammer mistake in ABIStabilityManifesto.xml (#14943) 2018-03-05 09:20:52 -08:00
Arnold Schwaighofer
6fe0633c08 Add @effects(releasenone) documentation. 2018-03-05 07:03:54 -08:00
Sho Ikeda
8ca8b67593 Serialization.rst: Fix typo 2018-03-04 21:40:12 +09:00
Andrew Breckenridge
2c8d58c6fd docs/WindowsBuild: Update cmark build invocation to Release mode 2018-02-26 13:44:37 -08:00
John McCall
dd99536d31 Move the metadata-pattern header into the type context descriptor.
This is yet another waypoint on the path towards the final
generic-metadata design.  The immediate goal is to make the
pattern a private implementation detail and to give the runtime
more visibility into the allocation and caching of generic types.
2018-02-26 12:10:24 -05:00
Joe Groff
4c2dde56a0 IRGen: Lower external key path components.
The key path pattern needs to include a reference to the external descriptor, along with hooks for lowering its type arguments and indices, if any. The runtime will need to instantiate and interpolate the external component when the key path object is instantiated.

While we're here, let's also reserve some more component header bytes for future expansion, since this is an ABI we're going to be living with for a while.
2018-02-23 19:03:15 -08:00
swift-ci
c2347597c4 Merge pull request #14764 from AndrewSB/clang-cl-over-msvc 2018-02-22 12:33:40 -08:00
Graydon Hoare
4867ec0061 [Docs] Explain batch mode a bit, in DriverInternals.rst 2018-02-21 17:03:32 -08:00
Andrew Breckenridge
beec93dc18 docs/WindowsBuild: Reorder clang-cl & MSVC + Add MSVC Swift invocation 2018-02-21 13:44:32 -08:00
Saleem Abdulrasool
03590d1fe1 Merge pull request #14562 from AndrewSB/who-needs-a-single-doc
[docs][Windows] Add context and split doc into multiple files
2018-02-21 13:37:24 -08:00
Andrew Breckenridge
6a8b1e2a40 docs/Windows: Format and clarify documentation 2018-02-20 20:33:09 -08:00
Andrew Breckenridge
9305156c05 docs/WindowsBuild: Remove incorrect comment about supported versions 2018-02-20 17:16:20 -08:00
Andrew Breckenridge
b9cbc63feb docs/WindowsCrossCompile: Remove VS env vars that are no longer used 2018-02-20 17:16:20 -08:00
Andrew Breckenridge
8d73c6d562 docs/WindowsCrossCompile: Fix ICU flags for Swift build 2018-02-20 17:16:12 -08:00
Andrew Breckenridge
dc103336d1 docs/Windows: Split doc into multiple files 2018-02-20 17:15:53 -08:00
Kyle Murray
a251e0e7e8 Fix em dash and apostrophe presentation in the Swift man page.
Terminal currently renders em dashes and apostrophes incorrectly:

"please file a report to AppleXs bug reporter"
"features X being fast is rare"

Also reformats some whitespace to remove a double space after a
sentence:

"a great way for anyone to help improve Swift.  The bug tracker"
2018-02-19 14:34:42 -08:00
John Eismeier
6cfc648d2a Fix spacing 2018-02-16 15:00:59 -05:00
John Eismeier
09452396cc Propose fixing some typos 2018-02-15 14:37:51 -05:00
Graydon Hoare
3a023534b3 [Docs] Add more details about -stats-output-dir and -trace-stats-events 2018-02-09 15:53:40 -08:00
Arnold Schwaighofer
cf5b5dcb68 Merge pull request #14440 from aschwaighofer/convert_function_to_trivial
SIL: Add a convert_function_to_trivial instruction for converting escaping t…
2018-02-07 05:11:36 -08:00
swift-ci
50637d1080 Merge pull request #14439 from AndrewSB/one-tenth-the-build-time-🤦‍♂️ 2018-02-06 19:05:04 -08:00
Arnold Schwaighofer
d51053b003 Add convert_escape_to_noescape instruction for converting escaping to noescape functions
@noescape function types will eventually be trivial. A
convert_escape_to_noescape instruction does not take ownership of its
operand. It is a projection to the trivial value carried by the closure
-- both context and implementation function viewed as a trivial value.

A safe SIL program must ensure that the object that the project value is based
on is live beyond the last use of the trivial value. This will be
achieve by means of making the lifetimes dependent.

For example:

  %e = partial_apply [callee_guaranteed] %f(%z) : $@convention(thin) (Builtin.Int64) -> ()
  %n = convert_escape_to_noescape %e : $@callee_guaranteed () -> () to $@noescape @callee_guaranteed () -> ()
  %n2 = mark_dependence %n : $@noescape @callee_guaranteed () -> () on %e : $@callee_guaranteed () -> ()
  %f2 = function_ref @use : $@convention(thin) (@noescape @callee_guaranteed () -> ()) -> ()
  apply %f2(%n2) : $@convention(thin) (@noescape @callee_guaranteed () -> ()) -> ()
  release_value %e : $@callee_guaranteed () -> ()

Note: This is not yet actually used.

Part of:
SR-5441
rdar://36116691
2018-02-06 18:01:23 -08:00
Andrew Breckenridge
063849d520 [docs][Windows] Build clang in Release mode instead of Debug
Should result in ~10x faster build times.
2018-02-06 11:16:04 -08:00
Andrew Breckenridge
5218326b27 [docs][Windows] Add forgotten ^ to LLVM_TARGETS_TO_BUILD 2018-02-06 11:07:16 -08:00
Arnold Schwaighofer
d981bb1d96 Mangling: noescape functions will be trivial and no longer compatible with escape function types.
Mangle escapeness as part of the type.

Part of:
SR-5441
rdar://36116691
2018-02-06 08:51:43 -08:00
Saleem Abdulrasool
63fe8c49b0 Merge pull request #14329 from AndrewSB/save-the-env-🌱
[docs][Windows] Add LLVM_TARGETS_TO_BUILD flag to LLVM CMake invocation
2018-02-06 08:20:48 -08:00
Erik Eckstein
4a0ec87294 docs: Mention the blockifyasm script in DebuggingTheCompiler 2018-02-02 15:31:47 -08:00
Andrew Breckenridge
65f3d21af5 [docs][Windows] Add LLVM_TARGETS_TO_BUILD flag to LLVM CMake invocation 2018-02-01 14:55:34 -08:00
Andrew Breckenridge
9eb4a0babf [docs][Windows] Add bash+cmd syntax highlighting in code snippets 2018-02-01 07:12:31 -08:00
swift-ci
6c0eb5d438 Merge pull request #14269 from AndrewSB/we-❤️-32bit-too 2018-01-31 17:23:37 -08:00
swift-ci
7ab3426f0c Merge pull request #14268 from AndrewSB/wut-is-dev-prompt 2018-01-31 13:07:04 -08:00
Doug Gregor
28c489c16d [ABI] Mangle retroactive conformances as part of bound generic types.
A "retroactive" protocol conformance is a conformance that is provided
by a module that is neither the module that defines the protocol nor
the module that defines the conforming type. It is possible for such
conformances to conflict at runtime, if defined in different modules
that were not both visible to the compiler at the same time.

When mangling a bound generic type, also mangle retroactive protocol
conformances that were needed to satisfy the generic requirements of
the generic type. This prevents name collisions between (e.g.) types
formed using retroactive conformances from different modules. The
impact on the size of the mangling is expected to be relatively small,
because most conformances are not retroactive.

Fixes the ABI part of rdar://problem/14375889.
2018-01-31 09:53:38 -08:00
Andrew Breckenridge
308eb46c2a [docs][Windows] Add instruction for 32-bit Windows 2018-01-30 18:10:57 -08:00
Andrew Breckenridge
9c667eea6b [docs][Windows] Add an explanation for what the developer prompt is 2018-01-30 18:09:53 -08:00
Mike Ash
146833c9b5 [Runtime] Fix unowned refcount overflow to side table during deinit.
32-bit has a 7-bit inline unowned refcount, then 31 bits in the side table. Overflowing the inline count in deinit on an object that didn't already have a side table would crash, because the code assumed that creating a side table in deinit was not allowed.

(64-bit has 31 bits inline and in the side table. Overflowing the inline count immediately overflows the side table as well, so there's no change in behavior there.)

rdar://problem/33765960
2018-01-30 15:38:08 -05:00
Joe Groff
a7a3b17597 Replace nominal type descriptors with a hierarchy of context descriptors.
This new format more efficiently represents existing information, while
more accurately encoding important information about nested generic
contexts with same-type and layout constraints that need to be evaluated
at runtime. It's also designed with an eye to forward- and
backward-compatible expansion for ABI stability with future Swift
versions.
2018-01-29 16:19:25 -08:00