Commit Graph

21502 Commits

Author SHA1 Message Date
Dave Abrahams
91bed93ca5 stdlib: add a stub ObjC root class to force correct bookkeeping in the compiler
Swift SVN r14864
2014-03-10 07:46:03 +00:00
Dave Abrahams
7a91b9f749 [stdlib] Remove *, /, and % from RandomAccessIndex
Before this commit, RandomAccessIndex was a refinement of
NumericOperations, which forced it to support inappropriate operations
such as multiplication.  Many obvious random-access index types can't
support multiplication (e.g. a StridedIndex adapter, which moves its
underlying index by N positions for each increment).

Along the way:

* the addition and subtraction operations on RandomAccessIndex were
  renamed to advancedBy and distanceTo, which prevents nasty ambiguities
  when a type conforms to both RandomAccessIndex and Integer, and allows
  Index DistanceTypes to actually be signed integers even when the Index
  is unsigned.

* Before this commit, using internal interfaces, it was possible to
  request static checking without also getting dynamic checks when
  static checking is impossible.  Now the relationship between static
  and dynamic checking is built into the core protocols.

* NumericOperations.swift was moved into IntegerArithmetic.swift.gyb,
  correcting missing operators by generating them programmatically and
  in preparation for renaming the protocol to something more appropriate

Fixes

  <rdar://problem/16246927> RandomAccessIndex is over-constrained

and possibly:

  <rdar://problem/15605729> Make all operators generic over
  protocols (in particular, get NumericOperations done)

Swift SVN r14854
2014-03-09 19:56:18 +00:00
Dave Abrahams
469f8629c6 [stdlib] OpaqueString is still an essential source
Swift SVN r14852
2014-03-09 19:56:16 +00:00
Dave Abrahams
6732cc1c4d [stdlib] Bugfix for essential sources check
I was using the wrong variable name in CMakeLists.txt

Swift SVN r14851
2014-03-09 19:56:15 +00:00
Joe Groff
2f720aebdb Reflection: Add a 'disposition' property to Mirror.
Playgrounds want to present aggregate-like values with fixed children, such as structs and classes, differently from container-like values with variable amounts of children, like arrays and dictionaries, so add a property to Mirror that describes the disposition of the value being reflected.

Swift SVN r14827
2014-03-08 05:37:56 +00:00
Dave Abrahams
0ec3ead12b [stdlib] Link an essential core library subset
To support layering improvements, add an (optionally built) "essential
core" library containing the minimum set of files required just to link
successfully.  Right now all those object files are linked again into
swift_stdlib_core; it would probably be better to link the essential
core into the core, but my CMake/Swift Driver fu is not strong enough
and this will at least help during development.

Along the way, removed the obsolete SwiftStdlibSources.txt file, as we
only have to support one build system now.

