Skip to content

[frontend] Fix use-after-free issue found via ASAN #9335

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
535 commits
Select commit Hold shift + click to select a range
fd9c199
Merge remote-tracking branch 'origin/swift-3.1-branch' into swift-4.0…
swift-ci Feb 21, 2017
b6f4df1
Revert "[Bridging PCH] Make -enable-bridging-pch the default."
graydon Feb 21, 2017
ba10152
Merge pull request #7676 from graydon/rdar-30640327-revert-default-br…
tkremenek Feb 22, 2017
ff28473
Merge remote-tracking branch 'origin/swift-3.1-branch' into swift-4.0…
swift-ci Feb 22, 2017
1cdd367
[ASTPrinter] Restore printing generic requirement contexts
bitjammer Feb 21, 2017
afc3c95
Post-commit review: Remove sneaky file, don't use callPrintStructurePost
bitjammer Feb 21, 2017
4f93035
Merge pull request #7675 from bitjammer/rdar-30561880-missing-constra…
tkremenek Feb 22, 2017
d23673c
Merge remote-tracking branch 'origin/swift-3.1-branch' into swift-4.0…
swift-ci Feb 22, 2017
0b8d3f1
Merge pull request #7604 from aschwaighofer/irgen_test_fix_abi_v7k_sw…
bob-wilson Feb 22, 2017
5eb8b79
Merge remote-tracking branch 'origin/swift-3.1-branch' into swift-4.0…
swift-ci Feb 22, 2017
30ed291
ClangImporter: Adopt for clang change 2b4323722 and unbreak the tests…
adrian-prantl Feb 22, 2017
c48dd28
Merge pull request #7687 from adrian-prantl/30384801
adrian-prantl Feb 22, 2017
12bc053
Merge remote-tracking branch 'origin/swift-3.1-branch' into swift-4.0…
swift-ci Feb 22, 2017
49fde06
Revert "Merge pull request #7650 from kballard/urlerror_swift_cases"
lilyball Feb 22, 2017
6e30520
[SDK] Add missing URLError.Code cases
lilyball Feb 22, 2017
584dbda
Merge pull request #7695 from kballard/urlerror_enum
tkremenek Feb 23, 2017
fba7218
Merge remote-tracking branch 'origin/swift-3.1-branch' into swift-4.0…
swift-ci Feb 23, 2017
ec7d5d3
SILGen: Fix overrelease of pattern bindings shared from multiple patt…
jckarter Feb 23, 2017
85ac4cb
Revert "ClangImporter: Adopt for clang change 2b4323722 and unbreak t…
adrian-prantl Feb 23, 2017
5a5eefc
Merge pull request #7716 from adrian-prantl/revert
adrian-prantl Feb 23, 2017
5bdc52b
Merge pull request #7715 from jckarter/switch-join-copy-3.1
tkremenek Feb 24, 2017
469a3e5
Merge remote-tracking branch 'origin/swift-3.1-branch' into swift-4.0…
swift-ci Feb 24, 2017
54238c0
[Constraint solver] Dont assume orphans are along in the inactive list.
DougGregor Feb 24, 2017
7e1648c
Merge pull request #7741 from DougGregor/sr-4056-3.1
tkremenek Feb 24, 2017
71d19ff
Merge remote-tracking branch 'origin/swift-3.1-branch' into swift-4.0…
swift-ci Feb 24, 2017
41dc560
Revert "Revert "[Bridging PCH] Make -enable-bridging-pch the default.""
tkremenek Feb 25, 2017
be313b8
Merge pull request #7763 from apple/revert-7676-rdar-30640327-revert-…
tkremenek Feb 25, 2017
7140a1b
Merge remote-tracking branch 'origin/swift-3.1-branch' into swift-4.0…
swift-ci Feb 25, 2017
ef462c5
[Type checker] Teach areOverrideCompatibleSimple() to look at initial…
DougGregor Feb 27, 2017
691c11f
Merge pull request #7792 from DougGregor/sr-4059-3.1
tkremenek Feb 28, 2017
bead112
Merge remote-tracking branch 'origin/swift-3.1-branch' into swift-4.0…
swift-ci Feb 28, 2017
6d350ab
Sema/SIL: NSError has no special powers without ObjC interop.
jckarter Feb 25, 2017
3d5d4a3
Merge pull request #7847 from jckarter/nserror-linux-bridging-3.1
tkremenek Mar 2, 2017
d0bff63
Merge remote-tracking branch 'origin/swift-3.1-branch' into swift-4.0…
swift-ci Mar 2, 2017
b6b1f9d
Sema: Accept tautological assoc type inference candidates when same-t…
jckarter Mar 2, 2017
ab6538c
[AST] Don't recursively match DependentMemberTypes.
DougGregor Feb 9, 2017
fda2ddb
AST: Targeted fix for conformance lookup issue
slavapestov Mar 3, 2017
3b1f28d
[SR-3917] Allow missing witnesses for optional and unavailable requir…
DougGregor Mar 3, 2017
ba275ff
Merge pull request #7877 from jckarter/assoc-type-inference-same-type…
tkremenek Mar 3, 2017
f2b9e7f
Merge remote-tracking branch 'origin/swift-3.1-branch' into swift-4.0…
swift-ci Mar 3, 2017
845f97d
Merge pull request #7887 from slavapestov/substitution-map-conformanc…
tkremenek Mar 3, 2017
2eb0101
Merge pull request #7893 from DougGregor/sr-3917-3.1
tkremenek Mar 3, 2017
3ce6117
Merge remote-tracking branch 'origin/swift-3.1-branch' into swift-4.0…
swift-ci Mar 3, 2017
51bf3f9
Sema: Fix 'super' calls from methods returning 'Self'
slavapestov Mar 5, 2017
493db43
Merge pull request #7914 from slavapestov/super-wrong-upcast-fix-3.1
tkremenek Mar 5, 2017
d05ce87
Merge remote-tracking branch 'origin/swift-3.1-branch' into swift-4.0…
swift-ci Mar 5, 2017
4a01aed
[CodeCompletion] Delete expr type state after getting expr completions
bitjammer Mar 6, 2017
c982578
Merge pull request #7930 from bitjammer/rdar-30137466-code-complete-c…
tkremenek Mar 6, 2017
8e1e098
Merge remote-tracking branch 'origin/swift-3.1-branch' into swift-4.0…
swift-ci Mar 6, 2017
9983df9
[ClangImporter] Don't crash when a bad override affects NSErrors. (#7…
jrose-apple Mar 6, 2017
cab3121
Re-enable coverage smoke test (NFC)
vedantk Feb 15, 2017
2ef3315
[Coverage] Pass each prof name var to the lowering pass just once
vedantk Feb 15, 2017
2fabfe0
[Coverage] Prepare for an upcoming llvm fix (NFC)
vedantk Feb 15, 2017
b56467e
[Coverage] Tighten up test case (NFC)
vedantk Feb 15, 2017
ebaa82c
Merge pull request #7936 from jrose-apple/3.1-undeserved-assertions-f…
Mar 6, 2017
c9e1c4c
Merge remote-tracking branch 'origin/swift-3.1-branch' into swift-4.0…
swift-ci Mar 6, 2017
1d68cca
demangler: add an API to check if a function has the swiftcc calling …
eeckstein Mar 1, 2017
9abf2ed
[Bridging PCH] Serialize diagnostics in -emit-pch step.
graydon Mar 6, 2017
ce937d9
Merge pull request #7945 from graydon/rdar-30881110-bridging-pch-seri…
tkremenek Mar 7, 2017
3a4f6b6
Merge remote-tracking branch 'origin/swift-3.1-branch' into swift-4.0…
swift-ci Mar 7, 2017
601c968
Make sure ErrorTypes containing type variables are marked as such. (#…
jrose-apple Mar 7, 2017
00b540b
Merge pull request #7967 from jrose-apple/3.1-to-err-is-human
tkremenek Mar 8, 2017
198f7c8
Merge remote-tracking branch 'origin/swift-3.1-branch' into swift-4.0…
swift-ci Mar 8, 2017
173749f
[update-checkout] Backport recent fixes to 3.1 branch
colinhowell Mar 14, 2017
ed97f66
Merge pull request #8078 from colinhowell/3.1-update-checkout-fixes
tkremenek Mar 14, 2017
f06c1af
Merge remote-tracking branch 'origin/swift-3.1-branch' into swift-4.0…
swift-ci Mar 14, 2017
8754487
[Bridging PCH] Only emit deps for CompileJobActions rdar://31016087
graydon Mar 15, 2017
cdb6738
Merge pull request #8109 from graydon/rdar-31056789-pch-driver-crash-…
tkremenek Mar 15, 2017
c23eebc
Merge remote-tracking branch 'origin/swift-3.1-branch' into swift-4.0…
swift-ci Mar 15, 2017
5b9166b
Revert "Revert "Revert "[Bridging PCH] Make -enable-bridging-pch the …
graydon Mar 15, 2017
cf5f914
Merge pull request #8132 from graydon/rdar-31044067-disable-bridging-…
Mar 16, 2017
39639fd
Merge remote-tracking branch 'origin/swift-3.1-branch' into swift-4.0…
swift-ci Mar 16, 2017
1eb301f
Add -pch-output-directory driver flag and ClangImporter option
bitjammer Mar 22, 2017
3dbad45
Re-branch swift-4.0-branch from master (f301044384cf494d91f549a085851…
shahmishal Mar 29, 2017
03f7fc0
Pass CLANG_VERSION_* cmake flags to the LLVM build.
zisko Mar 28, 2017
fb99572
Merge pull request #8417 from zisko/what-clang-doesnt-know-will-hurt-…
erg Mar 30, 2017
8273789
pylint: make executable and fix a blank line error.
Mar 30, 2017
f9fbe21
[update-checkout] Update sub projects to use master branch for swift-…
shahmishal Mar 31, 2017
6489100
Merge pull request #8450 from erg/pylint-swift-4.0
erg Mar 31, 2017
1663bfc
[ClangImporter] Collect deps via subclass of clang::DependencyCollector.
graydon Mar 28, 2017
c11f33f
[Dependencies] Sort external file dependencies by more-stable order.
graydon Mar 28, 2017
71b606e
[Dependencies] Address review comments.
graydon Mar 29, 2017
49db0ef
[silgen] Create FormalEvaluationScope::verify().
gottesmm Mar 30, 2017
234f5e5
[silgen] Verify FormalEvaluationScopes in certain places in SILGenApply.
gottesmm Mar 30, 2017
1c38ae5
[silgen] Eliminate an unnecessary writeback scope.
gottesmm Mar 30, 2017
b4f3958
Merge pull request #8444 from jrose-apple/class-before-category
jrose-apple Mar 31, 2017
1274c8e
Merge pull request #8468 from jrose-apple/class-before-category-has-p…
swift-ci Mar 31, 2017
acb18e8
Merge pull request #8504 from gottesmm/rdar_31313534_swift40_cherrypick
gottesmm Apr 3, 2017
5c59d10
Merge pull request #8507 from jrose-apple/4.0-class-before-category-a…
Apr 3, 2017
1dddd74
Sema: Don't synthesize materializeForSet if Optional type is missing
slavapestov Apr 3, 2017
a72c695
Sema: Fix materializeForSet for members of extensions of imported cla…
slavapestov Apr 3, 2017
7d607c4
AST: Targeted fix for conformance lookup issue
slavapestov Apr 3, 2017
3126109
Use 2-space indent instead of 4-space indent in protocol_where_clause…
slavapestov Apr 3, 2017
e1ed45c
Merge pull request #8518 from slavapestov/materialize-for-set-is-alwa…
slavapestov Apr 4, 2017
5c7ef60
Merge pull request #8519 from slavapestov/the-narrowest-of-all-narrow…
slavapestov Apr 4, 2017
138debe
Make sure to lint the interpreted, not compiled python file
hughbe Mar 28, 2017
890eee5
Merge pull request #8529 from hughbe/cherrypick-linting
shahmishal Apr 4, 2017
48d7d90
Merge pull request #8506 from graydon/rdar-31044067-missing-dependenc…
graydon Apr 4, 2017
a4e03cd
[Foundation] Ensure data can be subscripted with all range types
phausler Apr 4, 2017
6c5afb3
Cache Code Completion results from PCH files
bitjammer Mar 22, 2017
fd13be5
Fix use-after-free introduced by 65668c9d82f.
adrian-prantl Apr 5, 2017
492b74e
Merge pull request #8572 from phausler/swift-4.0-branch_data_subscrip…
swift-ci Apr 5, 2017
b0e9479
ClangImporter: Adjust call to BinaryOperator constructor after clang …
eeckstein Apr 6, 2017
deee1a5
Merge pull request #8605 from eeckstein/fix-clangimporter
shahmishal Apr 7, 2017
050dde2
[ProtocolConformanceRef] Propagate concrete-lookup hack yet further.
DougGregor Apr 6, 2017
d70a67a
Merge pull request #8618 from DougGregor/rdar-31482855-4.0
DougGregor Apr 7, 2017
ed29977
Re-branch swift-4.0-branch (d70a67a5b22304d463ddb0ff7b67a71cec71c726)…
shahmishal Apr 8, 2017
15a12da
Fix DeadStoreElim by not lying about instruction semantics
aschwaighofer Apr 9, 2017
c98db37
Merge pull request #8651 from aschwaighofer/swift-4.0-branch-fix-dead…
bob-wilson Apr 9, 2017
d4c8705
[Preset] skip reconfigure when using test preset
shahmishal Apr 11, 2017
9a7f083
[Preset] Add new preset for llbuild, and skip test llbuild and cmark …
shahmishal Apr 11, 2017
4af8b33
[build-script] Add skip reconfigure flag to build-script-impl
shahmishal Apr 8, 2017
70a110a
Merge pull request #8689 from apple/swift-4-update-presets
swift-ci Apr 11, 2017
e2dbf67
SILGen: Push 'usingImplicitVariablesForPattern' hack into 'where' cla…
jckarter Apr 14, 2017
121ff7e
Merge pull request #8819 from jckarter/where-clause-var-swap-4.0
shahmishal Apr 17, 2017
7023d08
[Serialization] Filter Objective-C methods by mangled name rather tha…
DougGregor Apr 18, 2017
d2540a1
Merge pull request #8841 from DougGregor/serialize-objc-lookup-name-4.0
DougGregor Apr 18, 2017
c6e8d7d
Re-branch swift-4.0-branch from master '0006d8e5787d0b8d285989cb72203…
shahmishal Apr 18, 2017
f49a36f
Merge pull request #8854 from adrian-prantl/31205000
adrian-prantl Apr 19, 2017
276146f
Updated quick help XML to separate the comment data from the metadata
mxswd Apr 17, 2017
a04fee7
Updated to tests to match commit 452e535ba491897cbbc8a0ba8d7015ef37ea…
mxswd Apr 19, 2017
5275905
Merge pull request #8894 from mxswd/quickhelp-xml-swift-4.0-branch
bitjammer Apr 21, 2017
9be0234
Performance improvements for new integers (#8931)
swiftix Apr 22, 2017
02a8d10
Add Swift 3 compatibility versions of String.init for Signed/Unsigned…
airspeedswift Apr 22, 2017
79d0c5d
Mark conformances as "used" when the GenericSignatureBuilder needs them.
DougGregor Apr 22, 2017
2d74855
[Clang importer] Don't transfer IBAction attributes that don't make s…
DougGregor Apr 23, 2017
a7ad74b
[Type checker] Fail more usefully if something synthesizes a bogus at…
DougGregor Apr 23, 2017
53049af
[AST] Fix use-after-free due to a rogue getPointer().
DougGregor Apr 24, 2017
80183b6
[AST Verifier] Tolerate partially-validated ASTs.
DougGregor Apr 24, 2017
aa14bb4
Merge pull request #8970 from DougGregor/misc-fixes-4.0
DougGregor Apr 24, 2017
88eac85
[Type checker] Handle 'rethrows' checks for single-parameter functions.
DougGregor Apr 24, 2017
68e6abf
Try to fix race in getExistentialMetadata() unit tests
slavapestov Apr 19, 2017
54a3d41
Merge pull request #8980 from apple/rethrow-single-arg-func-4.0
DougGregor Apr 24, 2017
5d90b80
[ClangImporter] Classify enums using flag_enum and enum_extensibility…
jrose-apple Apr 21, 2017
5e66ed0
[ClangImporter] If enum_extensibility was removed, it's not an enum. …
jrose-apple Apr 25, 2017
3887db1
Merge pull request #8998 from jrose-apple/4.0-enums-using-attributes
swift-ci Apr 25, 2017
ebcb438
[Type checker] Fix rethrow checking with a single argument label harder.
DougGregor Apr 25, 2017
4e9f737
[Bridging cast optimization] Unchecked casts can perform a class down…
DougGregor Apr 25, 2017
920e4bb
Merge pull request #9009 from DougGregor/casts-and-errors-4.0
DougGregor Apr 25, 2017
29ad0d1
[Constraint solver] Look through lvalue types when establish nil-conv…
DougGregor Apr 26, 2017
ac11c53
Merge pull request #9023 from DougGregor/solver-lvalue-optional-4.0
swift-ci Apr 26, 2017
41f4ec6
[Substitution map] Hack: look at inherited conformances in lookupConf…
DougGregor Apr 26, 2017
91e231f
Merge pull request #9038 from DougGregor/submap-inherited-hack-4.0
DougGregor Apr 26, 2017
c1fc845
[GSB] Add RequirementSource::isProtocolRequirement() to check both pr…
DougGregor Apr 18, 2017
9ac3bd6
[GSB] Use RequirementSource::isProtocolRequirement() more.
DougGregor Apr 19, 2017
72e8fae
Weaken the circularity re-delay assertion when errors have been emitted.
rjmccall Apr 19, 2017
b7e2213
Disable a failing test: TestCharacterSet.test_moreSetOperations
eeckstein Apr 20, 2017
9f9c08b
Merge pull request #9050 from DougGregor/collected-fixes
DougGregor Apr 27, 2017
be96b33
Merge pull request #9055 from aschwaighofer/disable_flaky_testcharact…
aschwaighofer Apr 28, 2017
105cf60
[Serialization] Simplify some code, tentatively fixing rdar://3181251…
nkcsgexi Apr 30, 2017
e0a9c35
Fix the tbi test even harder.
gottesmm Apr 30, 2017
bbe07fa
Merge pull request #9076 from gottesmm/tbi_fixes_4.0_branch
swift-ci May 1, 2017
2bfc7b3
Re-branching swift-4.0-branch (bbe07fa1d4b9cf730b0a2f96ed4943481925f6…
shahmishal May 1, 2017
e887eb2
[Serialization] Ignore parsed declarations when resolving x-refs.
DougGregor May 1, 2017
52804dd
[Type checker] Downgrade some "redundant conformance" errors to warni…
DougGregor May 1, 2017
37de124
Merge pull request #9160 from DougGregor/redundant-conformance-warnin…
DougGregor May 1, 2017
5c263b7
[stdlib] New overload for joined()
May 1, 2017
896d7d0
Merge pull request #9165 from shajrawi/fix_linux_build
May 2, 2017
49dafe4
Merge pull request #9177 from shajrawi/fix_verifier_large_types
May 2, 2017
7c4ee78
Produce specialized conformances to AnyObject for bound generic types.
swiftix May 2, 2017
a9751ef
Merge pull request #9179 from apple/large_types_swift4_cherrypick
swift-ci May 2, 2017
114848e
[SE-0160] Make deprecated @objc inference warnings opt-in.
DougGregor May 1, 2017
410366e
[Exclusivity] Add deserialization callbacks from the optimizer.
atrick May 2, 2017
cfd2d2c
Merge pull request #9186 from atrick/swift-4.0-branch
swift-ci May 2, 2017
aaaea05
Merge pull request #9169 from moiseev/joined-4
swift-ci May 2, 2017
a40f088
SIL: Don't DFE functions referenced from KeyPath patterns.
jckarter May 2, 2017
d7a3513
Merge pull request #9183 from DougGregor/se-0160-disable-warnings-by-…
DougGregor May 2, 2017
87df594
Merge pull request #9194 from jckarter/keypath-dfe-4.0
jckarter May 2, 2017
fddcd24
Merge pull request #9181 from swiftix/swift-4.0-branch
swiftix May 2, 2017
da3998b
SILCloner: Map opened types using Type::subst instead of transform.
jckarter May 2, 2017
ae84024
[ClangImporter] Don't infer 'Comparable' for swift_wrapper. (#9120) (…
jrose-apple May 3, 2017
32e7a1d
Merge pull request #9098 from KingOfBrian/feature/SE-0169
May 2, 2017
d87b019
Support key paths on 32-bit platforms.
jckarter May 2, 2017
4a04c7b
[Constraint solver] Fix Swift 3 compatibility issue with overloaded o…
rudkx May 2, 2017
1998e2a
Merge pull request #9209 from jckarter/opened-type-subst-4.0
jckarter May 3, 2017
2a1d50c
Merge pull request #9215 from jckarter/keypaths-32-bit-4.0
jckarter May 3, 2017
d8710cc
Merge pull request #9200 from huonw/keypath-syntax
huonw May 3, 2017
5658b25
[swift-4.0 branch] [runtime] Fix assignment of Any with mismatched ty…
May 3, 2017
d32f936
Add Dictionary and Set {En,De}codable conformance
May 3, 2017
c1d0fbe
[Update Checkout] Use new swift-4.0-branch for all projects in update…
shahmishal May 3, 2017
5bd63fe
Merge pull request #9213 from apple/Merge-9098-4-branch
May 3, 2017
bba6282
Revert "Revert "[stdlib] Dictionary/Set enhancements""
natecook1000 May 1, 2017
579f944
Fix dictionary merge bug under optimization
natecook1000 May 1, 2017
f064dca
[stdlib] Fix order for Dictionary.keys/values tests
natecook1000 May 2, 2017
96ee725
[stdlib] Fix test for different hash layouts
natecook1000 May 2, 2017
d165ecc
Fix IRGenSIL to always look through DynamicallyEnforcedAddress.
rjmccall May 3, 2017
3f73534
Merge pull request #9245 from shajrawi/fix_apply_large_result_func_type
May 3, 2017
701fa71
[indexer] Don't index closure params. Resolves rdar://problem/31905371.
May 2, 2017
fe1d598
[migrator] Don't walk into user-specified (and possibly generic) type…
May 2, 2017
d195f00
[ClangImporter] Break infinite recursion when failing to import. (#9253)
jrose-apple May 4, 2017
6ac7c9d
SIL: KeyPathInst has to have side effects, since it retains.
jckarter May 4, 2017
88bbda7
Merge pull request #9247 from DougGregor/nc-devert-dictionary-4.0
DougGregor May 4, 2017
0a610cb
SIL: Serialization for KeyPathInsts.
jckarter May 3, 2017
1ce175b
Merge pull request #9217 from rudkx/fix-source-compat-for-operators-w…
rudkx May 4, 2017
c52dabd
[Exclusivity] Use dynamic enforcement on boxes whose projections escape
devincoughlin May 2, 2017
0a34e60
Fix IRGenSIL to always look through DynamicallyEnforcedAddress.
rjmccall May 3, 2017
d39def3
Merge pull request #9255 from apple/large_type_bugfix_cherrypick
aschwaighofer May 4, 2017
7efc78f
[Sema] -serialize-diagnostics-path should imply -diagnostics-editor-m…
nkcsgexi May 2, 2017
b03ee34
[Migrator] Handle function decl renames. rdar://31766131 (#9157)
nkcsgexi May 2, 2017
be29c9a
[RangeInfo] Avoid analyzing implicit ASTNodes. rdar://31773556 (#9210)
nkcsgexi May 3, 2017
c92e0b9
[test] Add range info test for rdar://31692218
nkcsgexi May 3, 2017
ef0dfd8
[Migrator] During de-serialization, remove duplicated API diff items …
nkcsgexi May 3, 2017
2b57f67
Remove an unnecessary StringRef from a Space Engine diagnostic
CodaFi May 1, 2017
8206830
Improve multi-file decompositions through validation
CodaFi May 2, 2017
6577b2f
Rewrite flattening to be more effective with nested products
CodaFi May 2, 2017
da44830
Sema: Move the fixit for adding missing enum cases to a separate note
nkcsgexi May 4, 2017
f53df82
Merge pull request #9257 from nathawes/indexer-and-migrator-cherry-pi…
May 4, 2017
3126563
[runtime] Fix alignment of HeapObject header on watchOS.
May 3, 2017
1bc7e70
[Migrator] Make performing a fix-it run return the instance used
bitjammer May 3, 2017
6eec52a
[Migrator] Don't pick up missing argument type placeholder fix-its
bitjammer May 1, 2017
acba0ec
[Migrator] Add Substring -> String conversion fix-it tests
bitjammer May 1, 2017
331a0a7
Merge pull request #9270 from devincoughlin/cherry-pick-swift-4.0-branch
swift-ci May 4, 2017
0e12806
Merge pull request #9243 from itaiferber/swift-4.0-branch
swift-ci May 4, 2017
eb2818a
Use CF for Hashing (#9203) (#9256)
airspeedswift May 4, 2017
0883b86
Merge pull request #9264 from jckarter/keypath-inst-effects-4.0
jckarter May 4, 2017
2601169
Merge pull request #9267 from jckarter/serialize-key-path-4.0
jckarter May 4, 2017
32de06b
Referencing encoders should use parent codingPath
May 3, 2017
efe0ff8
Fix container assertion in referencing encoders
May 3, 2017
f43b398
Merge pull request #9223 from aschwaighofer/runtime_cow_existential_f…
aschwaighofer May 4, 2017
2784508
[4.0][stdlib] Speed up Character construction from CharacterView.subs…
milseman May 4, 2017
856c0c7
migrator: correct a misplaced assertion. rdar://31980368
nkcsgexi May 4, 2017
5ff0707
[swift-4.0-branch] IRGen: Use link_once instead of external for priva…
aschwaighofer Apr 27, 2017
c956106
Merge pull request #9277 from bitjammer/github-merge-migrator-swift-4…
bitjammer May 4, 2017
a85a08c
Merge pull request #9282 from airspeedswift/bc-swift-4.0-branch
swift-ci May 4, 2017
c4ab1c0
[migrator] Add an AST pass to handle tuple mismatches
akyrtzi May 4, 2017
df2f87a
[test/migrator] Disable test/Migrator/tuple-arguments.swift on linux
akyrtzi May 4, 2017
b6fdb93
Merge pull request #9285 from aschwaighofer/swift-4.0-branch_fix_link…
aschwaighofer May 4, 2017
c4437e0
Merge pull request #9280 from DougGregor/referencing-encoder-fix-4.0
itaiferber May 4, 2017
921822f
Merge pull request #9249 from rjmccall/look-through-dynamically-enfor…
rjmccall May 4, 2017
c17f16b
[Foundation] NSNumber bridging and Numeric types (SE-0170)
phausler Apr 17, 2017
8abc4a0
Validate the exactly pattern of Double from NSNumber to ensure proper…
phausler Apr 18, 2017
3db1afd
Account for floating point exactly conversions and disable some tests…
phausler Apr 20, 2017
98a6f8f
Rename NSNumber bridge tests to be clear on what they do
phausler May 2, 2017
21fb321
[Foundation] Work-around ambiguity of initializers by avoiding using …
phausler May 3, 2017
bf0eafd
[Foundation] Disable more NSNumber test failures due to incorrect flo…
phausler May 4, 2017
baa2fb3
Merge pull request #9290 from shajrawi/firefox_crash
May 4, 2017
f14af01
Merge pull request #9287 from akyrtzi/migrator-handle-tuple-mismatche…
swift-ci May 4, 2017
b7b4be8
Merge pull request #9295 from apple/large_type_callee_change_cherry_pick
swift-ci May 4, 2017
dbcffd6
[frontend] Don't destroy the compiler instance object inside performC…
akyrtzi May 3, 2017
d7f6a1e
[FrontendTool] Fix a compiler error that I missed due to rebasing the…
akyrtzi May 4, 2017
48ea4ac
[SourceKit] Avoid reporting parent locations for internal only parame…
nkcsgexi May 4, 2017
b98b127
Merge pull request #9300 from shajrawi/large_type_tuple_fix
May 5, 2017
8c3cd2f
[strip -ST] Disable runtime stack trace dumping on Darwin when assert…
gottesmm Apr 27, 2017
d2635ba
Merge pull request #9305 from akyrtzi/dont-destroy-compiler-instance-4.0
swift-ci May 5, 2017
a0dd1cd
Merge pull request #9293 from phausler/swift-4.0-branch_safe_nsnumber
tkremenek May 5, 2017
293405d
Merge pull request #9312 from apple/large_type_tuple_cherry_pick
swift-ci May 5, 2017
ba6b338
[Clang importer] Look through typealiases when importing members of s…
DougGregor May 4, 2017
cd91537
Merge pull request #9316 from DougGregor/swift-wrapper-renamed-4.0
DougGregor May 5, 2017
4dc5c48
Merge pull request #9311 from gottesmm/radar31372220
gottesmm May 5, 2017
3c46f19
[frontend] Fix use-after-free issue found via ASAN
akyrtzi May 5, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ include(AddSwift)
include(SwiftConfigureSDK)
include(SwiftComponents)
include(SwiftList)
include(AddSwiftRuntime)

# Configure swift include, install, build components.
swift_configure_components()
Expand Down Expand Up @@ -785,6 +786,17 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
set(CMAKE_OSX_DEPLOYMENT_TARGET "")
endif()

swift_runtime_enable_backtrace_reporting(SWIFT_RUNTIME_ENABLE_BACKTRACE_REPORTING_default)
set(SWIFT_RUNTIME_ENABLE_BACKTRACE_REPORTING
${SWIFT_RUNTIME_ENABLE_BACKTRACE_REPORTING_default}
CACHE BOOL "Enable simple backtrace printing using dladdr")
set(SWIFT_RUNTIME_DLADDR_ALLOWED
${SWIFT_RUNTIME_ENABLE_BACKTRACE_REPORTING_default}
CACHE BOOL "Is dladdr allowed to be used in the code base. Must be TRUE if SWIFT_RUNTIME_ENABLE_BACKTRACE_REPORTING is set to TRUE")
if ("${SWIFT_RUNTIME_ENABLE_BACKTRACE_REPORTING}" AND NOT "${SWIFT_RUNTIME_DLADDR_ALLOWED}")
message(FATAL "Can not enable backtrace reporting without allowing dladdr to be used by the runtime")
endif()

message(STATUS "Building host Swift tools for ${SWIFT_HOST_VARIANT_SDK} ${SWIFT_HOST_VARIANT_ARCH}")
message(STATUS " Build type: ${CMAKE_BUILD_TYPE}")
message(STATUS " Assertions: ${LLVM_ENABLE_ASSERTIONS}")
Expand All @@ -798,6 +810,8 @@ message(STATUS "")

message(STATUS "Building Swift runtime with:")
message(STATUS " Leak Detection Checker Entrypoints: ${SWIFT_RUNTIME_ENABLE_LEAK_CHECKER}")
message(STATUS " Backtraces: ${SWIFT_RUNTIME_ENABLE_BACKTRACE_REPORTING}")
message(STATUS " DLAddr Allowed: ${SWIFT_RUNTIME_DLADDR_ALLOWED}")
message(STATUS "")

#
Expand Down
52 changes: 52 additions & 0 deletions cmake/modules/AddSwiftRuntime.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#===--- AddSwiftRuntime.cmake --------------------------------------------===#
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https:#swift.org/LICENSE.txt for license information
# See https:#swift.org/CONTRIBUTORS.txt for the list of Swift project authors
#
#===----------------------------------------------------------------------===#

include(SwiftUtils)

function(swift_runtime_enable_backtrace_reporting outvar)
precondition(outvar "Must have an outvar set")

# We do not support backtraces on android...
is_sdk_requested(ANDROID swift_build_android)
if(${swift_build_android})
set(${outvar} FALSE PARENT_SCOPE)
return()
endif()

# ... or cygwin
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
set(${outvar} FALSE PARENT_SCOPE)
return()
endif()

# ... or win32.
if (WIN32)
set(${outvar} FALSE PARENT_SCOPE)
return()
endif()

# If we are not Darwin, but are cygwin, win32, or android we *do* support
# runtime backtraces. This is just preserving the current existing
# behavior. Arguably this should be an opt in feature always.
if (NOT "${CMAKE_SYSTEM_NAME}" STREQUAL Darwin)
set(${outvar} TRUE PARENT_SCOPE)
return()
endif()

# Otherwise, we have a Darwin build. Enable runtime backtrace reporting only
# when compiler assertions are enabled.
if ("${SWIFT_STDLIB_ASSERTIONS}")
set(${outvar} TRUE PARENT_SCOPE)
else()
set(${outvar} FALSE PARENT_SCOPE)
endif()
endfunction()
2 changes: 1 addition & 1 deletion cmake/modules/SwiftSource.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ function(_compile_swift_files
endif()

if (SWIFTFILE_IS_STDLIB_CORE OR SWIFTFILE_IS_SDK_OVERLAY)
list(APPEND swift_flags "-warn-swift3-objc-inference")
list(APPEND swift_flags "-warn-swift3-objc-inference-complete")
endif()

list(APPEND swift_flags ${SWIFT_EXPERIMENTAL_EXTRA_FLAGS})
Expand Down
22 changes: 22 additions & 0 deletions include/swift/ABI/HeapObject.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//===--- HeapObject.h - ABI constants for heap objects -----------*- C++ *-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//
// Constants used in the layout of heap objects.
//
//===----------------------------------------------------------------------===//

#ifndef __SWIFT_ABI_HEAPOBJECT_H__
#define __SWIFT_ABI_HEAPOBJECT_H__

#include "../../../stdlib/public/SwiftShims/HeapObject.h"

#endif // __SWIFT_ABI_HEAPOBJECT_H__
3 changes: 3 additions & 0 deletions include/swift/AST/ASTNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ namespace swift {
FUNC(Expr)
FUNC(Decl)
#undef FUNC

/// Whether the AST node is implicit.
bool isImplicit() const;
};
} // namespace swift

Expand Down
7 changes: 6 additions & 1 deletion include/swift/AST/AccessScope.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ class AccessScope {

static AccessScope getPublic() { return AccessScope(nullptr); }

/// Check if private access is allowed. This is a lexical scope check in Swift
/// 3 mode. In Swift 4 mode, declarations and extensions of the same type will
/// also allow access.
static bool allowsPrivateAccess(const DeclContext *useDC, const DeclContext *sourceDC);

/// Returns nullptr if access scope is public.
const DeclContext *getDeclContext() const { return Value.getPointer(); }

Expand All @@ -48,7 +53,7 @@ class AccessScope {
/// \see DeclContext::isChildContextOf
bool isChildOf(AccessScope AS) const {
if (!isPublic() && !AS.isPublic())
return getDeclContext()->isChildContextOf(AS.getDeclContext());
return allowsPrivateAccess(getDeclContext(), AS.getDeclContext());
if (isPublic() && AS.isPublic())
return false;
return AS.isPublic();
Expand Down
2 changes: 2 additions & 0 deletions include/swift/AST/DiagnosticsParse.def
Original file line number Diff line number Diff line change
Expand Up @@ -1176,6 +1176,8 @@ ERROR(expr_keypath_expected_property_or_type,PointsToFirstBadToken,
"expected property or type name within '#keyPath(...)'", ())
ERROR(expr_keypath_expected_rparen,PointsToFirstBadToken,
"expected ')' to complete '#keyPath' expression", ())
ERROR(expr_keypath_expected_expr,none,
"expected expression path in Swift key path",())

// Selector expressions.
ERROR(expr_selector_expected_lparen,PointsToFirstBadToken,
Expand Down
23 changes: 18 additions & 5 deletions include/swift/AST/DiagnosticsSema.def
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,10 @@ ERROR(expr_unsupported_objc_key_path_compound_name,none,
"compound name", ())
ERROR(expr_keypath_no_keypath_type,none,
"broken standard library: no 'KeyPath' type found", ())
ERROR(expr_swift_keypath_invalid_component,none,
"invalid component of Swift key path", ())
ERROR(expr_swift_keypath_not_starting_with_type,none,
"a Swift key path must begin with a type", ())

// Selector expressions.
ERROR(expr_selector_no_objc_runtime,none,
Expand Down Expand Up @@ -1542,6 +1546,13 @@ WARNING(witness_unavailable,none,

ERROR(redundant_conformance,none,
"redundant conformance of %0 to protocol %1", (Type, DeclName))
WARNING(redundant_conformance_adhoc,none,
"conformance of %0 to protocol %1 was already stated in "
"%select{the protocol's|the type's}2 module %3",
(Type, DeclName, bool, Identifier))
NOTE(redundant_conformance_witness_ignored,none,
"%0 %1 will not be used to satisfy the conformance to %2",
(DescriptiveDeclKind, DeclName, DeclName))

// "Near matches"
WARNING(optional_req_near_match,none,
Expand Down Expand Up @@ -3604,12 +3615,14 @@ WARNING(debug_long_closure_body, none,
ERROR(empty_switch_stmt,none,
"'switch' statement body must have at least one 'case' or 'default' "
"block; do you want to add a default case?",())
ERROR(non_exhaustive_switch,none,
"%select{switch must be exhaustive, consider adding |do you want to add }0"
"%select{missing cases|a default clause}1"
"%select{:|?}0 %2", (bool, bool, StringRef))
ERROR(non_exhaustive_switch,none, "switch must be exhaustive", ())
NOTE(missing_several_cases,none,
"do you want to add "
"%select{missing cases|a default clause}0"
"?", (bool))

NOTE(missing_particular_case,none,
"missing case: '%0'", (StringRef))
"add missing case: '%0'", (StringRef))
WARNING(redundant_particular_case,none,
"case is already handled by previous patterns; consider removing it",())

Expand Down
74 changes: 64 additions & 10 deletions include/swift/AST/Expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -4558,12 +4558,21 @@ class ObjCSelectorExpr : public Expr {
/// #keyPath(Person.friends.firstName)
/// \endcode
class KeyPathExpr : public Expr {
SourceLoc KeywordLoc;
SourceLoc StartLoc;
SourceLoc LParenLoc;
SourceLoc RParenLoc;
TypeRepr *RootType;
SourceLoc EndLoc;
Expr *ObjCStringLiteralExpr = nullptr;

// The parsed root of a Swift keypath (the section before an unusual dot, like
// Foo.Bar in \Foo.Bar.?.baz).
Expr *ParsedRoot = nullptr;
// The parsed path of a Swift keypath (the section after an unusual dot, like
// ?.baz in \Foo.Bar.?.baz).
Expr *ParsedPath = nullptr;

// The processed/resolved type, like Foo.Bar in \Foo.Bar.?.baz.
TypeRepr *RootType = nullptr;

public:
/// A single stored component, which will be one of:
/// - an unresolved DeclName, which has to be type-checked
Expand Down Expand Up @@ -4772,17 +4781,23 @@ class KeyPathExpr : public Expr {
/// Create a new #keyPath expression.
KeyPathExpr(ASTContext &C,
SourceLoc keywordLoc, SourceLoc lParenLoc,
TypeRepr *root,
ArrayRef<Component> components,
SourceLoc rParenLoc,
bool isObjC,
bool isImplicit = false);

SourceLoc getLoc() const { return KeywordLoc; }
SourceRange getSourceRange() const {
return SourceRange(KeywordLoc, RParenLoc);
KeyPathExpr(SourceLoc backslashLoc, Expr *parsedRoot, Expr *parsedPath,
bool isImplicit = false)
: Expr(ExprKind::KeyPath, isImplicit), StartLoc(backslashLoc),
EndLoc(parsedPath ? parsedPath->getEndLoc() : parsedRoot->getEndLoc()),
ParsedRoot(parsedRoot), ParsedPath(parsedPath) {
assert((parsedRoot || parsedPath) &&
"keypath must have either root or path");
KeyPathExprBits.IsObjC = false;
}

SourceLoc getLoc() const { return StartLoc; }
SourceRange getSourceRange() const { return SourceRange(StartLoc, EndLoc); }

/// Get the components array.
ArrayRef<Component> getComponents() const {
return Components;
Expand All @@ -4807,11 +4822,34 @@ class KeyPathExpr : public Expr {
void setObjCStringLiteralExpr(Expr *expr) {
ObjCStringLiteralExpr = expr;
}


Expr *getParsedRoot() const {
assert(!isObjC() && "cannot get parsed root of ObjC keypath");
return ParsedRoot;
}
void setParsedRoot(Expr *root) {
assert(!isObjC() && "cannot get parsed root of ObjC keypath");
ParsedRoot = root;
}

Expr *getParsedPath() const {
assert(!isObjC() && "cannot get parsed path of ObjC keypath");
return ParsedPath;
}
void setParsedPath(Expr *path) {
assert(!isObjC() && "cannot set parsed path of ObjC keypath");
ParsedPath = path;
}

TypeRepr *getRootType() const {
assert(!isObjC() && "cannot get root type of ObjC keypath");
return RootType;
}

void setRootType(TypeRepr *rootType) {
assert(!isObjC() && "cannot set root type of ObjC keypath");
RootType = rootType;
}

/// True if this is an ObjC key path expression.
bool isObjC() const { return KeyPathExprBits.IsObjC; }

Expand All @@ -4820,6 +4858,22 @@ class KeyPathExpr : public Expr {
}
};

/// Represents the unusual behaviour of a . in a \ keypath expression, such as
/// \.[0] and \Foo.?.
class KeyPathDotExpr : public Expr {
SourceLoc DotLoc;

public:
KeyPathDotExpr(SourceLoc dotLoc)
: Expr(ExprKind::KeyPathDot, /*isImplicit=*/true), DotLoc(dotLoc) {}

SourceLoc getLoc() const { return DotLoc; }
SourceRange getSourceRange() const { return SourceRange(DotLoc, DotLoc); }

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

inline bool Expr::isInfixOperator() const {
return isa<BinaryExpr>(this) || isa<IfExpr>(this) ||
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 @@ -168,6 +168,7 @@ UNCHECKED_EXPR(UnresolvedPattern, Expr)
EXPR(EditorPlaceholder, Expr)
EXPR(ObjCSelector, Expr)
EXPR(KeyPath, Expr)
UNCHECKED_EXPR(KeyPathDot, Expr)

#undef EXPR_RANGE
#undef LITERAL_EXPR
Expand Down
9 changes: 9 additions & 0 deletions include/swift/AST/Type.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ struct QueryTypeSubstitutionMap {
Type operator()(SubstitutableType *type) const;
};

/// A function object suitable for use as a \c TypeSubstitutionFn that
/// queries an underlying \c TypeSubstitutionMap, or returns the original type
/// if no match was found.
struct QueryTypeSubstitutionMapOrIdentity {
const TypeSubstitutionMap &substitutions;

Type operator()(SubstitutableType *type) const;
};

/// A function object suitable for use as a \c TypeSubstitutionFn that
/// queries an underlying \c SubstitutionMap.
struct QuerySubstitutionMap {
Expand Down
16 changes: 15 additions & 1 deletion include/swift/Basic/LangOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,19 @@ namespace swift {
};
enum { NumPlatformConditionKind = 4 };

/// Describes which Swift 3 Objective-C inference warnings should be
/// emitted.
enum class Swift3ObjCInferenceWarnings {
/// No warnings; this is the default.
None,
/// "Minimal" warnings driven by uses of declarations that make use of
/// the Objective-C entry point directly.
Minimal,
/// "Complete" warnings that add "@objc" for every entry point that
/// Swift 3 would have inferred as "@objc" but Swift 4 will not.
Complete,
};

/// \brief A collection of options that affect the language dialect and
/// provide compiler debugging facilities.
class LangOptions {
Expand Down Expand Up @@ -212,7 +225,8 @@ namespace swift {

/// Warn about cases where Swift 3 would infer @objc but later versions
/// of Swift do not.
bool WarnSwift3ObjCInference = false;
Swift3ObjCInferenceWarnings WarnSwift3ObjCInference =
Swift3ObjCInferenceWarnings::None;

/// Enable keypaths.
bool EnableExperimentalKeyPaths = false;
Expand Down
4 changes: 4 additions & 0 deletions include/swift/Frontend/Frontend.h
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,10 @@ class CompilerInstance {
/// Parses the input file but does no type-checking or module imports.
/// Note that this only supports parsing an invocation with a single file.
void performParseOnly();

/// Frees up the ASTContext and SILModule objects that this instance is
/// holding on.
void freeContextAndSIL();
};

} // namespace swift
Expand Down
1 change: 1 addition & 0 deletions include/swift/IDE/APIDigesterData.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ struct APIDiffItem {
virtual APIDiffItemKind getKind() const = 0;
virtual StringRef getKey() const = 0;
virtual ~APIDiffItem() = default;
bool operator==(const APIDiffItem &Other) const;
};

// CommonDiffItem describes how an element in SDK evolves in a way that migrator can
Expand Down
1 change: 1 addition & 0 deletions include/swift/Migrator/EditorAdapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ class EditorAdapter {
bool remove(SourceLoc TokenLoc);
bool remove(SourceRange TokenRange);
bool replace(SourceRange TokenRange, StringRef Text);
bool replaceToken(SourceLoc TokenLoc, StringRef Text);
bool replaceWithInner(SourceRange TokenRange, SourceRange TokenInnerRange);

/// Return the batched edits encountered so far.
Expand Down
Loading