Commit Graph

45 Commits

Author SHA1 Message Date
Maxwell Swadling
b3253f7651 [stdlib] Changed uintValue to a var
Fixes rdar://problem/18469215

Swift SVN r24118
2014-12-23 20:11:51 +00:00
Joe Groff
dc4ada34ff Revert "Fix doc comment for ObjectIdentifier.uintValue"
This reverts commit r23742. Brain fart on my part.

Swift SVN r23746
2014-12-05 22:58:46 +00:00
Joe Groff
ee5adc1f6e Runtime: Provide reflection for metatypes.
Metatypes have no user-visible structure, but can at least summarize as their type names. This gives us reasonable ad-hoc Printable behavior (thought debugPrint is still wrong, since a type name isn't parsable without being .self'ed).

Swift SVN r23745
2014-12-05 22:58:44 +00:00
Joe Groff
c744c5ec30 Fix doc comment for ObjectIdentifier.uintValue
Identifier equality is equivalent to identity, not value equality.

Swift SVN r23742
2014-12-05 21:25:49 +00:00
Graham Batty
dc6a776d10 stdlib: Use config directives to work without objective-c.
Swift SVN r23211
2014-11-10 20:06:25 +00:00
Graham Batty
373414864d Revert "Use config directives to carve out a 'portable' kernel stdlib."
This reverts commit r23202 pending further discussion.

Swift SVN r23205
2014-11-10 18:46:42 +00:00
Graham Batty
dfa260fab1 Use config directives to carve out a 'portable' kernel stdlib.
Swift SVN r23202
2014-11-10 18:03:09 +00:00
Maxwell Swadling
10464d0478 Added Comparable to ObjectIdentifier
Swift SVN r23172
2014-11-08 02:06:24 +00:00
Dave Abrahams
d2a7b58f03 [stdlib] Remove all FIXMEs from doc comments
Fixes <rdar://problem/18457701>

Swift SVN r23007
2014-10-29 19:35:25 +00:00
Erik Eckstein
f82dbb8176 Revert "[stdlib] Make some structs public which adopt MirrorType, because the conformances are accessed in Reflection.nm"
Commited by mistake. Accessing a protocol conformance from "outside" does not require the conforming type to be pulic.



Swift SVN r22968
2014-10-27 15:37:33 +00:00
Erik Eckstein
f0a36557e1 [stdlib] Make some structs public which adopt MirrorType, because the conformances are accessed in Reflection.nm
Swift SVN r22967
2014-10-27 15:19:14 +00:00
Erik Eckstein
b51b3ed123 Mark public compiler intrinsics with // COMPILER_INTRINSIC
I followed Joe's example in Process.swift and used COMPILER_INTRINSIC (and not just INTRINSIC)



Swift SVN r22723
2014-10-14 07:32:03 +00:00
Erik Eckstein
60dcb9a435 Make compiler intrinsics public (part 2).
With the changed SILLinkage and dead function removal of internal functions this is necessary.



Swift SVN r22490
2014-10-03 13:58:50 +00:00
Dave Abrahams
a7f3e4222e [stdlib] finish public non-protocol docs
The 58 undocumented public non-operator APIs still present in core are
all on non-exposed (underscored) APIs.

Swift SVN r22263
2014-09-24 12:31:45 +00:00
Dave Abrahams
795799b0d2 [stdlib] Propagate Hashable docs
202 undocumented public non-operator APIs remain in core

Swift SVN r22241
2014-09-23 23:35:58 +00:00
Dave Abrahams
dbde275230 [stdlib] Propagate Reflectable docs
230 undocumented public non-operator APIs remain in core

Swift SVN r22236
2014-09-23 23:08:43 +00:00
Dave Abrahams
5c85fa5b7d [stdlib] Document Reflection protocols
Swift SVN r22100
2014-09-18 21:15:39 +00:00
Dmitri Hrybenko
6a85dc4c0f stdlib: fix strange indentation
Swift SVN r21769
2014-09-08 08:33:37 +00:00
Dmitri Hrybenko
8150b9296b stdlib: fix leaks of Swift.String when passing them from runtime to
Swift (in mirrors and demangling)

