Commit Graph

13947 Commits

Author SHA1 Message Date
Jordan Rose
41700b03da Add a new (hidden) option -autolink-force-load.
This option puts a special symbol into the generated object files that other
object files can reference to force the library to be loaded.

The next commit will modify the way we serialize autolinking information so
that importers of this module will always emit a reference to this symbol.
This means the library will be linked into the final binary even if no other
symbols are used (which happens for some of our overlays that just add
category methods to Objective-C classes).

Part of <rdar://problem/16829587>

Swift SVN r17750
2014-05-09 01:07:07 +00:00
Argyrios Kyrtzidis
4f0776936a [stdlib] Dispatch depends on Darwin.
Swift SVN r17749
2014-05-09 01:04:44 +00:00
Adrian Prantl
e02f42a460 Debug info: make sure we're using the internal DW_LANG_Swift enum for now.
Swift SVN r17748
2014-05-09 00:55:28 +00:00
Sean Callanan
e3d2c7c079 Handle implicit conversions in the playground
transform, so that assignments to properties of
superclasses are logged properly.

<rdar://problem/16789091>


Swift SVN r17747
2014-05-09 00:52:41 +00:00
Michael Gottesman
aa70a16d7e [load-store-opts] Track, perform load forwarding, and eliminate multiple stores.
rdar://16703656

Swift SVN r17746
2014-05-09 00:44:28 +00:00
Joe Groff
4ddcc41c49 Add an interpreter test that we can witness Swift protocols with objc methods.
Swift SVN r17744
2014-05-09 00:26:30 +00:00
Doug Gregor
6deba37f0a Enable strict keyword argument checking by default <rdar://problem/14462349>.
Swift SVN r17743
2014-05-09 00:20:47 +00:00
Doug Gregor
a23bafccb6 Introduce -no-strict-keyword-options in the frontend "just in case".
Swift SVN r17742
2014-05-09 00:20:46 +00:00
Joe Groff
fcd0816179 SILGen: Emit witness function refs through 'emitGlobalFunctionRef'.
This ensures that if the witness is a foreign-to-native, curry, or other lazily-generated thunk, that the thunk gets generated. This fixes natively-ObjC witnesses to Swift protocols.

Swift SVN r17739
2014-05-09 00:14:43 +00:00
Michael Gottesman
9fee32d515 [load-store-opts] Do not invalidate stores if AA says that an instruction does not alias the store's destination conservatively.
Swift SVN r17738
2014-05-09 00:00:21 +00:00
Arnold Schwaighofer
c8c683dd44 Renable check for int_trap dependent on optimized builds
Swift SVN r17737
2014-05-08 23:52:21 +00:00
Michael Gottesman
02c42cd0a4 [load-store-opts] Refactor out special cases for strong_retain, cond-fail, and dealloc_stack into a helper function call isLSForwardingInertInstruction.
Swift SVN r17735
2014-05-08 23:34:22 +00:00
Dave Abrahams
5c3ebfcfb6 [stdlib] test file rename missed in r17722
Swift SVN r17734
2014-05-08 23:33:49 +00:00
Joe Groff
4caeb49449 Missed a heading.
Swift SVN r17733
2014-05-08 23:27:42 +00:00
Joe Groff
fa74bfc367 Add a proposal for the C pointer language model.
Swift SVN r17732
2014-05-08 23:26:26 +00:00
Dave Zarzycki
06731bbe21 Heap feedback: rename _swift_zone_init_ to _swift_zone_initImpl
Swift SVN r17729
2014-05-08 23:20:49 +00:00
Doug Gregor
05a283a58c When dealing with argument tuple conversions, keep the parentheses around
This is fairly ugly, because we're halfway between a-function-type-takes-a-tuple and a-function-type-takes-a-set-of-parameters. However, it's another step toward -strict-keyword-arguments.

Swift SVN r17727
2014-05-08 23:20:47 +00:00
Doug Gregor
bbf15afb29 Clean up our handling of arguments and types in the REPL under -strict-keyword-arguments.
We were inserting ParenType that we didn't need, which showed up in the output.

