Skip to content

[stdlib] [WIP] Eliminate version of Array.append(contentsOf:) that takes a Collection #5521

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
212 commits
Select commit Hold shift + click to select a range
04c7d94
Migrate _copyContents to be called from UnsafeMutableBufferPointer wi…
airspeedswift Oct 28, 2016
dbf4bf9
Move += operator for append(contentsOf:) up to RangeReplaceableCollec…
airspeedswift Oct 31, 2016
3677d8e
Added test of += matching .append(contentsOf:) to StdLibUnitTest
airspeedswift Oct 31, 2016
acfc744
Added test for undercounted collection not crashing
airspeedswift Nov 1, 2016
c857dab
Switch to _copyContents returning an (Iterator,UnsafeBuffer.Index)
airspeedswift Nov 4, 2016
3074318
perf improvement to Sequence._copyContents
airspeedswift Dec 18, 2016
6b9c3a5
Merge branch 'master' into collapse-append-contentsof
airspeedswift Dec 18, 2016
38bb800
Fix accidental miscommit
airspeedswift Dec 18, 2016
e6d2eb8
add tests of generic append
airspeedswift Dec 18, 2016
abc83ad
Merge pull request #6377 from airspeedswift/add-append-tests
airspeedswift Dec 19, 2016
fdd02f6
[CMake] Stop linking CoreFoundation into swiftc and libobjc into ever…
jrose-apple Dec 22, 2016
0936c51
[swiftc (83 vs. 5325)] Add crasher in swift::TypeChecker::checkAutoCl…
practicalswift Dec 22, 2016
1889fde
Resolve `type(of:)` by overload resolution rather than parse hackery.
jckarter Dec 20, 2016
23f25e1
In immediate mode, detect the host OS version on Apple platforms.
jrose-apple Dec 22, 2016
ee5ed7b
[IRGen] Code Size Reduction: Outline Copy/Consume (Loadable) Enum
Dec 21, 2016
b538baa
[ClangImporter] Simplify importFunctionType too.
jrose-apple Dec 22, 2016
d1e0877
[ClangImporter] "Fix" too-wide bitfield.
jrose-apple Dec 22, 2016
0c92978
Sema: Handle type-checking for withoutActuallyEscaping.
jckarter Dec 22, 2016
d5046a6
[gardening] Make sure argument names in comments match the actual par…
practicalswift Dec 23, 2016
f42fa36
[Diagnostics] Type-check return of the multi-statement closure withou…
xedin Dec 23, 2016
3a61fba
[Diagnostics] Mark all closure result type-checking related crashers …
xedin Dec 24, 2016
047f7e0
[QoI] Allow computeAssignDestType to return UnresolvedType to facilit…
xedin Dec 25, 2016
dab14d3
[TypeChecker] Fix isAnyHashableType to check type variables
xedin Dec 26, 2016
951395c
[Diagnostics] Explicitly disallow solutions with unresolved types whe…
xedin Dec 26, 2016
b02568f
[ASTDumper] More colors, compat with print methods
modocache Dec 26, 2016
9d62225
[ASTDumper] Print colors for Expr
modocache Dec 26, 2016
6116001
[ASTDumper] Use color when printing patterns
modocache Dec 26, 2016
3185571
[ASTDumper] Use color when printing Decl
modocache Dec 26, 2016
e58648a
[ASTDumper] Use color when printing AST nodes
modocache Dec 26, 2016
755c0a6
[ASTDumper] Use color when printing parameters
modocache Dec 26, 2016
02738a5
[ASTDumper] Use color when printing Stmt
modocache Dec 26, 2016
11a46ff
[ASTDumper] Use color when printing identifiers
modocache Dec 26, 2016
8459212
[ASTDumper] Use color when printing TypeRepr
modocache Dec 26, 2016
71a9292
[ASTDumper] Use color when printing protocols
modocache Dec 26, 2016
4cc3397
[QoI] Ignore erroneous default literal types in lookup
xedin Dec 27, 2016
464fee9
Remove lib prefix from Windows stdlib libraries
hughbe Dec 27, 2016
db27ccf
[QoI] Don't walk into erroneous apply expressions while validating to…
xedin Dec 28, 2016
b236244
[QoI] Don't try to type-check closure return statement if it involves…
xedin Dec 28, 2016
5022c25
Mark as fixed.
practicalswift Dec 29, 2016
a26254b
Mark as fixed.
practicalswift Dec 29, 2016
88a06fb
Use annotation "REQUIRES: deterministic-behavior"
practicalswift Dec 29, 2016
7b82cf8
SILOptimizer: Fix Mandatory Inlining problem with opened existentials
slavapestov Dec 28, 2016
ce60a22
Merge branch 'master' into collapse-append-contentsof
airspeedswift Dec 30, 2016
fee0727
updated UnsafeBuffer.initialize(from:) docs and labelled returned tuple
airspeedswift Dec 30, 2016
8c4b871
[QoI] Fix recursive propagation of materializability to look through …
xedin Dec 30, 2016
130e5fb
[QoI] Fix computeAssignDestType to mark lvalue enforcement type varia…
xedin Dec 30, 2016
d37e93d
[QoI] While merging equivalence classes don't forget to merge fixed t…
xedin Dec 31, 2016
faa7c74
Removed repetitive docstring
Dec 31, 2016
2b62ed2
Updated index(_:offsetBy:limitedBy:) code example
Dec 31, 2016
bd34ea5
remove trailing semicolons in stdlib source
jpsim Jan 1, 2017
ea5b665
prefer '-> Void' over '-> ()'
jpsim Jan 1, 2017
bb0af66
fix mismatched closure open/close spacing in stdlib source
jpsim Jan 1, 2017
7301b79
remove superfluous parentheses in control statements in stdlib source
jpsim Jan 1, 2017
2b24689
fix overly-spaced return arrows in XCTest.swift
jpsim Jan 1, 2017
83b6d3c
remove redundant optional nil assignment in stdlib source
jpsim Jan 1, 2017
fac59ce
[Diagnostics] Improve diagnostics of self assignment of the anonymous…
xedin Jan 1, 2017
bde054a
[DiagnosticsQoI] Look through argument tuples when diagnosing convers…
CodaFi Jan 1, 2017
25cb143
[CSGen] handle ForceValueExpr in LinkedExprAnalyzer
jtbandes Dec 31, 2016
7f29a33
[docs] Fix code snippet
ole Jan 2, 2017
63498f8
Revert "[AST Verifier] Hack: don't look for destructors of Clang nodes."
DougGregor Jan 3, 2017
832aa38
[Serialization] Be less lazy about deserialized generic environments.
DougGregor Jan 3, 2017
a202795
[Type checker] Fix a use-after-free due to StringRefs stored in Diagn…
DougGregor Jan 3, 2017
adb05f5
Merge pull request #6532 from DougGregor/modulefile-pending-actions
DougGregor Jan 3, 2017
9cebf0a
Merge pull request #6533 from DougGregor/diag-use-after-free
DougGregor Jan 3, 2017
ef49338
Revert "Introduce and use SWIFT_HAVE_LIBEDIT"
shahmishal Jan 3, 2017
f7b1cbc
Revert "Added HAVE_UNICODE_LIBEDIT instead of doing platform checks"
shahmishal Jan 3, 2017
6dbcfc9
Don't check access for compound TypeReprs in Swift 3 mode.
jrose-apple Jan 3, 2017
4fbd3e6
Don't check availability for compound TypeReprs in Swift 3 mode.
jrose-apple Jan 3, 2017
6705350
Merge pull request #6534 from apple/revert-6459-libedit-windows
shahmishal Jan 3, 2017
2706904
[SIL Box types] Handle box types with layouts with non-parameter requ…
DougGregor Jan 3, 2017
d2f490e
Merge pull request #6509 from slavapestov/mi-fix
shahmishal Jan 3, 2017
3ddf178
SILGen: Basic implementation of withoutActuallyEscaping.
jckarter Jan 3, 2017
0d09619
Merge pull request #6535 from jrose-apple/compounding-problems
jrose-apple Jan 3, 2017
f130bb1
Sema: Fix recent regression where generic parameters were considered …
slavapestov Jan 3, 2017
cd4a1eb
Merge pull request #6536 from slavapestov/fix-objc-inference-regression
slavapestov Jan 4, 2017
06b6ba6
Merge pull request #6479 from jrose-apple/importer-cleanup
jrose-apple Jan 4, 2017
6f25956
Merge pull request #6527 from jpsim/jp-remove-redundant-optional-nil-…
CodaFi Jan 4, 2017
5d18d27
Merge pull request #6529 from ole/patch-1
CodaFi Jan 4, 2017
3828784
Merge pull request #6526 from jpsim/jp-return-arrow-whitespace
CodaFi Jan 4, 2017
6dd2dda
Merge pull request #6525 from jpsim/jp-omit-control-statement-parens
CodaFi Jan 4, 2017
359a664
Merge pull request #6520 from jpsim/jp-trailing-semicolon
CodaFi Jan 4, 2017
46eb397
[RangeInfo] Some enrichment on reported range info. (#6475)
nkcsgexi Jan 4, 2017
e1822bc
Merge pull request #6516 from sigito/patch-1
CodaFi Jan 4, 2017
891729f
remove redundant '-> Void' return types from functions in stdlib source
jpsim Jan 1, 2017
9a389d5
Merge pull request #6456 from jrose-apple/it-is-a-lot-to-process
jrose-apple Jan 4, 2017
a598ed6
Sema: Fixes for generic typealiases and nested type lookup
slavapestov Jan 2, 2017
3fae2be
Format doxygen comment correctly.
gottesmm Dec 27, 2016
b95a34a
Add a new utility called reverse_range(start, end) that returns a rev…
gottesmm Dec 27, 2016
b5e3524
Introduce a new Cleanup called EndBorrowCleanup
gottesmm Dec 22, 2016
fd5b46d
Mirror +1 rvalue SILGenFunction convenience APIs for +0 rvalues.
gottesmm Dec 22, 2016
e9319fa
Now that non-trivial +0 rvalues have cleanups, fix up a comment.
gottesmm Dec 22, 2016
e265cc6
Merge pull request #6499 from hughbe/lib-prefix-stdlib
swift-ci Jan 4, 2017
861f52c
Merge pull request #6540 from DougGregor/sil-box-deserialization
swift-ci Jan 4, 2017
e36b52c
Resolve some compiler crashers
CodaFi Dec 29, 2016
51dc142
[28419] Extend nested init-chaining diagnostics to defer statements
CodaFi Dec 29, 2016
c20e012
[28396] Remove an assert that is too strict.
CodaFi Dec 29, 2016
3a4eb3f
Validate an assumption in 'lookupConstructors'
CodaFi Dec 30, 2016
adb862d
[SR-3210] Closures aren't the only things that can implicitly capture…
CodaFi Dec 31, 2016
9bb914a
[SR-3523] Coercions that implicitly look through IUOs should not prop…
CodaFi Jan 2, 2017
b294198
Merge pull request #6539 from slavapestov/nested-type-lookup-derived-…
slavapestov Jan 4, 2017
57ffa60
Merge pull request #6524 from jpsim/jp-remove-func-void-return
CodaFi Jan 4, 2017
87dd722
Merge pull request #6489 from xedin/assign-crashers
slavapestov Jan 4, 2017
bd53d2a
Merge pull request #6491 from xedin/crasher-28544
slavapestov Jan 4, 2017
822bb35
Merge pull request #6497 from xedin/crasher-28497
slavapestov Jan 4, 2017
0a179db
Merge pull request #6492 from xedin/crasher-28505
slavapestov Jan 4, 2017
fb35153
[Diagnostics] When checking AssignExpr properly diagnose destination
xedin Dec 31, 2016
5330485
Merge pull request #6477 from gottesmm/semantic_sil_managed_value
gottesmm Jan 4, 2017
d1b1361
Merge pull request #6504 from CodaFi/crash-AAAAAHHH
slavapestov Jan 4, 2017
7db9ac9
Merge pull request #6518 from jtbandes/a-chain-is-only-as-strong-as-i…
slavapestov Jan 4, 2017
66e4597
Merge pull request #6451 from shajrawi/outline_enum_retain_release
Jan 4, 2017
796df2d
Merge pull request #6429 from jckarter/type-of-by-overload-resolution
jckarter Jan 4, 2017
f56f403
Merge pull request #6528 from CodaFi/minimum-escape-velocity
slavapestov Jan 4, 2017
00c1947
Merge pull request #6501 from xedin/crasher-28520
slavapestov Jan 4, 2017
4cb5aef
Merge pull request #6511 from xedin/crasher-28586
slavapestov Jan 4, 2017
5da7e10
Merge pull request #6481 from xedin/diagnose-closure-return
slavapestov Jan 4, 2017
053ca89
Merge pull request #6476 from practicalswift/swiftc-28595-typeinconte…
slavapestov Jan 4, 2017
eb78182
Merge pull request #6510 from xedin/crasher-28592
slavapestov Jan 4, 2017
ad01c1e
SILGen: Implement missing function conversions from tuples to Any
slavapestov Dec 22, 2016
2517701
SILGen: Emit local types with a separate pass instead of while walkin…
slavapestov Dec 23, 2016
9f8ccd4
SILGen: Fix for tuple conversions in function argument position
slavapestov Dec 31, 2016
ab81426
SIL: Fix SILType substitution bug with DynamicSelfType vs MetatypeType
slavapestov Dec 31, 2016
54754c5
SILGen: Fix dynamic calls of 'throwing' methods
slavapestov Jan 1, 2017
4daf56b
SILGen: Fix calls to literal constructors defined in protocol extensions
slavapestov Jan 1, 2017
5f9fe6f
SILGen: Fix crash with non-scalar casts requiring re-abstraction
slavapestov Jan 1, 2017
3b388df
SILGen: Don't try using materializeForSet with storage in an @objc pr…
slavapestov Jan 2, 2017
fca7b66
Merge pull request #6521 from jpsim/jp-void-return
CodaFi Jan 4, 2017
65688bd
[gardening] replace unused closure parameters with '_' in stdlib sour…
jpsim Jan 4, 2017
dfed050
Merge pull request #6505 from practicalswift/mark-as-fixed
slavapestov Jan 4, 2017
a8da5b8
Merge pull request #6514 from xedin/SR_3506
slavapestov Jan 4, 2017
7258861
Merge pull request #6515 from xedin/crasher-28588
slavapestov Jan 4, 2017
88ecaad
Merge pull request #6543 from slavapestov/small-silgen-fixes
slavapestov Jan 4, 2017
f801430
Merge pull request #6517 from sigito/patch-2
swift-ci Jan 4, 2017
02c665f
[Serialization] Associated types are never private. (#6537)
jrose-apple Jan 4, 2017
2c7aae4
Sema: 'Never'-returning functions can be represented in Objective-C
slavapestov Dec 23, 2016
7e1bc3c
AST: Fix calls to protocol extension methods from class methods retur…
slavapestov Dec 30, 2016
fdaace5
Sema: Fix terrible bug with the '() -> T' => '() -> ()' implicit conv…
slavapestov Dec 30, 2016
a27d554
Sema: Fix SILGen crash with throwing @objc constructor with single tu…
slavapestov Jan 1, 2017
8bfe205
AST: Make TypeBase::getSuperclass() return the superclass type when c…
slavapestov Dec 22, 2016
48c529b
Resolve SIL crasher which started passing at some point
slavapestov Jan 2, 2017
b258ebe
Merge pull request #6482 from practicalswift/§
swift-ci Jan 4, 2017
954f7d0
Merge pull request #6545 from slavapestov/small-sema-fixes
slavapestov Jan 4, 2017
6bea953
Merge pull request #6523 from jpsim/jp-inconsistent-closure-spacing
slavapestov Jan 4, 2017
54752d4
Merge pull request #6495 from modocache/ast-dump-colors
slavapestov Jan 4, 2017
645d262
IRGen: Fix Clang type conversion for pointers to optionals of metatypes
slavapestov Jan 1, 2017
9f30532
Sema: Fix closeExistential() in CSApply with invalid direct call of m…
slavapestov Dec 25, 2016
9db06ee
Sema: Fixes for handling of 'Self'-returning methods
slavapestov Dec 25, 2016
4d34975
SIL: Use new TypeBase::eraseDynamicSelfType()
slavapestov Dec 28, 2016
a72eba1
SILGen: Implement function conversions involving opened existentials
slavapestov Dec 28, 2016
b5da219
Sema: Fix crash when closing an existential reference necessitates tu…
slavapestov Dec 29, 2016
9b03f9d
SILGen: Fix reabstraction thunk emission when generic parameters are …
slavapestov Dec 30, 2016
1682052
This test requires Objective-C interop
slavapestov Dec 30, 2016
709e12d
Merge pull request #6546 from slavapestov/existential-dilemma
slavapestov Jan 4, 2017
f19cbef
Sema: Try harder not to perform lookups into tuple types
slavapestov Dec 23, 2016
8f96606
Sema: Remove TupleToScalar conversion, which did nothing useful excep…
slavapestov Dec 23, 2016
0107840
Merge pull request #6548 from slavapestov/fix-tuple-crash-on-invalid
slavapestov Jan 4, 2017
32ebe2d
Parse: Don't crash if property with no declared type has addressors
slavapestov Dec 23, 2016
e6ada30
Parse: Fix crash when alignment is too large
slavapestov Dec 23, 2016
c7ab11f
Sema: Fix crash in 'var' parameter migration
slavapestov Dec 23, 2016
2932aac
AST: More accurate AbstractFunctionDecl::getImplicitSelfDecl()
slavapestov Dec 25, 2016
d406c4d
ASTVerifier: Don't check Override attribute if we haven't done early …
slavapestov Dec 25, 2016
469cccd
Sema: Avoid infinite recursion in associated type inference
slavapestov Dec 25, 2016
e455085
Sema: When opening an UnboundGenericType, don't put replacements in t…
slavapestov Dec 25, 2016
a230bde
AST: Clean up getDeclaredType() and friends
slavapestov Dec 23, 2016
cc2ae7b
AST: Fix crash with invalid generic environment
slavapestov Dec 23, 2016
b6d8bbb
AST: Return abstract conformance for UnresolvedType
slavapestov Dec 24, 2016
2b05dd9
AST: Remove error path that was causing crashes
slavapestov Dec 20, 2016
af934f2
Sema: Allow local types to conform to protocols with associated types
slavapestov Dec 25, 2016
2eeb8f5
AST: Fix crash when type nested inside generic function conforms to a…
slavapestov Dec 26, 2016
e4abdfc
AST: Model protocols nested inside other types
slavapestov Dec 25, 2016
0a7e1d5
Sema: Fix crash in conformance checking
slavapestov Dec 23, 2016
1fc7dbe
Merge pull request #6549 from slavapestov/fix-assorted-crashers
slavapestov Jan 4, 2017
b8d60e9
Sema: Clean up logic for forming type witness substitutions
slavapestov Dec 26, 2016
3d7cac5
Sema: Simplify checkUnsupportedNestedGeneric()
slavapestov Dec 23, 2016
fd3101e
ASTVerifier: Add missing newline in some printouts
slavapestov Dec 25, 2016
71df32f
Sema: Add some asserts
slavapestov Dec 25, 2016
43ce2e7
AST: Simplify DeclContext::getGeneric{Signature,Environment}OfContext()
slavapestov Dec 15, 2016
2555135
AST: Remove DeclContext::isValidGenericContext()
slavapestov Dec 26, 2016
064fda5
AST: Remove Type::getCanonicalTypeOrNull()
slavapestov Dec 28, 2016
16bb0cd
AST: Remove some dead code from UnqualifiedLookup logic
slavapestov Jan 2, 2017
9e6089a
[bug-reducer] Fix an issue where we would always print the last optim…
gottesmm Jan 4, 2017
4b24cd4
Merge pull request #6551 from gottesmm/bug_reducer_fix
swift-ci Jan 4, 2017
6c9f99f
Merge pull request #6550 from slavapestov/sema-cleanups
slavapestov Jan 4, 2017
584f47d
Sema: Fix crashes in CSDiag
slavapestov Dec 25, 2016
18adb53
Sema: Tighten up name lookup routines to not look through metatypes/l…
slavapestov Jan 3, 2017
41dde88
Sema: Allow unqualified type lookup to find typealiases in protocols
slavapestov Jan 3, 2017
e65d867
Merge pull request #6552 from slavapestov/protocol-typealias-unqualif…
slavapestov Jan 4, 2017
412559a
Add test cases for a few bugs that seem to be fixed already
slavapestov Dec 22, 2016
b47eff1
Merge pull request #6553 from slavapestov/some-more-regression-tests
slavapestov Jan 4, 2017
ab56a69
[swiftc (20 vs. 5389)] Add crasher in swift::GenericSignature::enumer…
practicalswift Jan 4, 2017
1aeca5b
Merge pull request #6555 from practicalswift/swiftc-28596-unreachable…
practicalswift Jan 4, 2017
a5ae8a5
[swiftc (21 vs. 5389)] Add crasher in swift::NewMangling::Mangler::ap…
practicalswift Jan 4, 2017
146a537
Merge pull request #6556 from practicalswift/swiftc-28597-first-char-…
practicalswift Jan 4, 2017
12cbf5d
[swiftc (22 vs. 5389)] Add crasher in swift::IterativeTypeChecker::sa…
practicalswift Jan 4, 2017
d9624dc
Merge pull request #6557 from practicalswift/swiftc-28598-issatisfied…
practicalswift Jan 4, 2017
673b297
[swiftc (23 vs. 5389)] Add crasher in swift::TypeChecker::resolveType…
practicalswift Jan 4, 2017
c80559d
Merge pull request #6558 from practicalswift/swiftc-28599-false-shoul…
practicalswift Jan 4, 2017
150d484
[swiftc (24 vs. 5389)] Add crasher in swift::Parser::parseTopLevel(...)
practicalswift Jan 4, 2017
7268654
Merge pull request #6559 from practicalswift/swiftc-28600-isinsilmode…
practicalswift Jan 4, 2017
c3bce78
[swiftc (25 vs. 5389)] Add crasher in swift::ASTVisitor
practicalswift Jan 4, 2017
b1c793e
[PrintAsObjC] Special-case <os/object.h> types, like Dispatch. (#6544)
jrose-apple Jan 4, 2017
92dd5f5
Integrated upstream change to Data
airspeedswift Jan 4, 2017
ca7046e
Merge pull request #6560 from practicalswift/swiftc-28601-getkind-exp…
practicalswift Jan 4, 2017
c8ced0d
Migrate _copyContents to be called from UnsafeMutableBufferPointer wi…
airspeedswift Oct 28, 2016
1c48b31
Move += operator for append(contentsOf:) up to RangeReplaceableCollec…
airspeedswift Oct 31, 2016
dc1b6ae
Added test of += matching .append(contentsOf:) to StdLibUnitTest
airspeedswift Oct 31, 2016
3b25d59
Added test for undercounted collection not crashing
airspeedswift Nov 1, 2016
f484576
Switch to _copyContents returning an (Iterator,UnsafeBuffer.Index)
airspeedswift Nov 4, 2016
299db43
perf improvement to Sequence._copyContents
airspeedswift Dec 18, 2016
db520f2
Fix accidental miscommit
airspeedswift Dec 18, 2016
f91e043
updated UnsafeBuffer.initialize(from:) docs and labelled returned tuple
airspeedswift Dec 30, 2016
71fea23
Integrated upstream change to Data
airspeedswift Jan 4, 2017
ba49dac
Merge branch 'collapse-append-contentsof' of github.com:airspeedswift…
airspeedswift Jan 4, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 0 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ set_property(GLOBAL PROPERTY JOB_POOL_LINK local_jobs)

# First include general CMake utilities.
include(SwiftUtils)
include(CheckSymbolExists)

#
# User-configurable options that control the inclusion and default build
Expand Down Expand Up @@ -806,8 +805,6 @@ if(LIBXML2_FOUND)
set(SWIFT_HAVE_LIBXML 1)
endif()

check_symbol_exists(el_wgets "histedit.h" HAVE_UNICODE_LIBEDIT)

if (LLVM_ENABLE_DOXYGEN)
message(STATUS "Doxygen: enabled")
endif()
Expand Down
4 changes: 1 addition & 3 deletions cmake/modules/AddSwift.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,6 @@ function(_add_variant_link_flags)
list(APPEND library_search_directories
"${SWIFT_ANDROID_PREBUILT_PATH}/lib/gcc/arm-linux-androideabi/${SWIFT_ANDROID_NDK_GCC_VERSION}.x")
else()
list(APPEND result "-lobjc")

# If lto is enabled, we need to add the object path flag so that the LTO code
# generator leaves the intermediate object file in a place where it will not
# be touched. The reason why this must be done is that on OS X, debug info is
Expand Down Expand Up @@ -1588,7 +1586,7 @@ function(add_swift_library name)
else()
if("${sdk}" STREQUAL "WINDOWS")
set(UNIVERSAL_LIBRARY_NAME
"${SWIFTLIB_DIR}/${SWIFT_SDK_${sdk}_LIB_SUBDIR}/lib${name}.lib")
"${SWIFTLIB_DIR}/${SWIFT_SDK_${sdk}_LIB_SUBDIR}/${name}.lib")
else()
set(UNIVERSAL_LIBRARY_NAME
"${SWIFTLIB_DIR}/${SWIFT_SDK_${sdk}_LIB_SUBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}${name}${CMAKE_STATIC_LIBRARY_SUFFIX}")
Expand Down
3 changes: 3 additions & 0 deletions docs/ABI.rst
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,9 @@ Globals
global ::= type 'WV' // value witness table
global ::= entity 'Wv' DIRECTNESS // field offset

global ::= type 'Wy' // Outlined Copy Function Type
global ::= type 'We' // Outlined Consume Function Type

DIRECTNESS ::= 'd' // direct
DIRECTNESS ::= 'i' // indirect

Expand Down
2 changes: 1 addition & 1 deletion docs/ARCOptimization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@ Consider the following pseudo-Swift example::

var GLOBAL_D : D = D1()

class C { deinit { GLOBAL_D = D2 } }
class C { deinit { GLOBAL_D = D2() } }

func main() {
let c = C()
Expand Down
4 changes: 4 additions & 0 deletions include/swift/AST/ASTNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#define SWIFT_AST_AST_NODE_H

#include "llvm/ADT/PointerUnion.h"
#include "swift/AST/SourceEntityWalker.h"
#include "swift/AST/TypeAlignments.h"

namespace swift {
Expand All @@ -44,6 +45,9 @@ namespace swift {
void walk(ASTWalker &Walker);
void walk(ASTWalker &&walker) { walk(walker); }

void walk(SourceEntityWalker &Walker);
void walk(SourceEntityWalker &&walker) { walk(walker); }

/// \brief get the underlying entity as a decl context if it is one,
/// otherwise, return nullptr;
DeclContext *getAsDeclContext() const;
Expand Down
7 changes: 0 additions & 7 deletions include/swift/AST/Decl.h
Original file line number Diff line number Diff line change
Expand Up @@ -5070,13 +5070,6 @@ class FuncDecl final : public AbstractFunctionDecl,
FuncDeclBits.HasDynamicSelf = hasDynamicSelf;
}

/// Determine whether this method has an archetype \c Self return
/// type. This is when a method defined in a protocol extension
/// returns Self. In this case, the type is not quite as constrained
/// as a dynamic Self, because it is bound to the conforming type,
/// not the dynamic type of the value.
bool hasArchetypeSelf() const;

void getLocalCaptures(SmallVectorImpl<CapturedValue> &Result) const {
return getCaptureInfo().getLocalCaptures(Result);
}
Expand Down
5 changes: 0 additions & 5 deletions include/swift/AST/DeclContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -390,11 +390,6 @@ class alignas(1 << DeclContextAlignInBits) DeclContext {
/// any of its parents have generic parameters.
bool isGenericContext() const;

/// Determine whether this declaration context is a generic context that has
/// been fully type checked, meaning it has a valid GenericSignature and
/// GenericEnvironment.
bool isValidGenericContext() const;

/// Determine whether the innermost context is generic.
bool isInnermostContextGeneric() const;

Expand Down
3 changes: 3 additions & 0 deletions include/swift/AST/DiagnosticsSema.def
Original file line number Diff line number Diff line change
Expand Up @@ -2432,6 +2432,9 @@ NOTE(fix_unqualified_access_top_level_multi,none,
"use '%0' to reference the %1 in module %2",
(StringRef, DescriptiveDeclKind, Identifier))

ERROR(unsupported_special_decl_ref, none,
"referencing %0 as a function value is not implemented", (Identifier))

WARNING(use_of_qq_on_non_optional_value,none,
"left side of nil coalescing operator '?""?' has non-optional type %0, "
"so the right side is never used", (Type))
Expand Down
63 changes: 63 additions & 0 deletions include/swift/AST/Expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -2522,6 +2522,69 @@ class ForceValueExpr : public Expr {
}
};

/// \brief An expression that grants temporary escapability to a nonescaping
/// closure value.
///
/// This expression is formed by the type checker when a call to the
/// `withoutActuallyEscaping` declaration is made.
class MakeTemporarilyEscapableExpr : public Expr {
Expr *NonescapingClosureValue;
OpaqueValueExpr *EscapingClosureValue;
Expr *SubExpr;
SourceLoc NameLoc, LParenLoc, RParenLoc;

public:
MakeTemporarilyEscapableExpr(SourceLoc NameLoc,
SourceLoc LParenLoc,
Expr *NonescapingClosureValue,
Expr *SubExpr,
SourceLoc RParenLoc,
OpaqueValueExpr *OpaqueValueForEscapingClosure,
bool implicit = false)
: Expr(ExprKind::MakeTemporarilyEscapable, implicit, Type()),
NonescapingClosureValue(NonescapingClosureValue),
EscapingClosureValue(OpaqueValueForEscapingClosure),
SubExpr(SubExpr),
NameLoc(NameLoc), LParenLoc(LParenLoc), RParenLoc(RParenLoc)
{}

SourceLoc getStartLoc() const {
return NameLoc;
}
SourceLoc getEndLoc() const {
return RParenLoc;
}

SourceLoc getLoc() const {
return NameLoc;
}

/// Retrieve the opaque value representing the escapable copy of the
/// closure.
OpaqueValueExpr *getOpaqueValue() const { return EscapingClosureValue; }

/// Retrieve the nonescaping closure expression.
Expr *getNonescapingClosureValue() const {
return NonescapingClosureValue;
}
void setNonescapingClosureValue(Expr *e) {
NonescapingClosureValue = e;
}

/// Retrieve the subexpression that has access to the escapable copy of the
/// closure.
Expr *getSubExpr() const {
return SubExpr;
}
void setSubExpr(Expr *e) {
SubExpr = e;
}

static bool classof(const Expr *E) {
return E->getKind() == ExprKind::MakeTemporarilyEscapable;
}
};

/// \brief An expression that opens up a value of protocol or protocol
/// composition type and gives a name to its dynamic type.
///
Expand Down
1 change: 1 addition & 0 deletions include/swift/AST/ExprNodes.def
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ EXPR(BindOptional, Expr)
EXPR(OptionalEvaluation, Expr)
EXPR(ForceValue, Expr)
EXPR(OpenExistential, Expr)
EXPR(MakeTemporarilyEscapable, Expr)
ABSTRACT_EXPR(Apply, Expr)
EXPR(Call, ApplyExpr)
EXPR(PrefixUnary, ApplyExpr)
Expand Down
5 changes: 4 additions & 1 deletion include/swift/AST/Pattern.h
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,10 @@ class EnumElementPattern : public Pattern {
: NameLoc;
}
SourceLoc getEndLoc() const {
return SubPattern ? SubPattern->getSourceRange().End : NameLoc;
if (SubPattern && SubPattern->getSourceRange().isValid()) {
return SubPattern->getSourceRange().End;
}
return NameLoc;
}
SourceRange getSourceRange() const { return {getStartLoc(), getEndLoc()}; }

Expand Down
6 changes: 6 additions & 0 deletions include/swift/AST/SourceEntityWalker.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ class SourceEntityWalker {
/// Walks the provided DeclContext.
/// \returns true if traversal was aborted, false otherwise.
bool walk(DeclContext *DC);
/// Walks the provided Stmt.
/// \returns true if traversal was aborted, false otherwise.
bool walk(Stmt *S);
/// Walks the provided Expr.
/// \returns true if traversal was aborted, false otherwise.
bool walk(Expr *E);

/// This method is called when first visiting a decl, before walking into its
/// children. If it returns false, the subtree is skipped.
Expand Down
3 changes: 0 additions & 3 deletions include/swift/AST/Type.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,6 @@ class Type {
/// Return the name of the type as a string, for use in diagnostics only.
std::string getString(const PrintOptions &PO = PrintOptions()) const;

/// Get the canonical type, or return null if the type is null.
CanType getCanonicalTypeOrNull() const; // in Types.h

/// Computes the join between two types.
///
/// The join of two types is the most specific type that is a supertype of
Expand Down
2 changes: 1 addition & 1 deletion include/swift/AST/TypeNodes.def
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ ABSTRACT_TYPE(Nominal, Type)
TYPE(Enum, NominalType)
TYPE(Struct, NominalType)
TYPE(Class, NominalType)
ALWAYS_CANONICAL_TYPE(Protocol, NominalType)
TYPE(Protocol, NominalType)
TYPE_RANGE(Nominal, Enum, Protocol)
ABSTRACT_TYPE(AnyMetatype, Type)
TYPE(Metatype, AnyMetatypeType)
Expand Down
4 changes: 4 additions & 0 deletions include/swift/AST/TypeRepr.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@ class GenericIdentTypeRepr : public ComponentIdentTypeRepr {
: ComponentIdentTypeRepr(TypeReprKind::GenericIdent, Loc, Id),
GenericArgs(GenericArgs), AngleBrackets(AngleBrackets) {
assert(!GenericArgs.empty());
#ifndef NDEBUG
for (auto arg : GenericArgs)
assert(arg != nullptr);
#endif
}

ArrayRef<TypeRepr*> getGenericArgs() const { return GenericArgs; }
Expand Down
50 changes: 35 additions & 15 deletions include/swift/AST/Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ namespace swift {
class TypeVariableType;
class ValueDecl;
class ModuleDecl;
class ModuleType;
class ProtocolConformance;
struct SILArgumentConvention;
enum OptionalTypeKind : unsigned;
Expand Down Expand Up @@ -489,7 +490,11 @@ class alignas(1 << TypeAlignInBits) TypeBase {

/// Erase the given opened existential type by replacing it with its
/// existential type throughout the given type.
Type eraseOpenedExistential(ModuleDecl *module, ArchetypeType *opened);
Type eraseOpenedExistential(ArchetypeType *opened);

/// Erase DynamicSelfType from the given type by replacing it with its
/// underlying type.
Type eraseDynamicSelfType();

/// \brief Compute and return the set of type variables that occur within this
/// type.
Expand Down Expand Up @@ -643,6 +648,23 @@ class alignas(1 << TypeAlignInBits) TypeBase {
/// with a class type.
bool mayHaveSuperclass();

/// \brief Determine whether this type can be used as a base type for AST
/// name lookup, which is the case for nominal types, protocol compositions
/// and archetypes.
///
/// Generally, the static vs instanec and mutating vs nonmutating distinction
/// is handled elsewhere, so metatypes, lvalue types and inout types are not
/// allowed here.
///
/// Similarly, tuples formally have members, but this does not go through
/// name lookup.
bool mayHaveMembers() {
return (is<ArchetypeType>() ||
is<ModuleType>() ||
isExistentialType() ||
getAnyNominal());
}

/// \brief Retrieve the superclass of this type.
///
/// \param resolver The resolver for lazy type checking, or null if the
Expand Down Expand Up @@ -778,6 +800,13 @@ class alignas(1 << TypeAlignInBits) TypeBase {
/// the result would be the (parenthesized) type ((int, int)).
Type getUnlabeledType(ASTContext &Context);

/// Retrieve the type without any labels around it. For example, given
/// \code
/// (p : int)
/// \endcode
/// the result would be the (unparenthesized) type 'int'.
Type getWithoutImmediateLabel();

/// Retrieve the type without any parentheses around it.
Type getWithoutParens();

Expand All @@ -792,8 +821,7 @@ class alignas(1 << TypeAlignInBits) TypeBase {
/// replacing the type. With uncurry level == 0, this simply
/// replaces the current type with the new result type.
Type replaceCovariantResultType(Type newResultType,
unsigned uncurryLevel,
bool preserveOptionality = true);
unsigned uncurryLevel);

/// Returns a new function type exactly like this one but with the self
/// parameter replaced. Only makes sense for function members of types.
Expand Down Expand Up @@ -3548,7 +3576,7 @@ class ProtocolType : public NominalType, public llvm::FoldingSetNode {
public:
/// \brief Retrieve the type when we're referencing the given protocol.
/// declaration.
static ProtocolType *get(ProtocolDecl *D, const ASTContext &C);
static ProtocolType *get(ProtocolDecl *D, Type Parent, const ASTContext &C);

ProtocolDecl *getDecl() const {
return reinterpret_cast<ProtocolDecl *>(NominalType::getDecl());
Expand Down Expand Up @@ -3593,7 +3621,8 @@ class ProtocolType : public NominalType, public llvm::FoldingSetNode {

private:
friend class NominalTypeDecl;
ProtocolType(ProtocolDecl *TheDecl, const ASTContext &Ctx);
ProtocolType(ProtocolDecl *TheDecl, Type Parent, const ASTContext &Ctx,
RecursiveTypeProperties properties);
};
BEGIN_CAN_TYPE_WRAPPER(ProtocolType, NominalType)
void getAnyExistentialTypeProtocols(SmallVectorImpl<ProtocolDecl *> &protos) {
Expand Down Expand Up @@ -4431,12 +4460,7 @@ inline Type TypeBase::getRValueObjectType() {
type = lv->getObjectType();

// Look through argument list tuples.
if (auto tupleTy = type->getAs<TupleType>()) {
if (tupleTy->getNumElements() == 1 && !tupleTy->getElement(0).isVararg())
type = tupleTy->getElementType(0);
}

return type;
return type->getWithoutImmediateLabel();
}

/// getLValueOrInOutObjectType - For an @lvalue or inout type, retrieves the
Expand Down Expand Up @@ -4526,10 +4550,6 @@ ParameterTypeFlags::fromParameterType(Type paramTy, bool isVariadic) {
return {isVariadic, autoclosure, escaping};
}

inline CanType Type::getCanonicalTypeOrNull() const {
return isNull() ? CanType() : getPointer()->getCanonicalType();
}

#define TYPE(id, parent)
#define SUGARED_TYPE(id, parent) \
template <> \
Expand Down
2 changes: 2 additions & 0 deletions include/swift/Basic/DemangleNodes.def
Original file line number Diff line number Diff line change
Expand Up @@ -177,5 +177,7 @@ NODE(ThrowsAnnotation)
NODE(EmptyList)
NODE(FirstElementMarker)
NODE(VariadicMarker)
NODE(OutlinedCopy)
NODE(OutlinedConsume)
#undef CONTEXT_NODE
#undef NODE
Loading