Swift SVN r20823
2014-07-31 14:48:54 +00:00
Dmitri Hrybenko
bdc78be4e5 Reflection: reorder dump() arguments so that one can print to a stream and take
advantage of default values

Also, fix dump() to actually print everything into the supplied stream.


Swift SVN r20670
2014-07-29 15:07:25 +00:00
Dmitri Hrybenko
2324d843ec StdlibUnittest: demangle names in error output
Swift SVN r20515
2014-07-24 21:19:21 +00:00
Dmitri Hrybenko
c2adafc897 Revert "stdlib/String: change == to perform string comparison after NFD"
This breaks consistency between == comparison and hash value.

Swift SVN r20500
2014-07-24 17:28:40 +00:00
Dmitri Hrybenko
a3d5a8a0de stdlib/String: change == to perform string comparison after NFD
normalization

There is still some obscure bug with != on NSString, probably caused by
an ill-thought overload somewhere.

Part of rdar://17498444

Swift SVN r20495
2014-07-24 16:51:48 +00:00
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
Dmitri Hrybenko
09561ae6fa stdlib/Printing: when printing objects without Printable conformances, print
demangled names

rdar://16929868


Swift SVN r20386
2014-07-23 11:01:51 +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
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
Enrico Granata
2cd27ad3d2 Tweaks to get PlaygroundLogger to build and work in a world of accessibility-enforced rules
1) Add an ObjCObject disposition that tells us this Mirror is reflecting upon an ObjC-imported type
2) Change the default summary of _ClassMirror and _StructMirror to be the mangled typename, with no children count



Swift SVN r19817
2014-07-10 18:54:25 +00:00
Jordan Rose
da29f099f0 Update stdlib for accessibility modifiers becoming context-sensitive keywords.
Swift SVN r19672
2014-07-08 02:17:46 +00:00
Dmitri Hrybenko
594dfe5e2d stdlib: hide swift_MagicMirrorData_summaryImpl
rdar://17315534


Swift SVN r19568
2014-07-04 16:08:29 +00:00
Jordan Rose
5e59d30c6f Update stdlib for memberwise access control.
As before, there may be more things marked @public than we actually want
public. Judicious use of the frontend option -disable-access-control may
help reduce the public surface area of the stdlib.

Swift SVN r19353
2014-06-30 18:50:50 +00:00
Doug Gregor
bea1d3d9b3 Use dictionary type sugar in the standard library.
Swift SVN r19264
2014-06-26 22:26:58 +00:00
Doug Gregor
37df5c430c Update standard library to use [T] array syntax.
Swift SVN r19190
2014-06-25 23:39:20 +00:00
Jordan Rose
cca27d02a0 Tag everything in the standard library with accessibility attributes.
Keep calm: remember that the standard library has many more public exports
than the average target, and that this contains ALL of them at once.
I also deliberately tried to tag nearly every top-level decl, even if that
was just to explicitly mark things @internal, to make sure I didn't miss
something.

This does export more than we might want to, mostly for protocol conformance
reasons, along with our simple-but-limiting typealias rule. I tried to also
mark things private where possible, but it's really going to be up to the
standard library owners to get this right. This is also only validated
against top-level access control; I haven't fully tested against member-level
access control yet, and none of our semantic restrictions are in place.

Along the way I also noticed bits of stdlib cruft; to keep this patch
understandable, I didn't change any of them.

Swift SVN r19145
2014-06-24 21:32:18 +00:00
Chris Lattner
62cad3dce8 add a "..<" operator, which is an alias for ".." and switch the stdlib to use it.
Until I have a chance to update the testsuite, we'll accept both.



