Commit Graph

21665 Commits

Author SHA1 Message Date
Dmitri Hrybenko
9d4bd6da69 stdlib: remove Keyboard
rdar://16205673


Swift SVN r17089
2014-04-30 13:00:08 +00:00
Dave Zarzycki
d0e88b4060 Mangler hack for various subsystems feedback
Swift SVN r17069
2014-04-30 04:20:54 +00:00
Dave Zarzycki
5338ad9223 Runtime: add a crude mangler for Interface Builder
Someday we'll have time to disentagle the real mangler from the rest of the compiler. For now, this is a hack.

<rdar://problem/16671220> Add a simple mangler API just for handling "Module.ClassName" and "Module.ProtocolName" cases

Swift SVN r17066
2014-04-30 03:13:23 +00:00
Dave Abrahams
efe08045ba [stdlib] Kill (Contiguous|Opaque)String
Detritus makes it hard to do API review, so kill it off.

Along the way we got a generic lexicographicalCompare algorithm.

Swift SVN r17064
2014-04-30 01:49:34 +00:00
Enrico Granata
4fb2175901 The default Mirror implementation used to have a special case for NSString-typed things, such that they would quicklook as their own string data
However, this broke for Swift subclasses of NSString because the Swift mirror took precedence over the ObjC NSString choice
Notably, it broke for NSContiguousString

This patch fixes that by explicitly making NSString reflectable, so that its subclasses will automagically do the right thing here

Fixes rdar://16758974



Swift SVN r17059
2014-04-30 00:06:54 +00:00
Enrico Granata
39a45d8004 Add a custom Mirror for NSRange, and export a Range(UInt64, UInt64) as the quicklook object for it
This is the last chunk of stdlib work for rdar://16681498


Swift SVN r17040
2014-04-29 19:11:07 +00:00
Enrico Granata
9ab5cea296 Add a new case to the QuickLookObject enum: Logical(Bool)
This is meant to represent to UI consumers the notion of a logical truth value
Previously, we were using a String case to represent such values, but that loses potentially useful information to UI layers

This fixes rdar://16719431



Swift SVN r17037
2014-04-29 16:36:40 +00:00
Joe Groff
71678b4bdf IRGen/Runtime: Expose the 'isBitwiseTakable' bit in the value witness flags.
Set a bit for types that are non-bitwise-takable, and calculate it as part of runtime struct and enum layout. Include 'bitwise takable' as part of the runtime 'is inline' calculation to be consistent with the compile-time policy change in r17008.

Swift SVN r17036
2014-04-29 15:23:14 +00:00
Dave Zarzycki
fae27e3357 Runtime: provide inline friendly isa mask/shift variables for 1.0
<rdar://problem/16663586> provide a global isa mask so v-table dispatch doesn't have to call object_getClass

Swift SVN r16980
2014-04-28 15:33:41 +00:00
Doug Gregor
18c4ef0cf0 Revert r16960, which is causing build failures due to missing _objc_debug_isa_class_mask.
Swift SVN r16978
2014-04-28 13:41:12 +00:00
Dave Abrahams
18c7b0e440 [stdlib] Kill StringByteData
StringByteData was legacy detritus containing an in-memory UTF8
representation of a Swift string.  Since we switched to a UTF16 base
representation, use the new stuff in StringUTF8 instead.

Swift SVN r16968
2014-04-28 08:32:41 +00:00
Dave Abrahams
1dd3b76e97 [stdlib] Add a lazy UTF8 view of String
We need something here so we can rip out StringByteData.  Ideally this
would have BidirectionalIndex'es, but this will do for now.  It has to
be a Collection so we can represent its multi-pass-ness.

Swift SVN r16966
2014-04-28 08:32:40 +00:00
Dave Zarzycki
e5f7cddded Runtime: provide inline friendly isa mask/shift variables for 1.0
<rdar://problem/16663586> provide a global isa mask so v-table dispatch doesn't have to call object_getClass

Swift SVN r16960
2014-04-28 05:47:55 +00:00
Ted Kremenek
49f393920a Rename bridging "convert" functions to start with '_'.
This is part of our poor-man's internal compiler SPI hiding
in the standard library.  We don't want these functions showing
up in code completion, etc.

