Commit Graph

4421 Commits

Author SHA1 Message Date
Dave Abrahams
d00e888d95 [stdlib] Rename reinterpretCast => unsafeBitCast
Also give unsafeBitCast an explicit type parameter.  So

  let x: T = reinterpretCast(y)

becomes

  let x = unsafeBitCast(y, T.self)

Swift SVN r20487
2014-07-24 13:17:36 +00:00
Jordan Rose
b6818046a8 Eliminate optimization levels 0-3 in favor of -Onone/-O/-Ofast.
We were already effectively doing this everywhere /except/ when building
the standard library (which used -O2), so just use the model we want going
forward.

Swift SVN r20455
2014-07-24 01:12:59 +00:00
Jordan Rose
836c9d6eb4 Rename -Ofast to -Ounchecked.
<rdar://problem/17202004>

Swift SVN r20454
2014-07-24 01:12:56 +00:00
Andrew Trick
f36ff584cf Add array.init semantics.
This way, array optimization can see initialization as a copy of the
whole array value into a local variable, regardless of whether it's
from a factory method or Array initializer.

I'm making an assumption that when we return an Array by value, we
can't have an alias of the array buffer without retaining it.

Swift SVN r20444
2014-07-23 23:25:17 +00:00
Dave Abrahams
d44a953d1d [docs] comment out nonsens ReST, which breaks the build
Swift SVN r20391
2014-07-23 12:45:20 +00:00
Dave Abrahams
2f89b3be83 [docs] Fix Sphix error, which breaks the biuld
Swift SVN r20390
2014-07-23 12:45:19 +00:00
Dave Abrahams
6735788ed0 [docs] fix broken ReST, which breaks build
Swift SVN r20389
2014-07-23 12:41:16 +00:00
Dmitri Hrybenko
64fca20615 docs: add policy for access control in stdlib
Swift SVN r20385
2014-07-23 09:40:55 +00:00
Dmitri Hrybenko
5a5525d005 Remove some temporary files
Swift SVN r20383
2014-07-23 08:41:45 +00:00
John McCall
1ae1f750d0 Move most type metadata lookups into their own readnone
functions, and make those functions memoize the result.

This memoization can be both threadsafe and extremely
fast because of the memory ordering rules of the platforms
we're targeting: x86 is very permissive, and ARM has a
very convenient address-dependence rule which happens to
exactly match the semantics we need.

Swift SVN r20381
2014-07-23 07:38:26 +00:00
Dave Abrahams
1438d617cd [stdlib] Rename ConstUnsafePointer=>UnsafePointer
Swift SVN r20318
2014-07-22 17:10:54 +00:00
Dave Abrahams
21669b3aee [stdlib] Add "Mutable" to [Autoreleasing]UnsafePointer
UnsafePointer becomes UnsafeMutablePointer
AutoreleasingUnsafePointer becomes AutoreleasingUnsafeMutablePointer

Swift SVN r20316
2014-07-22 16:56:23 +00:00
Dmitri Hrybenko
d14f17beef Change 'getLogicValue()' into a property 'boolValue'; change
'getArrayBoundValue()' into a property 'arrayBoundValue'.

rdar://17156123


Swift SVN r20304
2014-07-22 12:08:10 +00:00
Chris Lattner
bc481f0fe1 implement <rdar://problem/16859927> remove the underscore in "auto_closure"
autoclosure is one work, not two.



Swift SVN r20253
2014-07-21 15:23:50 +00:00
John McCall
e848559bb5 Update ABI.rst for several months of changes to the
class metadata layout.

Swift SVN r20197
2014-07-19 00:57:47 +00:00
Joe Groff
c556d92ccd SILGen: Implement codegen for lvalue ForceValueExprs.
Add a set of _preconditionOptionalHasValue intrinsics that merely test that an optional has a case. Emit an lvalue ForceValueExpr as a physical lvalue, first asserting the precondition then projecting out the Some payload.

