Commit Graph

14241 Commits

Author SHA1 Message Date
Doug Gregor
01f3f7777e Make _convertNSArrayToArray work for non-verbatim bridged types.
The runtime diagnostics here are awful, but the monkey dances
<rdar://problem/16899681>.



Swift SVN r18121
2014-05-15 19:25:58 +00:00
Doug Gregor
87904b8228 Make ImplicitlyUnwrappedOptional conform to _ConditionallyBridgedToObjectiveC.
This is a better solution to <rdar://problem/16899681> because the
runtime magic is limited to implementing the witnesses of this
conformance.

The type checker fixes are because we can end up using unchecked
optionals in more places, via bridging, than we could before.


Swift SVN r18120
2014-05-15 19:00:52 +00:00
Dave Abrahams
e1b37a8d91 [stdlib] WIP: complete up/down-cast testing for Arrays of verbatim-bridged elements
Swift SVN r18119
2014-05-15 18:37:06 +00:00
Joe Pamer
a74c44a6e4 Fix two crashing bugs related to checked downcasts - rdar://problem/16093456 and rdar://problem/16892211.
Swift SVN r18118
2014-05-15 18:36:44 +00:00
Manman Ren
866f306e62 [SILParser] refactor handleSILGenericParams to prepare patches for parsing.
No functionality change.
Change signature of handleSILGenericParams to get ready for patches on parsing
specialized protocol conformance in sil_witness_table.

rdar://15722175


Swift SVN r18117
2014-05-15 18:27:50 +00:00
Joe Groff
423087c0b2 Remove a stray dump().
Swift SVN r18116
2014-05-15 18:19:04 +00:00
Joe Groff
f1fa77e140 IRGen: Fix heap array destructor for types where size != stride.
Use TypeInfo::indexArray to get the bounds of the array instead of duplicating its logic incorrectly. Fixes <rdar://problem/16916422>.

Swift SVN r18115
2014-05-15 18:15:04 +00:00
Dmitri Hrybenko
acb7465f4b stdlib: underscore-prefix NSContiguousString and NSOpaqueString
Swift SVN r18114
2014-05-15 18:02:30 +00:00
Dave Abrahams
8cce55bdb4 [stdlib] WIP on Array Bridge/Cast Testing
Swift SVN r18113
2014-05-15 18:01:31 +00:00
Dave Abrahams
634d85f613 [stdlib] Strengthen a sanity check
Swift SVN r18112
2014-05-15 17:51:13 +00:00
Dmitri Hrybenko
586387da7f stdlib: remove unused declarations (the runtime functions are gone already)
Swift SVN r18111
2014-05-15 17:39:03 +00:00
Dave Abrahams
fed492b650 [stdlib] Don't assert on empty NSArrays
Empty NSArrays are usually represented by emptyNSSwiftArray, whose
element type is irrelevant.  So when doing a getObjects:range: on that,
presumably the range's length is zero and we shouldn't do any sanity
checking w.r.t. the element type.

Fixes <rdar://problem/16914909> Assertion failed attempting to append
arrays when subclassing Cocoa class

Swift SVN r18110
2014-05-15 17:25:48 +00:00
Dmitri Hrybenko
d50a8b476d stdlib/Foundation overlay: add Printable conformance to Selector
rdar://16897592


Swift SVN r18109
2014-05-15 17:25:43 +00:00
Dmitri Hrybenko
8ee468e974 stdlib/Foundation overlay: add Printable conformance to ObjCBool
rdar://16897579


Swift SVN r18108
2014-05-15 17:02:40 +00:00
Dmitri Hrybenko
2a956966ac stdlib/runtime: teach DynamicCastToExistential1 to handle source values that
are existentials

rdar://16925792


Swift SVN r18107
2014-05-15 16:32:13 +00:00
Doug Gregor
bf8fbfc32e Teach isBridgedToObjectiveC and bridgeToObjectiveC to unwrap implicitly unwrapped optionals.
This allows us to, for example, convert an array of unchecked
optionals of some bridged type T to NSArray. It's a runtime failure if
the unchecked optional contains nil.

This is most of <rdar://problem/16899681>, but I want to improve the
testing and look into the various FIXMEs.