Swift SVN r16916
2014-04-27 05:13:19 +00:00
Dave Zarzycki
6da5c57926 Runtime: part 1 of work to enable CoreData
Until we lock down the Swift ABI and ship with the OS, we need to be resilient
in the face of ObjC dynamic subclassing and OS changes. In practice, this means
that we need to have a swift runtime ABI to read the isa out of objects. I've
added it as of r. See: swift_getClassMetadata()

We can and will optimize swift_getClassMetadata into a single instruction once
we lockdown our ABI and ship with the OS.

See also: <rdar://problem/16735599>

Swift SVN r16889
2014-04-26 20:00:08 +00:00
John McCall
f3d4513721 Turn some 64-bit metadata fields into 32-bit fields.
We really don't need to support individual objects
this large, much less more than 4 billion fields in
a single type.

Also rearrange the fields to bring the instance
size/alignment fields closer to the class header,
just for a minor locality win.

Swift SVN r16879
2014-04-26 09:43:39 +00:00
Dave Zarzycki
ff84cce42b Runtime: conditional fallback to pthreads given we don't ship with the OS
<rdar://problem/15169581> Custom allocation cache cannot assume OS implementation details for 1.0

Swift SVN r16842
2014-04-25 20:57:03 +00:00
Dave Zarzycki
7fedcbcffc Runtime: standards compliance feedback
Swift SVN r16828
2014-04-25 18:28:26 +00:00
Dave Zarzycki
128027dd4d Runtime: abort on resurrection
Also fix a latent bug in the logic in the disabled code to scribble over memory durring dealloc.

<rdar://problem/15855042> QoI: abort on resurrection

Swift SVN r16827
2014-04-25 18:16:59 +00:00
Joe Groff
5c2bd67459 Runtime: Sync QuickLookObject in the runtime with recent stdlib additions.
Swift SVN r16823
2014-04-25 15:00:08 +00:00
John McCall
d9e4d6f2ad Add the Unmanaged library type.
Swift SVN r16796
2014-04-25 02:16:04 +00:00
Joe Groff
f29a156e83 IRGen/Runtime: Add value witness slots for array witnesses.
Add value witnesses for destroyArray, initializeArrayWithCopy, and initializeArrayWithTake{FrontToBack,BackToFront}, and fill out the runtime value witness table implementations. Stub out the IRGen ones for now.

Swift SVN r16772
2014-04-24 22:25:26 +00:00
Dave Zarzycki
5e5a369b96 Runtime: Renable proxying and dynamic cast support
As it turns out, Swift classes can stumble into having a non-pointer isa.
This might be a problem for 1.0, but that is beyond the scope of this bug.

Swift SVN r16721
2014-04-23 22:06:39 +00:00
Jordan Rose
0da44e23c3 [CMake] Only look for libCrashReporterClient.a in the SDK.
...if one is set.

Swift SVN r16718
2014-04-23 21:37:33 +00:00
Joe Groff
5ea0a0734e UIKit overlay: Add our own designated initializers for UIActionSheet and UIAlertView.
The true designated initializers take a variadic argument, which we can't directly support in Swift, so we'll map those definitions to refer to versions that drop the variadic parameters altogether, and reimplement the variadic interface in the overlay.

Swift SVN r16711
2014-04-23 19:52:39 +00:00
Greg Parker
be6ba21fd9 Revert r16648 because it crashes on arm64.
Swift SVN r16696
2014-04-23 09:11:36 +00:00
Greg Parker
b691055649 Fix an incorrect use of Swift metadata in an ObjC class. Add assertions to
catch such uses in the future.


Swift SVN r16695
2014-04-23 08:55:02 +00:00
Dave Zarzycki
f59141d434 Runtime: far better cmake logic for CrashReporter
From what I've been able to test, this does the right thing in all of the
scenarios I tested.

Swift SVN r16685
2014-04-23 03:45:07 +00:00
Ted Kremenek
03a8dc1f52 Remove linking CrashReportClient.a until the CMake logic is refined to be portable.
Currently this prevents building Swift on 10.9.

Right now CrashReportClient.a is used regardless of the SDK being used,
and the CMake logic does a check for the .a across different platforms
and SDKs without checking what the build product target OS actually is.
The current logic somewhat works because the SDKs will be in different
Platforms, but it is fragile.