Swift SVN r14792
2014-03-07 21:01:49 +00:00
Greg Parker
338cb2b718 Add an outrageous hack to swift_allocBox() to fix arm (rdar://16257592).
Swift SVN r14771
2014-03-07 05:37:14 +00:00
Joe Groff
da7880b0e4 Drop unnecessary 'swift_compareObjects' and 'swift_hashObject' stubs.
Swift SVN r14769
2014-03-07 03:21:32 +00:00
Joe Groff
7405f4bc77 Runtime: Fix layout of Optional<QuickLookObject> to match Swift's.
Damn tail-alignment. Try a little harder to test quickLookObject on the Swift side too.

Swift SVN r14760
2014-03-06 22:56:17 +00:00
Joe Groff
3d93acb81b stdlib: Remove the 'Object' class.
It's dead, Jim. Also remove 'ClassNameable' since we don't use it for anything.

Reapply r14647 now that John fixed the serialization issue that scuttled it last time.

Swift SVN r14722
2014-03-06 04:53:25 +00:00
Joe Groff
76870a7a8f Reflection: Try an ObjC object as its own debugQuickLookObject.
If the object doesn't respond to -debugQuickLookObject, check if the object itself is a quick look object.

Swift SVN r14673
2014-03-05 05:34:52 +00:00
Chris Lattner
d758e0dfe3 Eliminate more "DynamicLookup" in favor of "AnyObject", this is the
bulk of finishing rdar://13327098.


Swift SVN r14653
2014-03-04 22:15:46 +00:00
Dave Abrahams
b0b08887e1 [stdlib] Remove unused BridgeObjectiveC.mm
Swift SVN r14652
2014-03-04 21:19:53 +00:00
Joe Groff
c572cc222c Revert "stdlib: Push '===' for AnyObject into stdlib/core."
This reverts commit r14646. It exposes an optimizer bug.

Swift SVN r14649
2014-03-04 17:39:15 +00:00
Joe Groff
565f889fe8 Revert "stdlib: Remove the 'Object' class."
This reverts commit r14647. It exposes an optimizer bug.

Swift SVN r14648
2014-03-04 17:39:06 +00:00
Joe Groff
59426904e2 stdlib: Remove the 'Object' class.
It's dead, Jim. Also remove 'ClassNameable' since we don't use it for anything.

Swift SVN r14647
2014-03-04 17:14:27 +00:00
Joe Groff
5634ff5e67 stdlib: Push '===' for AnyObject into stdlib/core.
And drop the 'Identifiable' protocol.

Swift SVN r14646
2014-03-04 17:04:50 +00:00
Joe Groff
024b5c0542 runtime: Use -debugQuickLookObject to get text or image quick look objects.
In response to feedback from the Xcode team, change the 'IDERepresentable' type from a protocol into an enum with a limited set of tags, starting with 'Text' and 'Image' for now. In the ObjC mirror, if the ObjC object has a -debugQuickLookObject method, use it to get an object we can try to map to the enum.

Swift SVN r14632
2014-03-04 04:56:54 +00:00
Joe Groff
c752d4e806 runtime: Include the superclass as a child when reflecting ObjC classes.
And stop walking Classes as regular objects—the "isa" chain just noises up the object graph.

Swift SVN r14631
2014-03-04 03:54:32 +00:00
Joe Groff
5af4e7255b Runtime: Start implementing a default Mirror for ObjC classes.
For ObjC classes, use class_copyIvarList to walk the ivars, and produce the summary string using -debugDescription. Still to come:

- visiting the base class as a child, and
- calling -debugQuickLookObject to get the quicklook object. Still waiting on a final design for the IDERepresentation API.

Swift SVN r14626
2014-03-04 01:42:19 +00:00
Jordan Rose
38d176db82 Add a block shim for 'void(^)(NSObject*)'.
Used by XPC.

<rdar://problem/16202338>

Swift SVN r14614
2014-03-03 22:16:08 +00:00
Joe Groff
eafc9ef137 Runtime: Have MagicMirror produce object identifiers for class values.
Swift SVN r14608
2014-03-03 21:20:05 +00:00
Adrian Prantl
649ce05ff9 silence warnings.
Swift SVN r14534
2014-02-28 20:53:04 +00:00
Dave Zarzycki
46d7fc8a46 Runtime: hardcode less about the OS implementation
This also fixes non-fast-path platforms.

Swift SVN r14481
2014-02-27 22:15:22 +00:00
Doug Gregor
904739cb03 Revert "Runtime: hardcode less about the OS implementation"
This reverts r14453, which seems to be breaking the build.

Swift SVN r14480
2014-02-27 21:43:56 +00:00
Dave Zarzycki
5946a56fa3 Runtime: hardcode less about the OS implementation
There is still more to do in this area before we GM.

Swift SVN r14453
2014-02-27 06:14:53 +00:00
Dave Abrahams
c33a59c6a7 [build] Complete gyb support
Remove all gyb-generated files and generate them automatically from .gyb
files.  Rename the proof-of-concept UnsafeArray.swift.gyb back to
UnsafeArray.swift.  Never forget to update the .gyb file or regenerate
again!

Swift SVN r14445
2014-02-27 03:01:16 +00:00
Dave Abrahams
69c1a857f9 [build] Basic support for gyb
Now a "foo.bar.gyb" file in a list of sources gets automatically
processed through gyb to produce "foo.bar"

Renamed a simple .swift file in the stdlib (which needs a rename anyway)
to have a .gyb extension as a proof-of-concept.

To make this useful for our existing gyb files, we need to figure out
how to pass them the right arguments; that's coming next.

Swift SVN r14444
2014-02-27 02:23:11 +00:00
Chris Lattner
3f5255fa2c update gyb files for val -> let.
Swift SVN r14442
2014-02-27 02:15:03 +00:00
Joe Groff
f02f4314eb Update original .gyb file for FixedPoint*.swift.
Swift SVN r14437
2014-02-27 01:07:56 +00:00
Dave Zarzycki
056091461e runtime: fix a build failure with the simulator
Swift SVN r14432
2014-02-26 23:52:43 +00:00
Dave Zarzycki
f8be3a9f1e runtime: always provide swift_retainAndReturnThree()
We've disabled the fast entry points for now on the simulator, but the
ARC optimizer doesn't know that. This is a workaround.

Swift SVN r14425
2014-02-26 23:28:27 +00:00
Dave Zarzycki
33f6978eeb runtime: make the "FastEntryPoints" header and implementation agree
Swift SVN r14421
2014-02-26 22:48:32 +00:00
Ted Kremenek
028f9d0561 Remove rest of Makefile build except for 'docs' and 'www'.
For 'docs' and 'www' it is possible these are still being used,
as they work independent of the Makefile build.  Keeping them for now.

Swift SVN r14418
2014-02-26 22:21:25 +00:00
Dave Zarzycki
ab1efa6ec7 runtime: DI means we don't need heap APIs that take/return zero-initialized memory
Swift SVN r14404
2014-02-26 20:31:11 +00:00
Dave Zarzycki
6e1fcdab30 runtime: Make gmalloc work again
<rdar://problem/16165307> Infinite recursion in malloc_zone_malloc when Reflection test is run under guard malloc

Swift SVN r14398
2014-02-26 17:59:27 +00:00
Dave Zarzycki
52ef19fd3e runtime: route more of the heap through the formal zone
Swift SVN r14397
2014-02-26 17:49:54 +00:00
Dave Zarzycki
8fd6b3a4ab runtime: disable the malloc cache entirely for the simulator
Swift SVN r14396
2014-02-26 17:18:31 +00:00
Joe Groff
98d6fecc99 '.metatype' -> '.Type'
Also, reserve 'type' as a keyword for ensuing syntax changes.

Swift SVN r14375
2014-02-26 04:23:21 +00:00
Greg Parker
17628ee626 Disable swift allocation cache pending rdar://16168244.
Swift SVN r14366
2014-02-26 01:37:36 +00:00
Jordan Rose
90f90c7fdd [CMake] Clear the Clang module cache before building the ObjectiveC overlay.
This will catch almost all module cache errors during compiler / stdlib
development, at the cost of slowing down rebuilds of the overlay modules
a bit.

Swift SVN r14364
2014-02-26 01:12:19 +00:00
Dave Abrahams
aa97136232 [stdlib] Replace all uses of ~> with boilerplate
Swift SVN r14314
2014-02-24 21:08:07 +00:00
Dave Abrahams
28e67eb007 [stdlib] Backport edit to FixedPoint.gyb
r13988 made the change to the generated files, but not the source.

Swift SVN r14310
2014-02-24 19:50:28 +00:00
Dmitri Hrybenko
3da05e347d Change property accessor syntax to include braces
See release notes update for details.

rdar://15966905


Swift SVN r14271
2014-02-22 21:00:56 +00:00
Dave Zarzycki
058ab5a6a1 Runtime: Add assert.h
Swift SVN r14259
2014-02-22 14:31:28 +00:00
Doug Gregor
2d08827a8a Fix trivial build issues
Swift SVN r14241
2014-02-21 23:21:11 +00:00
Chris Lattner
c4d774fa88 unbreak the makefile build.
Swift SVN r14231
2014-02-21 21:52:40 +00:00
Dave Zarzycki
aebc28f7fe Runtime: silence a harmless warning
Swift SVN r14229
2014-02-21 20:37:22 +00:00
Dave Zarzycki
a85b2a3d78 Runtime: Rename Alloc.* to HeapObject.* (NFC)
Swift SVN r14228
2014-02-21 20:12:07 +00:00
Dave Zarzycki
d0696c60fc Runtime: Move heap logic to Heap.cpp (NFC)
Swift SVN r14227
2014-02-21 20:12:01 +00:00