Commit Graph

412 Commits

Author SHA1 Message Date
Anthony Latsis
9fd1aa5d59 [NFC] Pre- increment and decrement where possible 2020-06-01 15:39:29 +03:00
Hamish Knight
bccdc0e062 NFC: Rename performSILGeneration -> performASTLowering
And also rename the underlying request and
descriptor.

This rename is motivated by the fact that the
operation may instead perform parsing of SIL files
and/or deserialization of SIB files.
2020-05-27 09:36:11 -07:00
Hamish Knight
49fed42d03 NFC: Remove SILParserState from Subsystems
Since SIL parsing has been requestified, this is
now redundant. Remove the type from Subsystems.h,
and rename SILParserTUState to take its place.
2020-05-21 14:39:57 -07:00
Erik Eckstein
f5a8f600ea SIL: new instructions for copy-on-write support
* a new [immutable] attribute on ref_element_addr and ref_tail_addr
* new instructions: begin_cow_mutation and end_cow_mutation

These new instructions are intended to be used for the stdlib's COW containers, e.g. Array.
They allow more aggressive optimizations, especially for Array.
2020-05-14 08:39:54 +02:00
Hamish Knight
574dd2bbf9 Use correct associated context for SIL parsing
Adjust `SILModule::createEmptyModule` to accept a
FileUnit or ModuleDecl, and pass the corresponding
context for SIL generation and parsing. This
change means that SIL parsing will now correctly
use a SourceFile associated context when in
single-file mode.
2020-05-10 20:36:07 -07:00
Hamish Knight
27ed8b0b43 [SIL] Infer isWholeModule() from associated context
Rather than maintain a separate bit, check if the
associated decl context is for the ModuleDecl.
2020-05-10 19:56:12 -07:00
Slava Pestov
ce98971c42 Merge pull request #31642 from slavapestov/sil-parser-astscope
SIL: Use ASTScope for SIL parsing
2020-05-08 09:53:49 -04:00
Slava Pestov
3ee2409890 SIL: Use ASTScope for SIL parsing 2020-05-08 00:31:23 -04:00
Hamish Knight
d92374c2fc [ParseSIL] Return empty SILModule on error
Because we were previously performing SIL parsing
during `performSema`, we were relying on the
pipeline being stopped before reaching the SIL
pipeline passes.

However under a lazy evaluation model, we can't
rely on that. Instead, just return an empty
SILModule if we encounter a parsing error.
2020-05-06 20:11:48 -07:00
Hamish Knight
fcb1dcaa4c Requestify SIL parsing
Replace `parseSourceFileSIL` with
ParseSILModuleRequest, and add some convenience
members to SILGenDescriptor to retrieve the
SourceFile to be parsed.
2020-05-06 20:11:48 -07:00
Arnold Schwaighofer
147144baa6 SIL: Thread type expansion context through to function convention apis
This became necessary after recent function type changes that keep
substituted generic function types abstract even after substitution to
correctly handle automatic opaque result type substitution.

Instead of performing the opaque result type substitution as part of
substituting the generic args the underlying type will now be reified as
part of looking at the parameter/return types which happens as part of
the function convention apis.

rdar://62560867
2020-05-04 13:53:30 -07:00
zoecarver
6f339f800d [SIL] [Parser] Move ParserSIL into SIL library.
Move the source files from ParserSIL into the SIL library and remove the
ParserSIL library. ParsersSIL doesn't need to be its own library and this change will
simplify our builds.
2020-04-13 17:23:08 -07:00