Swift SVN r20188
2014-07-18 22:49:49 +00:00
Dave Abrahams
71913ae085 [stdlib] Rename @semantics for array bounds checks
There are two kinds of bounds check: valid for subscripting, and valid
as an index.  Rename the semantics accordingly.

Swift SVN r20181
2014-07-18 20:54:26 +00:00
Dmitri Hrybenko
4c4f83fb52 stdlib: underscore-prefix requirements of _BridgedToObjectiveCType and
_ConditionallyBridgedToObjectiveCType protocols

rdar://17283639


Swift SVN r20079
2014-07-17 09:42:19 +00:00
Joe Groff
a14a94942d SILGen: Give dynamic thunks a proper mangling.
This lets us make them 'shared' and teach the demangler about them.

Swift SVN r19945
2014-07-14 21:01:45 +00:00
Joe Groff
c719314c4b Update C pointer interop spec with the state of the implementation.
UTF16 and 32 string interop is to-be-implemented, and ConstUnsafePointer<Void> parameters have some type-checking issues with literal arguments.

Swift SVN r19943
2014-07-14 20:29:35 +00:00
Dave Abrahams
9c6d9907a8 [docs] Correct a missed protocol rename in LangRef
Swift SVN r19936
2014-07-14 17:35:33 +00:00
Chris Lattner
57cd2506ff Change "operator infix" to "infix operator" for consistency with the rest of the declaration
modifiers and with the func implementations of the operators.  This resolves the rest of:
<rdar://problem/17527000> change operator declarations from "operator prefix" to "prefix operator" & make operator a keyword




Swift SVN r19931
2014-07-14 16:39:10 +00:00
Chris Lattner
8991456ff2 Switch infix/postfix/prefix to be declaration modifiers instead of attributes,
eliminating the @'s from them when used on func's.  This is progress towards
<rdar://problem/17527000> change operator declarations from "operator prefix" to "prefix operator" & make operator a keyword

This also consolidates rejection of custom operator definitions into one
place and makes it consistent, and adds postfix "?" to the list of rejected
operators.

This also changes the demangler to demangle weak/inout/postfix and related things
without the @.



Swift SVN r19929
2014-07-14 15:51:49 +00:00
Dave Abrahams
6d1095f44e Protocol names end in "Type," "ible," or "able"
Mechanically add "Type" to the end of any protocol names that don't end
in "Type," "ible," or "able."  Also, drop "Type" from the end of any
associated type names, except for those of the *LiteralConvertible
protocols.

There are obvious improvements to make in some of these names, which can
be handled with separate commits.

Fixes <rdar://problem/17165920> Protocols `Integer` etc should get
uglier names.

Swift SVN r19883
2014-07-12 17:29:57 +00:00
Joe Groff
ed35c76fe4 Remove discussion of type sugar from C pointer interop docs.
Swift SVN r19710
2014-07-08 23:14:24 +00:00
Andrew Trick
c86df0bbde Array semantics docs. Reword a few things and incorporate DaveA feedback.
Swift SVN r19688
2014-07-08 17:29:28 +00:00
Nadav Rotem
73e07f3616 Add a link to the high-level optimizations document.
Swift SVN r19677
2014-07-08 04:11:09 +00:00
Nadav Rotem
0eedfdc53e Rename pure->readonly.
Swift SVN r19676
2014-07-08 03:39:48 +00:00
Nadav Rotem
c8309a3b81 Document the "pure" attribute.
Swift SVN r19657
2014-07-08 00:49:17 +00:00
Joe Groff
03c9f871d2 IRGen/Runtime: Add a "primary generic parameters" count to generic parameter descriptors.
lldb needs this to be able to tell how many generic parameters are actually needed to instantiate a generic type. Fixes <rdar://problem/17425286>.

