Commit Graph

9699 Commits

Author SHA1 Message Date
David Zarzycki
220eea07f4 [AST] NFC: Shrink Metatype DenseMap size 2019-03-15 07:39:22 -04:00
Xi Ge
ffd159a1c9 Merge pull request #23310 from nkcsgexi/interface-avoid-underscore
IDE/sourcekitd: avoid printing underscored keywords in module interface view.
2019-03-14 19:31:57 -07:00
Slava Pestov
1159af50d9 Rename -enable-resilience to -enable-library-evolution and make it a driver flag
Fixes <rdar://problem/47679085>.
2019-03-14 22:24:26 -04:00
Xi Ge
b8c4400267 IDE/sourcekitd: avoid printing underscored keywords in module interface view. 2019-03-14 15:33:31 -07:00
Michael Gottesman
1e0414df77 Merge pull request #23284 from gottesmm/pr-0b4de614fe103f8e5a161be5219ba2cb7148aa25
[ast]/[silgen] If a case stmt is a fallthrough source, tail allocate a pointer in the case stmt to the fallthrough case.
2019-03-14 14:03:47 -07:00
Michael Gottesman
7b27b4b502 [silgenpattern] Change SILGenPattern to use CaseStmt::hasFallthroughDest() instead of computing this itself.
rdar://47467128
2019-03-14 11:25:41 -07:00
Xi Ge
031f173ff7 Merge pull request #23279 from nkcsgexi/quick-help-skip-under
ASTPrinter: skip underscored keyword when printing for quick helps.
2019-03-13 21:28:12 -07:00
Michael Gottesman
78aefb91f0 [ast] If a CaseStmt has a fallthrough in its body, stash it into a tail allocated pointer field.
rdar://47467128
2019-03-13 18:12:49 -07:00
Xi Ge
1625bcfbba ASTPrinter: skip underscored keyword when printing for quick helps.
rdar://47777848
2019-03-13 17:53:51 -07:00
Azoy
6f7d20b99e Synthesize default values for memberwise init
Introduce stored property default argument kind

Fix indent

Assign nil to optionals with no initializers

Don't emit generator for stored property default arg

Fix problem with rebase

Indentation

Serialize stored property default arg text

Fix some tests

Add missing constructor in test

Print stored property's initializer expression

cleanups

preserve switch

complete_constructor

formatting

fix conflict
2019-03-13 18:57:36 -05:00
Mike Ash
597dcd8f3f [Stdlib][Frontend][CMake] Remove SWIFT_DARWIN_ENABLE_STABLE_ABI_BIT option, make it permanently on. 2019-03-13 09:31:50 -04:00
Brent Royal-Gordon
21b96d4840 Merge pull request #23175 from brentdax/theres-a-path-for-everyone
Look for runtime library modules in the SDK, too
2019-03-12 22:27:01 -07:00
Saleem Abdulrasool
d36af3b3b0 Merge pull request #22725 from compnerd/windows-conforms
IRGen: make Windows use resilient conformances
2019-03-12 20:22:46 -07:00
Pavel Yaskevich
9802875ce1 Merge pull request #23187 from theblixguy/fix/SR-10062
[Typechecker] Disallow default argument to inout parameter
2019-03-12 12:11:00 -07:00
Slava Pestov
123fee960e Merge pull request #23228 from slavapestov/type-lowering-is-trivial
Replace SILType::isTrivial(SILModule) with isTrivial(SILFunction)
2019-03-12 13:44:10 -04:00
Slava Pestov
8915f96e3e SIL: Replace SILType::isTrivial(SILModule) with isTrivial(SILFunction) 2019-03-12 01:16:04 -04:00
Suyash Srijan
e21430a6af [typechecker] disallow default argument to inout parameter 2019-03-12 02:57:28 +00:00
Brent Royal-Gordon
46ddb2a607 [NFC] Support many runtime library import paths
Replaces SearchPathOptions::RuntimeLibraryImportPath with an equivalent std::vector of paths. Also reimplements SearchPathOptions::SkipRuntimeLibraryImportPaths to cause the list of runtime library import paths to be empty, rather than exiting early from SerializedModuleLoader::findModule().
2019-03-11 19:06:51 -07:00
Ravi Kandhadai
249b11a018 [SIL Diagnostics] Improve diagnostics for yield-once coroutines
when the coroutines yield in some paths but not in all paths.

