https://github.com/apple/swift

sort by:
Revision Author Date Message Commit Date
e3e61f8 Merge pull request #10107 from atrick/swift-4.0-branch Guaranteed ARC Opts: Access instructions do not reduce refcounts. 06 June 2017, 00:42:43 UTC
ee28f2d Merge pull request #10075 from aschwaighofer/swift-4.0-branch-stdlib-fixedwidthinteger-init-outline-for-size [4.0] stdlib FixedWidthInteger.init(: radix:) outline helper for size 06 June 2017, 00:40:17 UTC
83997c6 Merge pull request #10122 from gottesmm/swift-4.0-branchrdar32525952 [silgen] Error nicely on multiple pattern cases with address only patterns 06 June 2017, 00:29:20 UTC
93ea141 [silgen] Error nicely on multiple pattern cases with address only patterns. We silently miscompiled previously the following code: protocol Gesture {} struct Foo {} struct Bar {} enum FooOrBar { case foo(Foo) case bar(Bar) } func main(_ f : FooOrBar) { switch f { case .foo(let data as Gesture), .bar(let data as Gesture): ... } ... } This was because the multiple pattern per case code never implemented support for address only types. Now instead of miscompiling such programs, we do the following: 1. We emit an error. 2. When we construct the arguments for the named bindings, we just skip the address only types. Everything else is normal. 3. In the case block, we use a SILUndef for the address only value. This ensures that we preserve as many other diagnostics as possible. rdar://32525952 P.S. As an additional benefit, this eliminates a source of address phi nodes from SILGen. (cherry picked from commit bf71ec85995b1a7fc26c811eae4a7a99504654d5) 05 June 2017, 21:26:08 UTC
29c7eb6 Unit test for guaranteed ARC with access markers. (cherry picked from commit 55a2c6fc0cf322d247f12d7c428a63de4cbc3487) 05 June 2017, 20:57:34 UTC
9961d2b Guaranteed ARC Opts: Access instructions do not reduce refcounts. Fixes <rdar://problem/32560531> MatMul regression with dynamic exclusivity checks due to retain/release. (cherry picked from commit b44bc36834541089bd8d46145b28bb444adefafc) 05 June 2017, 20:56:59 UTC
d856b82 Merge pull request #10071 from DougGregor/objc-inference-warnings-cleanup-4.0 [4.0] [Type checker] Warn deprecated @objc used to satisfy protocol requirements 02 June 2017, 23:31:58 UTC
7381439 Address review comments Rename _parseASCIIOutlined to _parseASCIISlowPath. Change doc comment to regular comment. 02 June 2017, 20:31:54 UTC
7e260e6 stdlib: Move _parseASCIIOutlined into the FixedWidthInteger extension 02 June 2017, 20:31:53 UTC
fe24cf4 stdlib: Outline integer parsing code in FixedWidthInteger.init(_: radix:) on the slow paths This reduces code size by 20k on an app that uses this function. rdar://32519912 02 June 2017, 20:31:53 UTC
79d6103 Re-branch swift-4.0-branch 'b4166a1934cbd38fbb3725e3cb2ddb6a9ecc0fde' from master '3a7a30a8224e6ab21142c27a1492bdc1f8eb1c8b' Merge commit 'b4166a1934cbd38fbb3725e3cb2ddb6a9ecc0fde' into swift-4.0-branch 02 June 2017, 19:48:18 UTC
3a7a30a Merge pull request #10059 from apple/utf16-small-character [stdlib] Encode small Characters as UTF-16 02 June 2017, 18:49:40 UTC
f9b77fa Merge pull request #10066 from slavapestov/unprepared-archetype-callees Rip out SILGenApply's ArchetypeCalleeBuilder 02 June 2017, 18:48:09 UTC
25901cc Merge pull request #10065 from CodaFi/shame-on-you-shame-on-your-cow Change an assertion to an ad-hoc circularity check 02 June 2017, 18:40:06 UTC
5ecbde9 Merge pull request #10051 from apple/debug-only-single-grapheme-check 02 June 2017, 18:37:33 UTC
567c965 Merge pull request #10069 from rudkx/more-type-map-changes [Constraint solver] More type map changes. 02 June 2017, 17:42:46 UTC
12f8116 Change an assertion to an ad-hoc circularity check 02 June 2017, 17:23:02 UTC
51bf3a6 [stdlib] Make single-grapheme check debug-only Because of the way grapheme breaking changes across updates to ICU and the Unicode standard, it may not even be legit to check this at all. It's certainly not unsafe to skip the check, so let's see if we can do that in release builds, as grapheme breaking is expensive. 02 June 2017, 16:53:22 UTC
9a1614b [QoI] Say "'@objc'" rather than the redundant "'@objc' attribute" in diagnostics. A cleanup Jordan had mentioned a while ago that I'd forgotten about, which makes the diagnostics slightly shorter. (cherry picked from commit 9f50a0ec61d09ec261f08b9a9c4bab5f4050eca7) 02 June 2017, 16:18:01 UTC
b82155e [Type checker] Warn deprecated @objc used to satisfy protocol requirements. Warn about uses of declarations which have inferred @objc due to the deprecated Swift 3 rules when the declarations are used to satisfy a requirement of an @objc protocol. This covers cases where the @objc cannot be inferred due to the conformance, e.g., when the declaration itself is in a superclass but a subclass is stating the conformance. Fixes rdar://problem/32431838. (cherry picked from commit c96da6800acf617c8c17dde99a95865348c9ca5a) 02 June 2017, 16:18:01 UTC
20f6664 Merge pull request #10070 from apple/objc-inference-warnings-cleanup 02 June 2017, 16:11:51 UTC
9f50a0e [QoI] Say "'@objc'" rather than the redundant "'@objc' attribute" in diagnostics. A cleanup Jordan had mentioned a while ago that I'd forgotten about, which makes the diagnostics slightly shorter. 02 June 2017, 15:47:58 UTC
c96da68 [Type checker] Warn deprecated @objc used to satisfy protocol requirements. Warn about uses of declarations which have inferred @objc due to the deprecated Swift 3 rules when the declarations are used to satisfy a requirement of an @objc protocol. This covers cases where the @objc cannot be inferred due to the conformance, e.g., when the declaration itself is in a superclass but a subclass is stating the conformance. Fixes rdar://problem/32431838. 02 June 2017, 15:41:48 UTC
e46830e Merge pull request #10068 from swiftix/inliner-improvements2 02 June 2017, 15:34:34 UTC
d1a0b35 [Constraint solver] More type map changes. A few more changes to use the side map for expression types in the constraint solver. Still not enabled. 02 June 2017, 15:13:57 UTC
dace268 Removed && !defined(__ANDROID__) to fix https://bugs.swift.org/browse/SR-5059 (#10060) 02 June 2017, 15:10:11 UTC
a54629b [sil-eager-specializer] Properly set the IsSerialized flag Fixes a rare compiler crash when @_specialized and regular specialization of generics produce the same specialization. 02 June 2017, 15:01:15 UTC
2778dc8 Add and use _ExpressibleByBuiltinUTF16ExtendedGraphemeClusterLiteral 02 June 2017, 14:01:03 UTC
b4166a1 Merge pull request #10063 from slavapestov/some-conditional-cf-casts-unconditionally-succeed-4.0 Sema: Fix conditional downcasts from Swift types to CF types [4.0] 02 June 2017, 13:53:48 UTC
6d9886f SILGen: Scrap ArchetypeCalleeBuilder altogether The prepareArchetypeCallee() function no longer does anything useful beyond calling Callee::forArchetype(), so just replace all uses of the former with the latter. 02 June 2017, 08:40:57 UTC
b65ad58 SILGen: Remove ArchetypeCalleeBuilder::shouldMaterializeSelf() I don't think any of this was necessary anymore, and I suspect it was working around other related issues that have since been fixed. Whatever we did to 'self' here we also would have had to do for extension methods anyway. Note that some tests changed but I believe the end result should be equivalent. 02 June 2017, 08:40:56 UTC
29cd885 SILGen: Remove SILGenFunction::ArchetypeOpenings SILBuilder now tracks data dependencies between instructions that open existentials and uses of the opened type, so SILGen's mechanism for this is no longer needed. In particular, this simplifies ArchetypeCalleeBuilder. 02 June 2017, 08:35:11 UTC
c28c420 SILGen: Simplify SILGenApply a bit We were passing around a ton of unused parameters, just remove them. 02 June 2017, 08:35:01 UTC
032c18c Merge pull request #10064 from CodaFi/thats-not-my-name 02 June 2017, 07:37:12 UTC
72ee26a Resolve a crasher 02 June 2017, 06:58:14 UTC
8ea2d0d Sema: Fix conditional downcasts from Swift types to CF types Conditional and forced downcasts enter a constraint that almost always succeeds; only when applying the solution do we evaluate the feasability of the cast and determine if it always succeeds, always fails, or conditionally succeeds. This changes how the resulting AST is represented and can also emit diagnostics. If the conditional cast is at this stage determined to always succeed, we treat it as an unconditional cast, going through ExprRewriter::coerceToType() to build the AST for the coercion. However conditional cast constraints don't enter the same restrictions into the solution as unconditional casts do, so coerceToType() would fall over if casting a Swift type to a CF type by first bridging the Swift type to Objective-C. Get around this by checking for this case explicitly when lowering a CoerceExpr. It feels like there's a more fundamental issue here with how casts are modeled in the constraint solver, but I'm not going to try understanding that now. Fixes <rdar://problem/32227571>. 02 June 2017, 06:51:16 UTC
df1bedc Merge pull request #10061 from slavapestov/some-conditional-cf-casts-unconditionally-succeed Some conditional CF casts unconditionally succeed 02 June 2017, 06:50:29 UTC
de7a1b5 Fix compiler crash by restricting the WalkToVarDecls walker. WalkToVarDecls should only walk within the current pattern, not into any other nodes (especially not nodes that open a scope.) Restricting this fixes the name lookup weirdness that caused the crash. 02 June 2017, 06:23:29 UTC
5d395d9 Merge pull request #10049 from DougGregor/gsb-superclass 02 June 2017, 06:07:42 UTC
4fbb3ec [GSB] Resolve nested types by looking into superclass constraints. This was previously handled very late, by the type checker, which led to weird ordering dependencies and meant that we could end up with well-formed code where the GSB was left with unresolved types. We want such states to never exist, so make sure we can resolve everything in the GSB. 02 June 2017, 05:29:46 UTC
d6bddd2 Merge pull request #10040 from swiftix/inliner-improvements2 [sil-generic-specializer] Add @_semantics("optimize.sil.specialize.generic.partial.never") to disable partial specialization on specific functions 02 June 2017, 04:56:10 UTC
9a4255e Merge pull request #9717 from xedin/rdar-32034560 [ConstraintSystem] Prevent `shrink` from solving "too complex" sub-expressions 02 June 2017, 04:47:47 UTC
b639f7f Sema: Fix conditional downcasts from Swift types to CF types Conditional and forced downcasts enter a constraint that almost always succeeds; only when applying the solution do we evaluate the feasability of the cast and determine if it always succeeds, always fails, or conditionally succeeds. This changes how the resulting AST is represented and can also emit diagnostics. If the conditional cast is at this stage determined to always succeed, we treat it as an unconditional cast, going through ExprRewriter::coerceToType() to build the AST for the coercion. However conditional cast constraints don't enter the same restrictions into the solution as unconditional casts do, so coerceToType() would fall over if casting a Swift type to a CF type by first bridging the Swift type to Objective-C. Get around this by checking for this case explicitly when lowering a CoerceExpr. It feels like there's a more fundamental issue here with how casts are modeled in the constraint solver, but I'm not going to try understanding that now. Fixes <rdar://problem/32227571>. 02 June 2017, 04:44:07 UTC
562fd79 [stdlib] Encode small Characters as UTF-16 This takes care of the standard library portion, but we need a new BuiltinUTF16ExtendedGraphemeClusterLiteralConvertible protocol in order to fully recover the performance of character literals. Note that part of the character_literals.swift test is currently disabled. That will need to be fixed before we can merge this work. 02 June 2017, 03:57:25 UTC
5bcf8a9 Merge pull request #10058 from rudkx/clear-opaque-expr-on-open-existential [Constraint solver] Fix an issue with rewriting OpenExistentialExpr. 02 June 2017, 03:54:20 UTC
fb5ac6d [Constraint solver] Fix an issue with rewriting OpenExistentialExpr. If we fail when doing a coercion while generating an OpenExistentialExpr when applying a solution during type checking, make sure that the opaque value on that OpenExistentialExpr is cleared. We do not visit these during normal AST walks because they normally appear in the subexpression held by the OpenExistentialExpr. In this case, however, we replace that subexpression with an ErrorExpr which means we will not visit the opaque value at all, so certain operations, like setting the type on the opaque value, will never happen, and we can run into problems later by code that assumes the type is set. It seems reasonable to just clear these out in cases like this since they are not reachable by any normal means. 02 June 2017, 03:18:29 UTC
63bc717 Error when one associated type is constrained to another. (#10053) (...is constrained to be a subtype of another) Previously the compiler would just mark the entry in the inheritance clause invalid and move on without emitting any errors; in certain circumstances in no-asserts builds this could actually lead to everything working "correctly" if all conforming types happened to pick the same concrete type for both associated types. In Swift 4 this can actually be enforced with a same-type requirement, which will guarantee that the two associated types are the same even in generic contexts. This fix avoids assertions and crashes, but the diagnostic is still incorrect, and in the simple case of the inheritance clause it's redundant. Doing something better and possibly even downgrading it to a warning in Swift 3 mode is tracked by rdar://problem/32409449. Initial patch by Slava, fixed up by me. 02 June 2017, 02:45:34 UTC
55843a2 migrator: compare sub-kind when checking if two diff items are equivalent to avoid dropping information. rdar://32431567 02 June 2017, 01:03:23 UTC
db32480 Merge pull request #10050 from jckarter/class-extension-access-strategy Correct getAccessStrategy for class extension storage decls. 02 June 2017, 00:41:45 UTC
88a5656 Merge pull request #10046 from jrose-apple/4.0-anonymous-structs-causing-problems-once-again [4.0] [PrintAsObjC] Handle the importer's compatibility typealiases 02 June 2017, 00:36:15 UTC
ea5a42d Merge pull request #9963 from xedin/rdar-32204609 [ConstraintSolver] Skip generic overloads only if non-generic choices produce higher score solutions 02 June 2017, 00:17:37 UTC
c1c4f52 [Mangling] Include private discriminators in constructor manglings. (#9880) Previously, two constructors with the same full name and argument types would get identical manglings even if they were declared 'private' or 'fileprivate' in different files. This would lead to symbol collisions in whole-module builds. Add a new mangling node for private discriminators on base-name-less decls to make this unique. This still doesn't fix the existing issue with private members, named or not, conflicting when they're in the /same/ file, but since Swift 4 makes those members visible to one another (SE-0169) that's only an issue in Swift 3 mode anyway, and as such probably won't get fixed at all. rdar://problem/27758199 01 June 2017, 23:42:17 UTC
2c0873a Correct getAccessStrategy for class extension storage decls. Class extension methods are non-polymorphic unless @objc. Fixes rdar://problem/32434652. 01 June 2017, 23:38:03 UTC
5d1412d [Serialization] Use decl mangling for local decls, not type mangling. (#10022) Otherwise we get an error with local generic types. We don't need the complexity of type mangling anyway. https://bugs.swift.org/browse/SR-5038 01 June 2017, 23:37:59 UTC
10cf01f Merge pull request #10041 from slavapestov/immediately-called-closures-are-always-noescape-4.0 Sema: A call of a closure literal is noescape [4.0] 01 June 2017, 23:33:47 UTC
00d663d [sil-generic-specializer] Add @_semantics("optimize.sil.specialize.generic.partial.never") to disable partial specialization on functions This new @_semantics is used to annotate some very big functions in the standard library. It reduced the code size of the stdlib by 2%. 01 June 2017, 23:33:18 UTC
89fed4f Merge pull request #10048 from adrian-prantl/32520596 Add a virtual destructor to avoid leaking the new private impl's memory. 01 June 2017, 23:31:41 UTC
9a4cbc7 Merge pull request #10047 from apple/emacs-mode-labeled-repeat 01 June 2017, 23:20:08 UTC
efc41d9 Add a virtual destructor to avoid leaking the new private impl's memory. rdar://problem/32520596 01 June 2017, 22:53:58 UTC
c1c9028 [emacs-support] Fix indentation for labeled repeat 01 June 2017, 22:43:10 UTC
b8407b3 [PrintAsObjC] Handle the importer's compatibility typealiases. (#10042) These are TypeAliasDecls whose Clang nodes are not TypedefNameDecls. This worked all right for classes, but dropped the tag keyword (e.g. 'struct') for tag decls with names of their own, and didn't print any name at all for C types that used the typedef-for-anonymous-tag pattern. rdar://problem/32514335 01 June 2017, 22:31:48 UTC
eb9f047 [PrintAsObjC] Handle the importer's compatibility typealiases. (#10042) These are TypeAliasDecls whose Clang nodes are not TypedefNameDecls. This worked all right for classes, but dropped the tag keyword (e.g. 'struct') for tag decls with names of their own, and didn't print any name at all for C types that used the typedef-for-anonymous-tag pattern. rdar://problem/32514335 01 June 2017, 22:28:44 UTC
3e2bbfe [Gardening] Cleanup TokenKinds.def (#10034) * [Parse] Refactored internal structure of Tokens.def and documented usage. Added a level of structure to the macro definitions to allow Swift keywords to be cleanly accessed separately from SIL and Swift keywords together. Documented structure and usage. * [Parse] Made use of new guarantees and abstractions in Tokens.def Used guarantees about undefining macros after import and new SWIFT_KEYWORD abstraction to simplify usage of the Token.def imports. * Gardening 01 June 2017, 22:08:48 UTC
28c470d Test if two ascii string pointers are equal before memcmp (#10018) 01 June 2017, 22:01:42 UTC
ac18e42 Benchmarks for equating/comparing substrings (#10030) * Benchmarks for equating/comparing substrings * Update main.swift * Regnerate benchmarks harness file 01 June 2017, 21:52:58 UTC
5998cd6 [ConstraintSolver] Penalize conversions from String to UnsafePointer There are possible situations when we find solutions with String and String -> UnsafePointer conversions at the same time for expressions with default string literals. In order to disambiguite such situations let's prefer solutions without String -> UnsafePointer conversions if possible. 01 June 2017, 21:43:43 UTC
1bc7a1e [ConstraintSolver] Skip generic overloads only if non-generic choices produce higher score solutions Restrict skipping of the generic overloads only to the situations when non-generic solution doesn't have any restrictions/fixes, because there is a possibility that generic overload could produce a better solution. Resolves: rdar://problem/32204609. 01 June 2017, 21:43:43 UTC
0a0585c Merge pull request #10021 from xedin/no-free-generic-params [ConstraintSolver] Forbid forming solutions with free generic type parameters 01 June 2017, 21:43:04 UTC
69bd781 Merge pull request #10038 from nkcsgexi/migrator-qualified-replacement 01 June 2017, 21:32:56 UTC
5868877 Update class_resilience_objc_armv7k.swift for dynamic access checks. 01 June 2017, 21:29:49 UTC
1957e10 Reenable pic.swift test. 01 June 2017, 21:29:49 UTC
275d9e4 Update an armv7 test for beginAccess markers. 01 June 2017, 21:29:49 UTC
38fdf17 Sema: A call of a closure literal is noescape We cannot model a type variable bound to the ExtInfo of a function type in the constraint solver, which means we have a hard time propagating noescape-ness in some cases. Fixes <rdar://problem/31910280> and <rdar://problem/32409133>. 01 June 2017, 21:12:43 UTC
ef41353 [sil-inliner] Skip only array @_semantics during early inlining The inliner was skipping even non-array related @_semantics by mistake. 01 June 2017, 21:09:22 UTC
f09d2ad [ConstraintSolver] Forbid forming solutions with free generic type parameters `FreeTypeVariableBinding::GenericParameters` mode allowed to bind all free type variables with fresh generic parameter types, which is incorrect (at least) if there are multiple generic solutions present, because such parameters couldn't be compared. This mode was used for code completion, which is now switched to use `FreeTypeVariableBinding::UnresolvedType` instead. 01 June 2017, 21:05:05 UTC
d9f3d13 Update HeapObject.h 01 June 2017, 20:53:19 UTC
318f6c1 [runtime] Add swift_unownedIsEqual and swift_unknownUnownedIsEqual. It is safe to test pointer equality of an unowned variable, even if the unowned variable refers to a dead object. Allowing this operation without an unnecessary unowned abort enables some kinds of caching schemes more cheaply than can be done with weak variables. rdar://32142240 01 June 2017, 20:53:19 UTC
899e68e [GSB] Generalize potential archetype from "typealias" to all concrete types. Potential archetypes can resolve to either an associated type or a typealias. Generalize the latter to "any concrete type", both because the current implementation is unnecessarily narrow (typealiases aren't actually special in this regard) and to get us closer to handling lookups via superclass constraints when resolving these types. 01 June 2017, 20:52:39 UTC
4cb851f Merge pull request #10037 from eeckstein/report-stats-option 01 June 2017, 20:35:49 UTC
0b8b020 migrator: teach the tool to handle qualified replacement. rdar://32466196 01 June 2017, 20:15:12 UTC
7b6d9af cmake: add a build-script-impl option --report-statistics to pass the -stats-output-dir option when compiling swift libraries 01 June 2017, 19:16:20 UTC
b218378 Merge pull request #10032 from eeckstein/enable-test 01 June 2017, 18:28:32 UTC
d402593 Merge pull request #10033 from aschwaighofer/disable_irgen_test_pic_swift 01 June 2017, 17:30:01 UTC
9ab9075 Disable IRGen test case pic.swift until it is fixed This test fails on armv7 on a bot. Disable until I have fixed it. rdar://32513284 01 June 2017, 17:11:21 UTC
72dd2fe tests: adapt the character_literals test and re-enable it https://bugs.swift.org/browse/SR-5064 01 June 2017, 17:10:00 UTC
5de07a6 Merge pull request #10031 from benlangmuir/disable-testdata 01 June 2017, 16:54:54 UTC
354dddd Disable TestData with reslience temporarily This test is broken on our resilience bot; disable it until it is fixed. rdar://problem/32472729 01 June 2017, 16:32:33 UTC
2b3c057 Merge pull request #10003 from fjricci/remove_dead_code Remove unused ID encoding functions from SwiftLookupTable 01 June 2017, 16:13:02 UTC
022c973 Merge pull request #10002 from milseman/i_dream_of_grapheme [stdlib] Grapheme break fast-paths for Cyrillic, Arabic, Hangul 01 June 2017, 15:59:25 UTC
99d77dd Merge pull request #10029 from dabrahams/nix-_HeapBuffer2 01 June 2017, 15:48:00 UTC
5628580 [AST] Introduce TypeDecl::compare() to provide an ordering for type declarations. Generalizes ProtocolType::compareProtocols() for more general use. 01 June 2017, 15:26:26 UTC
8266032 Annotate some XFAILs with Jira/Radar links 01 June 2017, 15:26:26 UTC
ea20a1d [AST] Add DeclContext::get(Syntactic|Semantic)Depth. Utilities functions used when comparing declaration contexts. Only the syntactic form is currently used (for the owning DC of a generic environment). 01 June 2017, 15:25:42 UTC
3ba644c Merge pull request #10020 from dabrahams/nix-_HeapBuffer2 01 June 2017, 13:17:44 UTC
b2e4bd5 [stdlib] Replace _HeapBuffer with a thin wrapper ...over ManagedBufferPointer 01 June 2017, 11:40:52 UTC
c5f73c3 Merge pull request #10026 from xedin/rdar-32432145 [Diagnostics] Suggest removing anonymous closure parameters if none are expected 01 June 2017, 07:17:55 UTC
b755960 [Diagnostics] Suggest removing anonymous closure parameters if none are expected If the contextual closure type expects no parameters but N parameters where used and all of the them are anonymous, let's suggest removing them. Resolves: rdar://problem/32432145 01 June 2017, 06:59:34 UTC
52fcadf Merge pull request #10011 from CodaFi/code-covfeferage [4.0] Add a size heuristic to the Space Engine 01 June 2017, 05:03:29 UTC
900e8be Merge pull request #10008 from bitjammer/rdar-32433206-migrator-single-expr-closure-add-return-swift-4.0-branch [Migrator] Add `return` keyword when adding temp bindings in single-e… 01 June 2017, 04:55:27 UTC
d20f4a8 swift-api-digester: simplify some code. NFC (#10023) 01 June 2017, 04:47:53 UTC
back to top