Commit Graph

40 Commits

Author SHA1 Message Date
Jordan Rose
a6dd630ca3 Eliminate Builtin.UnknownObject as an AST type (#27378)
This removes it from the AST and largely replaces it with AnyObject
at the SIL and IRGen layers. Some notes:

- Reflection still uses the notion of "unknown object" to mean an
  object with unknown refcounting. There's no real reason to make
  this different from AnyObject (an existential containing a
  single object with unknown refcounting), but this way nothing
  changes for clients of Reflection, and it's consistent with how
  native objects are represented.

- The value witness table and reflection descriptor for AnyObject
  use the mangling "BO" instead of "yXl".

- The demangler and remangler continue to support "BO" because it's
  still in use as a type encoding, even if it's not an AST-level
  Type anymore.

- Type-based alias analysis for Builtin.UnknownObject was incorrect,
  so it's a good thing we weren't using it.

- Same with enum layout. (This one assumed UnknownObject never
  referred to an Objective-C tagged pointer. That certainly wasn't how
  we were using it!)
2019-09-26 17:48:04 -07:00
0xflotus
ca3449568f Update ARCOptimization.rst (#24724)
* Update ARCOptimization.rst

* Update ARCOptimization.rst
2019-05-14 12:57:13 -07:00
Dimitris Apostolou
d84048e555 Fix typos 2019-02-11 08:33:47 +02:00
Harlan
00cc011621 [SILOptimizer] Don't diagnose infinite recursion if a branch terminates the program (#19781)
* [SILOptimizer] Don't diagnose infinite recursion if a branch terminates the program

This patch augments the infinite recursion checker to not warn if a
branch terminates, but still warns if a branch calls into something with
@_semantics("programtermination_point"). This way, calling fatalError
doesn't disqualify you for the diagnostic, but calling exit does.

This also removes the warning workaround in the standard library, and
annotates the internal _assertionFailure functions as
programtermination_points, so they get this treatment too.

* Fix formatting in SILInstructions.cpp

* Re-add missing test
2018-10-09 09:46:37 -07:00
Graydon Hoare
cc16ddfd13 Revert "[SILOptimizer] Don't diagnose infinite recursion if a branch terminates (#19724)"
This reverts commit e94450e840.

rdar://45080912
2018-10-07 23:54:33 -07:00
Harlan
e94450e840 [SILOptimizer] Don't diagnose infinite recursion if a branch terminates (#19724)
This patch augments the infinite recursion checker to not warn if a
branch terminates, but still warns if a branch calls into something with
`@_semantics("arc.programtermination_point")`. This way, calling `fatalError`
doesn't disqualify you for the diagnostic, but calling `exit` does.

This also removes the warning workaround in the standard library, and
annotates the internal _assertionFailure functions as
`programtermination_point`s, so they get this treatment too.
2018-10-05 19:15:26 -07:00
Erik Eckstein
99a9ed5535 SIL: remove the pinning instructions: strong_pin, strong_unpin, is_unique_or_pinned
They are not used anymore after removing the pinning addressors.
2018-08-23 12:47:56 -07:00
Michael Gottesman
9e072a5fc7 [docs] Add a small section to the ARC optimizer docs elaborating on how unreachable code splits a scope and how that affects our modeling. 2017-02-06 14:14:01 -08:00
Michael Gottesman
1971b6a01d [docs] A small amount of copy diting of ARCOPtimization.rst. 2017-01-15 17:39:39 -08:00
Ole Begemann
7f29a33fb4 [docs] Fix code snippet 2017-01-02 19:16:37 +01:00
practicalswift
566bfc0d56 [gardening] Fix typos. 2016-10-13 22:19:08 +02:00
Michael Gottesman
fc9afd1b6a [arc-docs] Add a small section on deinits.
The intention of this change is to make the important deinit semantics with
respect to the optimizer clear and well documented.
2016-10-11 11:40:45 -07:00
Jordan Rose
ca14c36936 [docs] Fix syntax highlighting issues to support newer Sphinxes. (#4283)
- Update the Pygments lexer we use for parsing Swift-like code.
- State more explicitly which highlighting should be used in which
  code blocks.
- Disable highlighting altogether in certain cases (such as SIL.rst,
  which has equal amounts grammar and SIL excerpts).

This should fix the warnings-as-error issues coming from Sphinx > 1.3.4.

Based on a patch by Jeremy Fergason!

https://bugs.swift.org/browse/SR-620
2016-08-12 22:59:11 -07:00
hitstergtd
1ccca9d0f0 [gardening] Properly capitalise 'swift' to 'Swift' 2016-04-17 20:53:48 +01:00
practicalswift
c760f6dfbf [gardening] Add whitespace: "foo,bar" → "foo, bar" 2016-04-12 22:31:46 +02:00
practicalswift
2645d03ded [gardening] Fix recently introduced typos: "releaseing" → "releasing", "typealiase" → "typealias" 2016-03-17 09:39:37 +01:00
Michael Gottesman
b793bab760 [docs][arc] Add a subsection on the relationships in between ARC and "copying" pointers. 2016-03-16 19:07:06 -07:00
Michael Gottesman
621ffa1d43 [docs][arc] Elaborate a bit more in the section about reference counted overhead and structs. 2016-03-16 19:06:49 -07:00
Michael Gottesman
39248af707 [arc][docs] Add a section with information about {retain,release}_value. 2016-03-16 18:59:09 -07:00
Michael Gottesman
9f7cdff90e Add a small section on ARC optimization and enums. It should be expanded more in the future. 2016-03-16 18:43:40 -07:00
Michael Gottesman
f032632046 Add section for definitions of terms that we are using. But only provide a definition from an ARC perspective. We do not need to add any non-relevant information to the ARC Optimization document. 2016-03-16 18:43:40 -07:00
Michael Gottesman
bb1d82ac67 [arc][docs] Rephrasing/reformatting. NFC. 2016-03-16 17:59:04 -07:00
Michael Gottesman
e1e096b0e6 [docs][arc] Add a section on conversions. 2016-03-16 17:59:04 -07:00
Michael Gottesman
82ed9625b7 [docs][arc] Fix two more admonition sections.
These should be the last two such changes.
2016-03-16 17:34:15 -07:00
Michael Gottesman
3732c8b532 [arc][docs] Make an admonition use the ..admonition to fix the formatting. 2016-03-16 17:32:31 -07:00
Michael Gottesman
ff04cb528e [docs][arc] Expand the section on RC identity and change the organization to make more sense given multiple documentation sections. 2016-03-16 17:27:26 -07:00
Michael Gottesman
aaa880943f [docs][arc] Small change to admonishment in the header. 2016-03-16 17:26:59 -07:00
Dmitri Gribenko
f0d294b714 Merge pull request #884 from practicalswift/apostrophes
[gardening] Replace left/right quotation marks
2016-01-11 20:41:24 -08:00
practicalswift
7cf882c4b4 Fix recently introduced typos. 2016-01-08 09:35:35 +01:00
Michael Gottesman
25a999063c [arc-loop-hoisting] Add motiviation/proofs of correctness of ARCLoopHoisting to ARCOptimization.rst. 2016-01-07 19:21:19 -08:00
practicalswift
4689a22f1b Replace left/right quotation marks with apostrophes in non-quote contexts
* LEFT SINGLE QUOTATION MARK (U+2018) → APOSTROPHE (U+0027)
* RIGHT SINGLE QUOTATION MARK (U+2019) → APOSTROPHE (U+0027)
2016-01-06 12:29:40 +01:00
Michael Gottesman
3d8433b7f6 [arc] Add in a new semantics attribute called "arc.programtermination_point" and document it.
If this semantic tag is applied to a function, then we know that:

- The function does not touch any reference counted objects.
- After the function is executed, all reference counted objects are leaked
  (most likely in preparation for program termination).

This allows one, when performing ARC code motion, to ignore blocks that contain
an apply to this function as long as the block does not have any other side
effect having instructions.

I have wanted to do this for a while but was stymied by lacking the ability to
apply multiple @_semantics attributes. This is now committed to trunk so I added
this attribute instead of pattern matching against fatalError (since there could
be other functions with this property).

rdar://19592537
2016-01-02 16:22:06 -06:00
John McCall
5fddd4a704 Remove the autorelease_return and strong_retain_autoreleased instructions.
There's a buggy SIL verifier check that was previously tautological,
and it turns out that it's violated, apparently harmlessly.  Since it
was already doing nothing, I've commented it out temporarily while
I figure out the right way to fix SILGen to get the invariant right.
2015-12-09 14:50:20 -08:00
Devin Otway
8e59ae6a1b Add missing period 2015-12-04 00:29:12 -08:00
Shintaro Kaneko
d9120142f9 Fix execution typo 2015-12-04 02:50:31 +09:00
Alex Chan
9e06a2fcfb Fix typo in docs/ARCOptimization.rst 2015-12-03 17:16:10 +00:00
Michael Gottesman
5cd595b494 [docs] Note that RCIdentityAnalysis is a flow insensitive optimization in the ARCOptimization guide.
Swift SVN r32353
2015-09-30 23:14:08 +00:00
Michael Gottesman
8277473885 Add a section to ARCOptimization.rst describing RCIdentity.
Swift SVN r32286
2015-09-28 23:18:59 +00:00
Arnold Schwaighofer
d64d9d11e6 Docs: Fix typos in ARCOptimization.rst
Swift SVN r29398
2015-06-16 14:51:59 +00:00
Andrew Trick
41cf8608cb Add is_unique documentation.
I also added a placeholder for ARC optimization docs. I wanted anyone
reading about swift ARC optimization to run across my discussion on
correctness w.r.t. COW.

Swift SVN r27890
2015-04-28 22:54:26 +00:00