Swift SVN r17726
2014-05-08 23:20:47 +00:00
Doug Gregor
b12f3f8dea Add TypeBase::getWithoutParens(), which may be useful outside of diagnostics.
Swift SVN r17725
2014-05-08 23:20:46 +00:00
Dave Zarzycki
8b0c9d4e74 Heap: Let Instruments ensure that the heap is setup correctly at launch
Swift SVN r17723
2014-05-08 23:12:57 +00:00
Dave Abrahams
47eea01ab8 [stdlib] Eager non-verbatim bridging
Trying to lazily compute bridge results and cache them isn't going to
work, because there's no place to efficiently invalidate the cache in
cases like this:

  func f(a: NSArray) {
    for i in 0...a.count {
      println(a.objectAtIndex(i)) // Fills up the cache
    }
  }

  var message = ["hello", "world"]
  f(message)
  message[0] = "goodbye, cruel" // need a cache invalidation or else
  f(message)                    // ...this prints "hello\nworld\n"

Since we need C performance for subscript assignment, we just can't
afford to do anything extra there.

Instead, when the element type isn't "Bridged Verbatim," just eagerly
convert it to an NSArray.

Swift SVN r17722
2014-05-08 23:02:08 +00:00
Dmitri Hrybenko
72606a5228 stdlib/Runtime: allow swift_bridgeToObjectiveC to bridge objc
existentials

Should fix rdar://16837253

Swift SVN r17720
2014-05-08 22:58:10 +00:00
Joe Groff
1dce36edd2 Make 'T.self is U.Type' work.
Fix up all of type-checking, SILGen, IRGen, and the runtime to support checked casts of metatypes. <rdar://problem/16847453>

Swift SVN r17719
2014-05-08 22:55:14 +00:00
Michael Gottesman
f18dbbe9e8 [load-store-opts] Refactor load forwarding into its own method LSBBForwarder::tryToForwardLoad.
Now the main optimize method of load store forwarding is ~60 lines and
is significantly more readable.

Swift SVN r17718
2014-05-08 22:42:16 +00:00
Michael Gottesman
df441227f1 [load-store-opts] Refactor out dead store elimination into LSBBForwarder::tryToEliminateDeadStore.
Swift SVN r17717
2014-05-08 22:42:16 +00:00
Michael Gottesman
d4698e3beb [load-store-opts] Move invalidateAliasingLoads onto LSBBForwarder and remove unneeded arguments.
Swift SVN r17716
2014-05-08 22:42:16 +00:00
Michael Gottesman
f510d16666 [load-store-opts] Refactor out call to recursivelyDeleteTriviallyDeadInstructions -> LSBBForwarder::deleteInstruction.
Swift SVN r17715
2014-05-08 22:42:15 +00:00
Michael Gottesman
328dd3cf52 [load-store-opts] Refactor/Simplify LoadStoreOpts by including a BBState structure.
This makes the main method able to be broken down into simpler pieces
without the need to pass as many things around.

Swift SVN r17714
2014-05-08 22:42:14 +00:00
Dave Abrahams
1e66774acd [stdlib] swift_isClassOrObjCExistentialImpl fix
If we're going to claim to check for ObjC existential-ness, we should
actually do so.

Swift SVN r17712
2014-05-08 20:31:07 +00:00
Dave Zarzycki
0a0dbdc36c Runtime: make the index <-> size functions easier to lookup dynamically
Swift SVN r17711
2014-05-08 19:25:29 +00:00
Enrico Granata
720478bf96 Add a URL case to QuickLookObject
This is to be used by playgrounds to provide a better sidebar representation of web pages than simply showing the URL text

Part of rdar://16799088



Swift SVN r17710
2014-05-08 19:15:36 +00:00
Manman Ren
1bca09fe25 Remove FIXMEs that are already done.
Swift SVN r17709
2014-05-08 19:01:07 +00:00
Ted Kremenek
453532ca21 Import 'NSError**' in parameters as typealias 'NSErrorResult'.
Previously 'NSError**' was imported directly as
ObjCMutablePointer<NSError?>, which is verbose and quite ugly
in the synthesized interfaces and overrides.  This remapping
is semantically equivalent by syntactically prettier.

This name needs to go through API review.

The test uses the actual SDK; the clang-importer-sdk didn't work
because the dump of the Foundation module only shows the pieces
from the Swift files, and the Objective-C pieces are just shown
as re-exported modules.  Testing the actual SDK provides good
fidelity anyway.