Swift SVN r19573
2014-07-04 19:34:11 +00:00
Andrew Trick
6326182665 More precise semantics on array.check_bounds.
Swift SVN r19526
2014-07-03 20:09:04 +00:00
Andrew Trick
f0f55c04a1 Array docs. Minor wording.
Swift SVN r19516
2014-07-03 16:57:40 +00:00
Andrew Trick
544e316bf5 Explain array.check_bounds semantics.
Swift SVN r19515
2014-07-03 16:54:56 +00:00
Andrew Trick
6df1205130 Documenting the Array semantic model.
Swift SVN r19498
2014-07-03 02:03:23 +00:00
Joe Groff
89c7e773ca Fix rst errors.
Swift SVN r19478
2014-07-02 19:17:39 +00:00
Nadav Rotem
43bff1aa70 Add an example of array bytecode.
Swift SVN r19476
2014-07-02 18:56:32 +00:00
Nadav Rotem
0fe142e2b5 Update the intro section of the doc.
Swift SVN r19475
2014-07-02 18:48:11 +00:00
Nadav Rotem
4c2aa4a60a Document our high-level SIL optimizations using @semantics
Swift SVN r19472
2014-07-02 18:30:44 +00:00
Jordan Rose
38d3a9c9cf Move Access Control plan of record to docs/.
Also, sort the table of contents alphabetically...except that "Various
Design Decisions" and LangRefNew stay at the top.

Swift SVN r19445
2014-07-02 01:07:26 +00:00
Dmitri Hrybenko
69a0e18f08 Revert "docs/StringDesign: remove a paragraph about a deviation from Unicode in"
This reverts r19396.

Swift SVN r19400
2014-07-01 15:21:44 +00:00
Dmitri Hrybenko
3248c3bbe2 docs/StringDesign: remove a paragraph about a deviation from Unicode in
regional indicator handling.  There is no contradiction here: regional
indicators are allowed in groups of two, should not be split by grapheme
cluster segmentation algorithm, and the producer of the text is
responsible for not putting more than two regional indicators
consecutively.

Swift SVN r19396
2014-07-01 13:18:22 +00:00
John McCall
e1456005ca Update SIL.rst for the change to the checked_cast instructions.
I still owe an update for the checked_cast_addr instructions.

Swift SVN r19057
2014-06-20 22:51:22 +00:00
Doug Gregor
e47b0c220f Address Dmitri's review comments
Swift SVN r19047
2014-06-20 13:57:00 +00:00
Doug Gregor
22dc55058e Make bridgeFromObjectiveC return non-optional.
Now that we use bridgeFromObjectiveCConditional to perform conditional
bridging, make bridgeFromObjectiveC handle forced bridging. For the
latter, deferred checking is acceptable.

Almost all of <rdar://problem/17319154>.


Swift SVN r19046
2014-06-20 13:15:41 +00:00
Michael Gottesman
c20c41c8a9 Fix two typos in SIL.rst I noticed upon visual inspection.
Swift SVN r19032
2014-06-20 04:45:18 +00:00
Adrian Prantl
ce73d6e50d Fix a documentation build error I introduced together with this file.
Swift SVN r19023
2014-06-20 01:16:40 +00:00
Adrian Prantl
cf66ae0bd4 Start to document the DWARF debug info the Swift compiler is emitting so
we have an authoritative reference for compiler, lldb, and other consumers.

Swift SVN r19014
2014-06-19 21:37:02 +00:00
Jordan Rose
a526eaea4f [docs] Bump copyright.
Swift SVN r18967
2014-06-18 00:03:27 +00:00
Jordan Rose
0e6999c2b1 AccessControl: change "generic parameters" to "generic argument types".
As Doug noted, generic parameters don't have accessibility independent from
the generic type. It's the actual argument types (when forming a bound type)
that may be more limited.

Swift SVN r18966
2014-06-17 23:39:29 +00:00
Jordan Rose
a3005114bd Update access control proposal based on today's discussion.
Also add a section on "Non-Goals: 'class-only' and 'protected'".

Swift SVN r18965
2014-06-17 23:23:50 +00:00