Swift SVN r18998
2014-06-19 05:42:29 +00:00
Enrico Granata
0134c6d197 Allow user-defined Swift classes to implement our API for QuickLooks, and have the result of that API be picked up by the Mirrors
This is our public API for how quicklooks work in the debugger, and the plan is to have this same API work in playgrounds as well

Fixes rdar://17023157


Swift SVN r18609
2014-05-24 01:00:46 +00:00
Enrico Granata
22329b3ac2 Extend the _OpaqueMirror to produce summaries that at least reflect the broad category of value being reflected
The <opaque> output is clearly useless, and annoying to see scattered around playgrounds

We don't have bandwidth right now to produce detailed useful reflection information, but at least show a basic understanding of data

Fixes part of rdar://17018392



Swift SVN r18607
2014-05-23 23:23:43 +00:00
Doug Gregor
bed81488c1 Revert r18232, r18220: we're not doing T* now.
Swift SVN r18250
2014-05-17 16:36:02 +00:00
Doug Gregor
73f02d1a69 Switch a bunch of UnsafePointer<T>'s over to T*
Swift SVN r18220
2014-05-16 22:32:01 +00:00
Arnold Schwaighofer
da6d9152b6 Differentiate between user assertion and preconditions and the like
assert() and fatalError()
These functions are meant to be used in user code. They are enabled in debug
mode and disabled in release or fast mode.

_precondition() and _preconditionFailure()
These functions are meant to be used in library code to check preconditions at
the api boundry. They are enabled in debug mode (with a verbose message) and
release mode (trap). In fast mode they are disabled.

_debugPrecondition() and _debugPreconditionFailure()
These functions are meant to be used in library code to check preconditions that
are not neccesarily comprehensive for safety (UnsafePointer can be null or an
invalid pointer but we can't check both). They are enabled only in debug mode.

_sanityCheck() and _fatalError()
These are meant to be used for internal consistency checks. They are only
enabled when the library is build with -DSWIFT_STDLIB_INTERNAL_CHECKS=ON.

I modified the code in the standard library to the best of my judgement.

rdar://16477198

Swift SVN r18212
2014-05-16 20:49:54 +00:00
Dmitri Hrybenko
92335b2f91 tdlib/Dictionary: address internal API review
Removed 'find:'
Added 'indexForKey:'


Swift SVN r18197
2014-05-16 16:03:56 +00:00
Ted Kremenek
9eea282719 Switch range operators ".." and "...".
- 1..3 now means 1,2
- 1...3 now means 1,2,3

Implements <rdar://problem/16839891>

Swift SVN r18066
2014-05-14 07:36:00 +00:00
Dmitri Hrybenko
2cc8fe40d4 stdlib/printing: replace four printing systems with one new one
The old ones were:

- print/println
- printAny
- printf
- Console

The new printing story is just print/println.  Every object can be printed.
You can customize the way it is printed by adopting Printable protocol.  Full
details in comments inside stdlib/core/OutputStream.swift.

Printing is not completely finished yet.  We still have ReplPrintable, which
should be removed, string interpolation still uses String constructors, and
printing objects that don't conform to Printable will result in printing
mangled names.


Swift SVN r18001
2014-05-13 13:07:59 +00:00
Ted Kremenek
fad874708e Adjust test cases.
Swift SVN r17964
2014-05-12 22:01:52 +00:00
Joe Groff
73e564428f stdlib/runtime: Stub out a mechanism for introspecting value structure.
Define a "Mirror" protocol with methods for querying the number of children a structured value has, getting the name and mirror for each of those children, and a string and "IDE representation" of the value, as needed by playgrounds and by our planned generic printing facility.

In the runtime, define a "reflect" function that can provide a Mirror for any object, either using a "Reflectable" protocol conformance if available, or falling back to a magic implementation in the runtime that grovels the type metadata. Stub out a bare minimum default implementation.

Swift SVN r14139
2014-02-20 08:26:27 +00:00