Swift SVN r18106
2014-05-15 16:16:35 +00:00
Dmitri Hrybenko
2ec65be0a6 stdlib/runtime: use a C++ header
Swift SVN r18105
2014-05-15 14:14:28 +00:00
Dmitri Hrybenko
011584a0b6 stdlib/pritning: untie string interpolation from string initializers
String interpolation invokes convertFromStringInterpolationSegment() function
now.  There is no need to add extensions to String to allow custom types to
participate in string interpolation.  Just implementing Printable will do the
right thing.


Swift SVN r18104
2014-05-15 09:56:02 +00:00
Ted Kremenek
7fc27d3d94 Remove @unchecked.
Implements <rdar://problem/16796957>

Swift SVN r18103
2014-05-15 07:17:50 +00:00
Ted Kremenek
7da31bdfdd Disable parsing of single quoted character literals, enabling under a flag.
I didn't want to rip this logic out wholesale.  There is a possibility
the character lexing can be reborn/revisited later, and
disabling it in the parser was easy.

Swift SVN r18102
2014-05-15 07:05:59 +00:00
Doug Gregor
d640eb4083 Introduce support for blacklisting factory-methods-as-inits.
Some fcactory methods shouldn't come in as initializers, per
<rdar://problem/16908950>.


Swift SVN r18101
2014-05-15 07:04:46 +00:00
Doug Gregor
3210f19411 Clang importer: replace the designated-initializer whitelist with a general method whitelist.
... which only handles designated initializers, for now at least.


Swift SVN r18100
2014-05-15 06:22:44 +00:00
Doug Gregor
d8cca3a6a6 Make IRGen actually work in builds without assertions enabled.
Swift SVN r18099
2014-05-15 06:21:25 +00:00
Chris Lattner
fedd1a4aec enhance implicit initializer generation to return a list of initializers synthesized,
for future use. NFC.


Swift SVN r18098
2014-05-15 06:06:07 +00:00
Dave Abrahams
8e1a85490b [stdlib] More infrastructure for Array bridging
Totally untested; tests are next.

Swift SVN r18096
2014-05-15 04:32:13 +00:00
Dave Abrahams
1601b19b81 [docs] Arrays.rst - clarify deferred bridging
Also turn italic terminology references into links.

Swift SVN r18095
2014-05-15 02:13:42 +00:00
Chris Lattner
e383bac8f6 Rework default initialization of options to run much later, after all of the variables
have been type checked.  This allows us to reliably determine the type of the variable
and to know whether it actually needs default initialization or not.

This fixes:
<rdar://problem/16620121> Initializing constructor tries to initialize computed property overridden with willSet/didSet
which was because we were doing default initialization before computing override sets.

This does regress on one case, where our fiddly default init code isn't realizing that
a default initializer will be generated.  I fixme'd the case and filed:
<rdar://problem/16921173> implicit constructor synthesization runs too early

to track this.



Swift SVN r18094
2014-05-15 01:28:57 +00:00
Joe Groff
6b74826898 Improve diagnostic for @UIApplication mixed with top-level code.
Drop a note in the source file containing the top-level code to make it easier to navigate to (and avoid hardcoding the magic "main.swift" name).

Swift SVN r18093
2014-05-15 01:14:59 +00:00
Joe Groff
6851c410b3 Elaborate that @UIApplicationMain is mutually exclusive with main.swift.
Swift SVN r18092
2014-05-15 01:02:32 +00:00
Adrian Prantl
3848f9a069 Debug info: Emit the mangled name for function types, if it is possible.
<rdar://problem/16450045> variables of closure type cause "warning: swift types not handled in"... warnings

Swift SVN r18091
2014-05-15 01:01:17 +00:00
Michael Gottesman
32dee228f8 [sil-aa] Change TBAA to use type oracle instructions instead of the raw types of instructions.
The reason that this is important is that we *ARE* allowing the stdlib
to perform certain types of type punning for efficiency implying we need
to have a type oracle instruction to have safety.

A type oracle instruction is an instruction which implies undefined behavior
unless its operand/result is of a certain type (allowing us to ignore that
possibility).

In a following commit I am going to go over and fix any problems in the
actual TBAA implementation and give all the various checks tests.

rdar://16651852