<rdar://48184430>
2019-03-11 18:15:35 -07:00
Saleem Abdulrasool
8357457764 IRGen: avoid constant conformances on Windows
Windows does not permit cross-module data accesses to be direct.  This
is a problem for public protocols with root conformances which are
external.  Use a runtime initialiser for the root protocol conformance
chaining to alleviate this issue.  This shows up in the Foundation
build.
2019-03-11 14:12:55 -07:00
Nate Cook
968783f66c Revise error for incorrect subscript parameters. (#22713)
* Revise error for incorrect subscript parameters.

We use subscripts for more than just indexes in Swift these days, so
the error message needs to be a bit more general.

* Use the term 'argument' instead of 'value'
2019-03-07 18:10:01 -06:00
Slava Pestov
2e2c12f9cb Merge pull request #22822 from theblixguy/fix/SR-6022
[Typechecker] Warn when casting a function type to an existential or archetype type
2019-03-06 22:16:39 -05:00
David Zarzycki
b6517c50a1 Merge pull request #23014 from davezarzycki/faster_simpler_nominaltype_get
[AST] NFC: Improve non-generic nominal type memory efficiency
2019-03-06 15:35:19 -05:00
David Zarzycki
236a0dcfe2 Revert "[GSB] NFC: Precompute or cache DependentMemberType when possible"
This reverts commit 8876c9e78f, which has
a memory leak.
2019-03-06 10:01:37 -05:00
Suyash Srijan
a2460b8892 Merge branch 'master' into fix/SR-6022 2019-03-05 20:57:31 +00:00
Nate Cook
5bd2b3e639 Use the term 'argument' instead of 'value' 2019-03-05 08:31:42 -06:00
Arnold Schwaighofer
1719f0cdf1 Serialization: Also serialize the filename for internal storage decls with private accessors
If a value decl is internal hasTestableOrPrivateImport will succeed (or
fail) without looking at the filename. However this breaks when we query
an internal storage decl with private formal access for a private
setter: the query would fail because no filename was serialized for the
decl (we only serialize filenames for private decls). So in the special
case of a internal storage with private accessor also serialize the
filename.

rdar://48516545
2019-03-04 13:12:39 -08:00
David Zarzycki
8876c9e78f [GSB] NFC: Precompute or cache DependentMemberType when possible
Calling DependentMemberType::get() repeatedly pollutes the processor
caches because the global hash table can be quite large. With this
change, we either precompute DependentMemberTypes or cache them on
demand. This change makes the release/no-assert build of
Swift.swiftmodule 4.1% faster.
2019-03-02 10:14:49 -05:00
Parker Schuh
5160da6a2e FloatLiteralExpr now is lowered directly into SIL.
For context, String, Nil, Bool, and Int already behave this way.

Note: Swift can compile against 80 or 64 bit floats as the builtin
literal type. Thus, it was necessary to capture this bit somehow in the
FloatLiteralExpr. This was done as another Type field capturing this
info.
2019-03-01 09:01:30 -08:00
David Zarzycki
099743894b [AST] NFC: Improve non-generic nominal type memory efficiency
The non-generic nominal type nodes do not actually need to use LLVM's
FoldingSetNode, and on my workstation the release build of the standard
library completes about 1/3 of a second faster after switching to LLVM
DenseMap. This is perhaps not surprising, because Decl to Type mappings
are only needed during early compiler stages, but the intrusive
FoldingSetNode data decreases CPU cache efficiency during all compiler
stages. As a bonus, the resulting code is simpler.
2019-03-01 09:44:40 -05:00
David Ungar
2ce6867c7b Merge pull request #22578 from davidungar/A-2-12
[NameLookup ] UnqualifiedLookup refactoring
2019-02-28 17:30:37 -08:00
Brent Royal-Gordon
f1d1df3b30 Merge pull request #22842 from brentdax/target-practice
Name platform-specific module files using a normalized target triple
2019-02-28 16:07:37 -08:00
Brent Royal-Gordon
3f58a79174 Import error now mentions the target, not the arch 2019-02-27 11:43:12 -08:00
Pavel Yaskevich
e9817b027f Merge pull request #22926 from xedin/diag-missing-clj-params
[Diagnostics] Diagnose missing arguments in closures via fixes
2019-02-27 00:29:40 -08:00
Rintaro Ishizaki
6872f6c0cb Merge pull request #19742 from AnthonyLatsis/class-var-override-compl
[CodeCompletion][Parser] Completions for overridable static members
2019-02-26 09:52:37 -08:00
swift-ci
aea757a6e9 Merge pull request #22910 from DougGregor/objc-renamed-protocol-metadata 2019-02-25 23:41:50 -08:00
Doug Gregor
b5f45f8f72 [IRGen] Mangle Swift @objc(renamed) protocols as Objective-C in metadata.
When emitting metadata for a Swift-defined @objc protocol that has
provided a specific Objective-C name (e.g., via @objc(renamed)),
mangle such protocols using their Objective-C names so they can be
found at runtime.

Only do this for metadata, because doing it anywhere else would cause
an ABI break. Fixes rdar://problem/47877748.
2019-02-25 17:31:08 -08:00
Pavel Yaskevich
0b12c664b0 [ConstraintSystem] Fix missing arguments
While trying to match function types, detect and fix any missing
arguments (by introducing type variables), such arguments would
get type information from corresponding parameters and aid in
producing solutions which are much easier to diagnose.
2019-02-25 17:07:26 -08:00
Rintaro Ishizaki
3c970418c3 [Gardening][AST] Eliminate 'numParameterLists'. (#22824)
Leftover from bfc4121971
2019-02-25 13:33:26 -08:00
Joe Groff
bb67cf815c Merge pull request #21355 from technicated/tuple-keypaths-2
Tuple KeyPaths
2019-02-25 12:56:05 -08:00
Slava Pestov
84fbd0271a Merge pull request #22825 from slavapestov/remove-old-type-reconstruction
Remove TypeReconstruction.cpp
2019-02-23 01:26:54 -05:00
Suyash Srijan
f2804fcd15 [typechecker] add warning for unrelated downcast from function type to protocol type/archetype type 2019-02-22 22:01:36 +00:00
Slava Pestov
4e55714376 ASTDemangler: Introduce new getTypeDeclForUSR() 2019-02-22 16:13:02 -05:00
Slava Pestov
d0d5fbdf39 ASTDemangler: Introduce new getTypeDeclForMangling()
This will replace getDeclFromMangledSymbolName().

Progress on <rdar://problem/47819208>.
2019-02-22 16:13:02 -05:00
David Ungar
6982e66ddf Refactor filterForDiscriminator and call of addLocalVariableResults. 2019-02-22 12:41:03 -07:00
Arnold Schwaighofer
8d9b9f328b SILGen: Fix the logic of dynamic replacements for class constructors
To correctly call designated super class initializers the designated
intializer (and not the allocator) is dynamically replaceable.
Convenience allocators are dynamically replaceable as before.
2019-02-22 10:15:06 -08:00
Arnold Schwaighofer
f820c6eb23 Merge pull request #22784 from aschwaighofer/diagnostic_objc_mismatch_dynamic_replacement
Diagnostic: dynamic replacement and replaced function's @objc attribu…
2019-02-22 09:24:08 -08:00
Nate Cook
faa3d1d75a Merge branch 'master' into nc_subscript_message 2019-02-22 10:57:42 -06:00
Xi Ge
29dd7f81fa Merge pull request #22791 from nkcsgexi/serialization-group-diag
doc-serialization: diagnose missing group-info file or corrupted one.
2019-02-21 20:20:20 -08:00
Xi Ge
ecd1e84526 doc-serialization: diagnose missing group-info file or corrupted one.
rdar://45903094
2019-02-21 15:28:35 -08:00