Commit Graph

20516 Commits

Author SHA1 Message Date
swift-ci
99754ad551 Merge pull request #22230 from gottesmm/pr-7a6d9d7233d756d1fca02f07e2aa68485e2662f5 2019-01-29 18:11:17 -08:00
Michael Gottesman
d012762d26 [sil] Ban passing non-trivial values to copy_value, destroy_value.
I also fixed a small violation in SILGenProlog/added a test for it.
2019-01-29 16:54:37 -08:00
Slava Pestov
13a50c2d2d ASTDemangler: Add support for lowered metatypes 2019-01-29 19:15:17 -05:00
Slava Pestov
fce933910d ASTDemangler: Implement types in generic local context
If we nest a type inside a local context inside a generic type,
we have to look through the local context(s) to find the outer
generic type when stripping off generic arguments.

We don't support nominal types inside generic local context
right now, but this can happen with type aliases.
2019-01-29 19:15:17 -05:00
Harlan Haskins
0a9b8fa37c Merge pull request #22191 from harlanhaskins/fatality
[Diagnostics] Mark invalid ‘@testable import’ as fatal
2019-01-29 15:57:30 -08:00
Harlan Haskins
f4b0e0e7b6 [Diagnostics] Mark invalid ‘@testable import’ as fatal
If this isn’t fatal, this will just end up cascading to a bunch of “could not find member … in …” errors, which hides the real issue.
2019-01-29 14:52:40 -08:00
swift-ci
37183a7ed2 Merge pull request #22217 from gottesmm/pr-7be9ef604e047a30dc019f2cda380b17d6b638f6 2019-01-29 14:31:35 -08:00
Michael Gottesman
c2e8b9e195 [sil] Teach the SILCloner how to clone from ossa -> non-ossa.
At a high level, we perform the OME lowering as we transform.
2019-01-29 13:19:03 -08:00
Harlan Haskins
9c8ed0ba93 [ParseableInterfaces] Print @_show_in_interface
This attribute needs to be preserved in the .swiftmodule, otherwise these declarations will stop showing up in the interface. Print it in the parseable interface.
2019-01-29 11:50:58 -08:00
Jordan Rose
de93ba0992 Merge pull request #22188 from jrose-apple/open-your-heart
Don't fix access of an 'open' override in a 'public' extension

rdar://problem/47557376&28493971
2019-01-29 10:45:48 -08:00
Slava Pestov
ad4cb5fb38 Mangler: Correctly record substitutions when dropping protocols from associated types 2019-01-29 02:15:56 -05:00
Slava Pestov
535f5bdedf Remangler: Fix for correct round-tripping 2019-01-29 02:15:56 -05:00
Saleem Abdulrasool
9bd31f9d04 Remote: fully qualify NodePointer for Win32
This adjusts the uses of `NodePointer` to an elaborated type to resolve
ambiguity when building for Windows.
2019-01-28 19:55:27 -08:00
Jordan Rose
1f06cd7e6d Tweak diagnostic for a high-access member in a low-access extension
Before: declaring a public instance method in a private extension
After: 'public' modifier conflicts with extension's default access of
       'private'
2019-01-28 18:24:12 -08:00
David Ungar
1fa76b97da Rm debugging code 2019-01-28 15:59:55 -08:00
David Ungar
14ba2a1b60 Format 2019-01-28 15:56:18 -08:00
David Ungar
fc4b7963ee 1st rough cut, frontend tracks defs not uses 2019-01-28 15:32:47 -08:00
Michael Gottesman
a8dfac4788 [ownership] Use the new LinearLifetimeError to propagate back to callers why the checker failed. 2019-01-28 15:23:15 -08:00
swift-ci
86de35ba30 Merge pull request #22180 from gottesmm/pr-80686c0faa81a91a0e6027f58f6598ca7c3fa885 2019-01-28 13:50:44 -08:00
David Ungar
2514383fc8 1st untested unfmt cut at more specific usesByDef including integration redo 2019-01-28 13:08:37 -08:00
swift-ci
d83705b3e1 Merge pull request #22161 from gottesmm/pr-3e0ca67a6062567588ea7d5d8d94f564f4266ab3 2019-01-28 12:54:49 -08:00
Michael Gottesman
224c8a5801 [ownership] Use a richer error result than bool.
I am starting to use the linear lifetime checker in an optimizer role where it
no longer asserts but instead tells the optimizer pass what is needed to cause
the lifetime to be linear. To do so I need to be able to return richer
information to the caller such as whether or not a leak, double consume, or
use-after-free occurs.
2019-01-28 12:47:40 -08:00
Slava Pestov
69f2aba2ff Merge pull request #22158 from pschuh/s-2
NilLiteralExpr now is lowered directly into SIL.
2019-01-28 15:40:10 -05:00
David Ungar
ba768175f1 checkpoint usesByDef 2019-01-28 11:10:04 -08:00
Saleem Abdulrasool
b422fdcaf7 Merge pull request #22155 from compnerd/NodePointer
Remote: use the qualified name for `NodePointer`
2019-01-28 10:56:56 -08:00
David Ungar
8275de7cd7 Clean up with out fix yet, unfmt. 2019-01-28 10:19:06 -08:00
Parker Schuh
6ca70c6720 NilLiteralExpr now is lowered directly into SIL.
Instead of constructing calls to
ExpressibleByNilLiteral.init(nilLiteral: ()) in CSApply.cpp, just
annotate NilLiteralExpr with the selected construtor and do the actual
construction during SILGen.