Swift SVN r17707
2014-05-08 18:46:27 +00:00
Ted Kremenek
3a513a6412 Add 'getFoundationModule()' to ClangImporter::Implementation.
Swift SVN r17706
2014-05-08 18:46:26 +00:00
Joe Pamer
a17cec6cb2 Some test and diagnostic cleanup:
- Mine conjunction constraints for constraint failure data. (rdar://problem/16833763)
- Rather than crash, add a diagnostic to signify a missing user constraint. (rdar://problem/16747055) I don't have a deterministic repro for this to include as a test, but users hit it from time to time, I'd like to address this issue holistically, and we're hoping that the new diagnostic will help us collect isolated repros.
- As promised, remove the temporary "compiler_submit_version" build configuration predicate in time for WWDC. (rdar://problem/16380797)

Swift SVN r17705
2014-05-08 18:46:08 +00:00
Adrian Prantl
6389760e26 Debug info: Support DynamicSelf type.
Swift SVN r17704
2014-05-08 17:49:59 +00:00
Manman Ren
c465dad297 Bump VERSION_MINOR for r17675.
Swift SVN r17702
2014-05-08 17:22:11 +00:00
Chris Lattner
160232d05b clarify this comment.
Swift SVN r17701
2014-05-08 16:41:32 +00:00
Arnold Schwaighofer
ce0e6698c5 Add _isFast predicate that is true at Ofast
We want to support three configurations:

* Debug (-Onone, -O0): user assertions, library precondition checks, runtime
  checks enabled and verbose.

* Release (-O): library precondition checks, runtime checks enabled but succinct
  (trap).

* Fast (-Ofast): all checks off.

The _isFast predicate will allow to write standard library functions to support
this plan. This commit changes fatal() to differentiate between the three modes.

Support for rdar://16477198

Swift SVN r17697
2014-05-08 15:30:29 +00:00
Greg Parker
f1d020e11a <rdar://16848707> Add Dispatch overlay with covers for some libdispatch macros.
Swift SVN r17693
2014-05-08 09:47:00 +00:00
Argyrios Kyrtzidis
7de8d31c7a [IDE] Syntax color operator decls.
rdar://16530692

Swift SVN r17692
2014-05-08 08:11:38 +00:00
Argyrios Kyrtzidis
1784315096 [AST/IDE] Keep track of semantic info of imports (resolved module and decls) and report module/decl references via
the SourceEntityWalker.

Swift SVN r17689
2014-05-08 07:10:06 +00:00
Argyrios Kyrtzidis
ccc23b60b0 [IDE] Report module references in type contexts.
Swift SVN r17688
2014-05-08 07:10:05 +00:00
Manman Ren
1f280bba73 [SILPasses] limit number of iterations to 20.
This prevents us going in an infinite optimization loop. According to Michael,
we need at least 15 for performance.

The fix at r17635 does not handle the case where the recursive function calls
itself only once.

rdar://16761933


Swift SVN r17686
2014-05-08 05:40:58 +00:00
Nadav Rotem
a9ff0a3d24 Migrate the test to manual reference counting.
Swift SVN r17685
2014-05-08 05:15:34 +00:00
Chris Lattner
c8003816ad change this to isa<> since we're using a bool return.
Swift SVN r17684
2014-05-08 05:14:10 +00:00
Chris Lattner
e489a7024a Switch array default construction to its canonical type sugar form
of T[]() instead of Array<T>().

I didn't do this in the guts of Array.swift because the abstraction
is harmful in the implementation of Array itself.

NFC.



Swift SVN r17683
2014-05-08 05:13:08 +00:00
Ted Kremenek
05e9efb093 Don't compile XCTest overlay as being Application Extension safe.
Swift SVN r17682
2014-05-08 04:49:00 +00:00
Doug Gregor
98da27fcd9 Strip extraneous parentheses from diagnostic output.
They're excessive, silly, and tend to differ under -strict-keyword-arguments.


Swift SVN r17681
2014-05-08 04:48:35 +00:00
Argyrios Kyrtzidis
16d4b98b83 [ASTPrinter] Add more printing options, SkipAttributes/SkipIntroducerKeywords/ArgAndParamPrintingMode.
Swift SVN r17677
2014-05-08 04:17:40 +00:00