Swift SVN r16678
2014-04-23 00:13:30 +00:00
Argyrios Kyrtzidis
65971bc7f4 [CMake] ObjectiveC module depends on the Darwin one.
Swift SVN r16675
2014-04-22 23:48:26 +00:00
Chris Lattner
411e5baf02 revert r16670, which included more than it should have.
Swift SVN r16671
2014-04-22 22:51:26 +00:00
Chris Lattner
4fc1154ca7 implement <rdar://problem/16692437> shadowing loop labels should be an error
Swift SVN r16670
2014-04-22 22:50:46 +00:00
Joe Groff
02e95c2866 stdlib: Use #if to clean up platform-dependent branching in VarArgs implementation.
NFC, but we kill a needless runtime stub.

Swift SVN r16669
2014-04-22 22:38:15 +00:00
Greg Parker
1121b2c132 Revert r16666 because I think my test configuration was wrong.
Swift SVN r16667
2014-04-22 22:24:57 +00:00
Greg Parker
629e7f59b4 Prevent direct ObjC isa dereference when using ObjCClassWrapperMetadata.
This fixes several tests on arm64.


Swift SVN r16666
2014-04-22 22:14:35 +00:00
Dave Zarzycki
15d7225d72 Runtime: more cmake fun
There really ought to be a better way to reason about the internal SDK.

Swift SVN r16649
2014-04-22 06:47:01 +00:00
Dave Zarzycki
61aec09671 Runtime: optimize dynamicCast for pure Swift scenarios
This is r16606 plus a fix to detect unsafe conditional dynamic casts of ObjC
objects.

Swift SVN r16648
2014-04-22 06:05:42 +00:00
Dave Zarzycki
ca34d1f438 Runtime: More internal SDK support
Swift SVN r16647
2014-04-22 05:38:23 +00:00
Dave Zarzycki
f84efe1da8 Runtime: more cmake internal SDK fun
Swift SVN r16642
2014-04-22 03:41:47 +00:00
John McCall
8681963bcb A couple of long-overdue renames.
Builtin.ObjectPointer -> Builtin.NativeObject
Builtin.ObjCPointer -> Builtin.UnknownObject

Swift SVN r16634
2014-04-22 00:17:08 +00:00
Greg Parker
b6a5152e09 Revert r16606 because it crashes on arm64.
Swift SVN r16629
2014-04-21 22:29:02 +00:00
Dave Zarzycki
accd058682 Runtime: fix a silly cmake mistake
Swift SVN r16626
2014-04-21 21:48:26 +00:00
Dave Zarzycki
f87e9ba3d5 Runtime: optimize dynamicCast for pure Swift scenarios
Swift SVN r16606
2014-04-21 04:34:09 +00:00
Dave Zarzycki
c3bc1fb9c4 Runtime: always inline our crash() function
This function only trashes one register on x86_64 and therefore makes crash
reports easier to debug.

Swift SVN r16604
2014-04-21 04:34:05 +00:00
Joe Groff
5b1f1f523d Runtime: Walk up superclass chains in swift_conformsToProtocol.
Fixes <rdar://problem/16624349>.

Swift SVN r16556
2014-04-18 23:41:44 +00:00
Joe Groff
ebe5f4620c Don't include the module in protocol conformance manglings.
The cost of hacks to swift_conformsToProtocol is starting to outweigh any benefit to being principled here. We'll get a linker error now if multiple modules declare a conformance for the same type to the same protocol, but that's arguably a good thing for 1.0 anyway, since we aren't set up to get that right in other ways.

Swift SVN r16554
2014-04-18 23:13:40 +00:00
Joe Groff
e5bb7741f4 #if out function that's unused without objc ivar introspection.
Swift SVN r16533
2014-04-18 17:23:07 +00:00
Ted Kremenek
423296e1fc Start generating embedded Info.plist files for Swift dylibs.
Swift SVN r16511
2014-04-18 07:48:45 +00:00
Joe Groff
a57e955635 Reflection: Disable visiting objc ivars in the default mirror.
We can't do this reliably without crashing, because framework types often lie about their layout and/or leave junk pointers in ivars.

Swift SVN r16491
2014-04-18 03:22:56 +00:00
Joe Groff
822aa300e8 Remove BlockShims.mm.
Swift SVN r16485
2014-04-18 01:07:12 +00:00