For context, StringLiteralExpr already behaves this way.
2019-01-28 10:00:52 -08:00
David Ungar
afe428a5bf untested, unformatted tracing cleanup 2019-01-28 09:40:29 -08:00
swift-ci
8458f10a40 Merge pull request #22150 from DougGregor/remote-ast-extensions 2019-01-28 09:05:45 -08:00
Karoy Lorentey
587a9a824c Merge pull request #22081 from lorentey/hashvalue-fixit
[Sema] Add dedicated fix-it for NSObject.hashValue overrides
2019-01-28 07:50:20 -08:00
Doug Gregor
21e5a7e8a2 [Metadata reader] Save/restore symbolic reference resolver
… rather than clearing it out completely. This is better hygiene, although it
doesn’t matter right now.
2019-01-27 21:58:09 -08:00
David Ungar
bb4239b49a rm most dbg code 2019-01-27 19:15:50 -08:00
David Ungar
ae46aa918a Various fixes + debug unfmt 2019-01-27 19:12:59 -08:00
Michael Gottesman
cc68e6a0d5 Remove some remaining dead code from the +0 argument convention bring up.
I already removed the option from SILOptions, so all of this stuff is dead.
2019-01-27 13:18:06 -08:00
David Ungar
89f77175d0 Format 2019-01-27 09:15:25 -08:00
Doug Gregor
23886ba579 [Metadata reader] Form demangle trees for generic extension contexts.
Translate the metadata for the generic requirements of an extension context
into a demangle tree that is associated with the demangling of an extension.

Teach the ASTDemangler how to handle class layout constraints as well.

With this, RemoteAST can resolve types nested within most constrained
extensions.
2019-01-26 23:25:51 -08:00
Doug Gregor
ff687967cc [Metadata reader] Handle symbolic references in mangled names.
When reading a mangled name, make sure to cope with embedded null bytes that
show up in symbolic references. When demangling such a name, handle symbolic
references.
2019-01-26 23:23:37 -08:00
Doug Gregor
850a2a753d [Metadata reader] Factor out reading metadata for a protocol reference.
Protocol references are interesting because we have to deal with the
low bit indicating whether we have a reference to an Objective-C protocol.
Factor out this logic for later re-use.
2019-01-26 23:08:38 -08:00
David Ungar
3d8779efba Fix print bugs unfmt 2019-01-26 21:47:52 -08:00
David Ungar
1c3e2fc872 Format 2019-01-26 18:52:28 -08:00
David Ungar
e912642304 1st cut dependency tracing 2019-01-26 18:50:41 -08:00
Saleem Abdulrasool
e8c6e842ce Remote: use the qualified name for NodePointer
Use the qualified name for the `NodePointer`.  The unqualified name
causes ambiguity when building on Windows.  This repairs the Windows
build.
2019-01-26 11:30:00 -08:00
David Ungar
93db5f44ef wip 2019-01-26 09:46:12 -08:00
David Ungar
9d84bc2af1 WIP tracer 2019-01-26 09:36:40 -08:00
Doug Gregor
cc360908cc [Remote AST] Resolve extension context descriptors to demangle trees.
Read the extended context mangled name from an extension context descriptor
so we can form a proper demangle tree for extensions. For example, this allows
types nested within extensions of types from different modules to be found.
2019-01-25 21:18:43 -08:00
Doug Gregor
9e7826b29f [Remote AST] Resolve local types using anonymous context descriptor mangling.
When the mangled name is available within an anonymous context descriptor
for a local type, use that mangled name to help RemoteAST resolve lookups
based on local type metadata.
2019-01-25 20:17:50 -08:00
Doug Gregor
9bf404380f [AST] Hack SourceFile::lookupLocalType() to look through local types.
This is only currently exercised by swift-remoteast-test, so do the
minimum to ensure that we’re getting cached mangled names, but don’t
fret over the linear-time search.
2019-01-25 20:16:31 -08:00
Slava Pestov
b6951932b4 ASTDemangler: Implement type alias types
Debug info uses a special mangling where type aliases can be
represented without being desugared; attempt to reconstruct
the TypeAliasType in this case.
2019-01-25 21:59:48 -05:00
Slava Pestov
0f5233dad1 ASTDemangler: Implement extension lookup 2019-01-25 21:44:02 -05:00
Slava Pestov
55605ceab9 ASTDemangler: Implement DynamicSelfType 2019-01-25 21:44:02 -05:00