Swift SVN r18090
2014-05-15 00:59:55 +00:00
Joe Groff
c371691fbf Release note @UIApplicationMain.
Swift SVN r18089
2014-05-15 00:57:40 +00:00
Joe Groff
793fe06a34 SILGen: Emit an artificial toplevel for files with @UIApplicationMain classes.
If a source file contains the main class for its module, then implicitly emit a top_level_code that invokes UIApplicationMain with the name of the marked class.

Swift SVN r18088
2014-05-15 00:53:38 +00:00
Jordan Rose
8ae8f2811f Release-note the switch to the LLDB REPL.
Swift SVN r18087
2014-05-15 00:02:53 +00:00
Greg Parker
4f3f1c8d7a Undo mistaken changes from r17975.
Swift SVN r18086
2014-05-14 23:45:11 +00:00
Sean Callanan
da5112e7b8 Fixed a crash when dumping an anonymous NamedPattern.
<rdar://problem/16908334>


Swift SVN r18085
2014-05-14 23:26:36 +00:00
Jordan Rose
780c6bd87a [Driver] Turn on the LLDB REPL by default!
You can use -integrated-repl to access the previous REPL implementation.

<rdar://problem/16776719>

Swift SVN r18084
2014-05-14 23:23:16 +00:00
Dave Zarzycki
9dd82e3373 Heap: slowDealloc() design feedback from John
Swift SVN r18083
2014-05-14 23:04:33 +00:00
Jordan Rose
8e1a9087ee Don't verify the AST in NDEBUG (Release) builds.
<rdar://problem/15035147>

Swift SVN r18082
2014-05-14 22:50:54 +00:00
Jordan Rose
d4a493e871 [PrintAsObjC] Don't include the ObjC header module in the generated header.
Importing a header with -import-objc-header causes the Clang importer to
provide an extra module to represent the header's content, and this was
showing up as "@import __ObjC;" in the /generated/ header for the target.
We should just not print anything there and let users import what's
necessary.

<rdar://problem/16917113>

Swift SVN r18081
2014-05-14 21:42:31 +00:00
John McCall
559fa09263 Un-XFAIL this test case; if you see it failing, you need
to update your clang checkout.

Swift SVN r18080
2014-05-14 21:33:15 +00:00
Ted Kremenek
bcb4f5d6d0 Add documentation comments for '..' and '...'.
Swift SVN r18078
2014-05-14 20:04:35 +00:00
Dmitri Hrybenko
f183e493bf stdlib/bridging: bridgeFromObjectiveC() can fail to bridge the Objective-C
object to the desired type.  Model this with an optional return type.


Swift SVN r18077
2014-05-14 19:49:22 +00:00
Sean Callanan
c30901cd94 Updated the line offset in the playground transform
to reflect the fact that a line got added to the
wrapper.

<rdar://problem/16905389>


Swift SVN r18076
2014-05-14 19:16:45 +00:00
Michael Gottesman
834a38fdfe [sil-aa] Add support to SILAA for running various forms of Alias Analysis to enable testing the various AA separately.
This is conditionally compiled out without asserts on.

I am going to use this functionality to test basic-aa and tbaa
separately in different test files.

<rdar://problem/16651852>

Swift SVN r18075
2014-05-14 18:24:19 +00:00
Dave Abrahams
897a11fda4 [stdlib] Update Arrays doc
Removed a meaningless bullet and call out an O(N) where it appears

Swift SVN r18074
2014-05-14 16:44:49 +00:00
Dave Abrahams
aceb11edb1 [stdlib] bridgeFromObjectiveC for String
Seemed pretty obvious so I just did it.

Swift SVN r18073
2014-05-14 16:44:49 +00:00
Joe Groff
6e13190f47 Diagnose when @UIApplicationMain tries to coexist with a main.swift file.
Swift SVN r18072
2014-05-14 16:10:29 +00:00
Dave Abrahams
a8bbc4c89b [stdlib] String internal API review changes
I had to XFAIL test/ClangModules/cf.swift, which is failing for reasons
I can't understand.  <rdar://problem/16911496>

Swift SVN r18071
2014-05-14 14:18:52 +00:00
Dmitri Hrybenko
eb9c3a406d stdlib/runtime: implement bridgeFromObjectiveC()
Swift SVN r18070
2014-05-14 13:40:46 +00:00