Commit Graph

21492 Commits

Author SHA1 Message Date
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
Arnold Schwaighofer
45ffb41adf Remove AssertDebug hack and fixup make files
When we build the standard libary with -parse-stdlib the frontend sets the
assert configuration to 'DisableReplacement'. Constant replacement does not take
place and the call to the builtin function 'assert_configuration' call stays in
the serialize SIL of the swiftmodule.

IRGen replaces the function call to the assert_configuration builtin function by
the value for Debug (0). The resuling standard library dylib hence contains the
debug version of the standard library assert function.

Frontend optimization flags can now determine whether asserts should be executed
or not.

This commit removes the SWIFT_ASSERTS cmake flag.

rdar://16458612

Swift SVN r16473
2014-04-17 22:05:43 +00:00
Dave Zarzycki
211afa943f Runtime: better crash debugging/reporting
Swift SVN r16426
2014-04-16 21:37:16 +00:00
Enrico Granata
942676abb2 Everyone loves a good Mirror, and this commit has plenty of them!
With this check-in, we get Mirrors for IntXX, UIntXX, Float32, and we don't lose the existing ones for Double, Int, String and Bool

This fixes rdar://16517273 and will make playgrounds able to display more data more often more consistently!



Swift SVN r16418
2014-04-16 17:16:06 +00:00
Doug Gregor
b74c29eb64 Fix linking of the crash reporter client.
Swift SVN r16381
2014-04-15 23:45:15 +00:00
Enrico Granata
e86fc505e4 '6AppKit' is 7 characters, not 8
Swift SVN r16380
2014-04-15 23:39:33 +00:00
Dave Zarzycki
43ee06e3cc Runtime: abort if ObjC code tries to manually allocate a pure swift class
Related: <rdar://problem/16531502>

Swift SVN r16378
2014-04-15 22:26:05 +00:00
Enrico Granata
b7372d3ccc r16374 won't do us any good without this
Swift SVN r16375
2014-04-15 19:08:27 +00:00
Ted Kremenek
3fff062f8d Extend print(Double) precision to 15 digits.
Double's like '0.9999999' were being printed as '1.0'.

'print' isn't a first-class I/O library anyway; it's main use right
now is accurate reporting in the REPL.

Fixes <rdar://problem/16603548>.

Swift SVN r16305
2014-04-14 07:13:15 +00:00
Enrico Granata
77e57c99c4 Enable the runtime to discover protocol conformances for types wrapped from ObjC
The strategy we are using is to obtain the class name from the ObjC runtime (as apparently nominal type descriptor for ObjC-wrapped types do not contain a useful name string) and then crafting the appropriate mangled name for the witness
Also, make AppKit another source of conformances. We currently have custom conformances for Reflectable that we are in Foundation (NSURL) and AppKit (NSView) - if more modules need to have custom mirrors, we might end up having to expand the list



Swift SVN r16280
2014-04-13 17:11:54 +00:00
John McCall
862d50ac1c Change the layout of opaque existentials so that
the value buffer comes first.

The motivation for doing this is similar to the
motivation for moving it for class existentials:
it eliminates the need for an offset for the most
common accesses, which is particularly important
for the generic value witnesses.

Also try to hard-code that layout in fewer places,
or at least static_assert the places that have to
do so.

Swift SVN r16279
2014-04-13 07:43:08 +00:00
Doug Gregor
8d4964bc98 Turn on namespacing of Objective-C class names.
The actual logic to do this is simple; the vast majority of this
commit is just a pile of changes to test cases to reflect the fact
that Objective-C metadata now includes the module name for each class
and the mangling of Swift-defined @objc classes no longer goes into
the "So" namespace for Objective-C classes. Finishes
<rdar://problem/15506580>.


Swift SVN r16274
2014-04-13 04:48:53 +00:00
John McCall
46d35ed288 Change the layout of class existentials to put the instance
pointer first.

This most important effect of this is that accesses to that
field don't need to be dynamically offsetted past an arbitrary
number of value witnesses, which is pretty nice for the
generic value witnesses.

Swift SVN r16243
2014-04-12 02:13:16 +00:00
Joe Groff
d1121a3d86 Reflection: Blacklist NSURL from default mirror functionality.
Its layout information in the ObjC runtime is a complete lie, so we crash if we try to use it to introspect the object. Fixes <rdar://problem/16592777>.

Swift SVN r16228
2014-04-11 21:05:34 +00:00
Dmitri Hrybenko
b94b1bcc65 Un-disable XCTest build that I accidentally disabled
Swift SVN r16202
2014-04-11 06:33:01 +00:00
John McCall
78506ba43e Introduce infrastructure for emitting value witness
tables for non-constant-sized types, and use it for
the existential witness tables.  NFC.

Swift SVN r16199
2014-04-11 05:22:05 +00:00
Joe Groff
f57de31a04 Reflection: Quell some build warnings.
Swift SVN r16172
2014-04-10 22:35:35 +00:00
Dmitri Hrybenko
110f85bc16 Move @exported to use new attribute infrastructure
Swift SVN r16158
2014-04-10 13:35:35 +00:00
Dave Zarzycki
d5452d84c4 SDK Overlay: Add Darwin overlay
Swift SVN r16140
2014-04-10 00:04:03 +00:00
John McCall
85a6cc1309 Make it really easy to generate value witness tables
from C++ types and aggregates thereof.

Swift SVN r16139
2014-04-10 00:01:34 +00:00
Dave Abrahams
f4b04760c8 [stdlib] Add a lazy "Map" Collection
The name may have the wrong implication to a C++'er, but the point is
that this Collection is a Lazy version of the map() function.  Maybe we
should be giving our Collections capitalized lazy versions of their
member algorithms, e.g.

  a.Map {something}

Swift SVN r16110
2014-04-09 09:43:22 +00:00
Dave Abrahams
3de27d2179 [stdlib] Array: add bridgeCache/fix refCounting
Array's getObjects:range: needs to fill the supplied buffer without
incrementing the reference count.  For that reason, and to fulfill
lifetime expectations for Array elements that are computed
dynamically (e.g. from value types that are BridgedToObjectiveC), we
maintain a cache of converted objects associated with each Array.

Swift SVN r16105
2014-04-09 07:59:43 +00:00
Dmitri Hrybenko
98c429ee2b Untabify
Swift SVN r16104
2014-04-09 07:28:59 +00:00
Dave Abrahams
de3df28a62 [stdlib] Reorganize [Native]Array/Slice code
Just moving things between files, and creating a few new source files, in
the standard library, so it's easier to find a given component.

Swift SVN r16094
2014-04-09 02:32:15 +00:00