Commit Graph

1828 Commits

Author SHA1 Message Date
swift-ci
a9e39bdb21 Merge remote-tracking branch 'origin/master' into master-rebranch 2019-09-13 21:03:33 -07:00
Harlan Haskins
8aa5caed71 Merge pull request #27175 from harlanhaskins/mods-are-asleep-post-cleanups
NFC: Excise ParseableInterface from code
2019-09-13 20:47:53 -07:00
swift-ci
92ded9a364 Merge remote-tracking branch 'origin/master' into master-rebranch 2019-09-13 16:24:29 -07:00
Harlan Haskins
c82c9b8210 [ModuleInterfaces] Remove references to 'parseable' interfaces everywhere
Now that we've settled on Module Interface as the name, let's remove the
vestiges of "Parseable Interfaces"
2019-09-13 14:55:48 -07:00
Brent Royal-Gordon
8734092923 Merge branch 'master' into master-rebranch
# Conflicts:
#	lib/IRGen/GenExistential.cpp
2019-09-11 20:12:03 -07:00
Rintaro Ishizaki
b9985dbe87 [SyntaxParse] Fix memory leak for explicit syntax actions
Add SyntaxParseActions::discardRecordedNode() as a workaround for memory
leak during syntax parsing migration.
2019-09-11 16:33:49 -07:00
Rintaro Ishizaki
80085e0d27 [SyntaxParse] Make ParsedRawSyntaxNode move-only
So that we can easily detect 'ParsedSyntaxNode' leaking. When it's
moved, the original node become "null" node. In the destructor of
'ParsedSyntaxNode', assert the node is not "recorded" node.
2019-09-11 16:33:49 -07:00
Rintaro Ishizaki
a7d6612813 Merge pull request #27046 from rintaro/syntaxparse-refactor-type
[SyntaxParse] Refactor parsing facilities
2019-09-11 06:43:42 +02:00
swift-ci
9dd52e8b1b Merge remote-tracking branch 'origin/master' into master-rebranch 2019-09-10 12:23:47 -07:00
Rintaro Ishizaki
94c7d04567 Merge pull request #27090 from rintaro/syntax-backtick-rdar54810608
[Syntax] Abolish 'backtick' trivia
2019-09-10 21:15:31 +02:00
Rintaro Ishizaki
8733bc59a2 [SyntaxParse] Remove unused SyntaxParserResult type 2019-09-10 10:29:02 -07:00
Rintaro Ishizaki
019a13ab70 [SyntaxParse] Remove ASTGen::advanceLocEnd() function 2019-09-10 10:29:02 -07:00
Rintaro Ishizaki
c13f68881a [SyntaxParse] Simplify syntax parsing result facilities
- Utilize ignoreToken() to skip tokens while keeping them in syntax tree
- SyntaxParsedResult now holds ParsedRawSyntaxNode and ParserStatus
- Simplify migration support for 'TypeName[]' type
- Use builder for generic argument clause parsing
2019-09-10 10:29:02 -07:00
Rintaro Ishizaki
a9af910664 [SyntaxParse] Add ignoreToken() function to ignore tokens 2019-09-10 10:29:02 -07:00
Rintaro Ishizaki
8edea315cd [Syntax] Abolish 'backtick' trivia
- Stop producing 'backtick' trivia for escaping identifier token. '`'s
  are now parts of the token text
- Adjust and simplify C++ libSyntax APIs
- Add 'is_deprecated' property to Trivia.py to attribute SwiftSyntax
  APIs

rdar://problem/54810608
2019-09-09 11:49:25 -07:00
swift-ci
927fc3f39e Merge remote-tracking branch 'origin/master' into master-rebranch 2019-09-06 20:03:38 -07:00
Robert Widmann
23969e9555 Clean up the way Parse deals with GenericParamList
- The parser no longer mutates these in place
- Pass generic param lists off to constructors that will readily take them
2019-09-06 17:20:28 -07:00
swift-ci
0b7772d32b Merge remote-tracking branch 'origin/master' into master-rebranch 2019-09-05 15:03:10 -07:00
Rintaro Ishizaki
dba6514092 [SyntaxParse] Set token kind as 'identifier' in consumeIdentifierSyntax
rdar://problem/55075237
2019-09-05 11:51:51 -07:00
swift-ci
0e4feadfbc Merge remote-tracking branch 'origin/master' into master-rebranch 2019-09-03 10:23:48 -07:00
Doug Gregor
d7f6768a9d Eliminate DelayedParsingCallbacks.
DelayedParsingCallbacks only had one implementation, for code
completion, which is only used to determine which bodies to skip and
which to delay. Inline that logic into the parser's delay logic and
remove DelayedParsingCallbacks entirely.
2019-09-02 19:03:07 -07:00
swift-ci
0591c81677 Merge remote-tracking branch 'origin/master' into master-rebranch 2019-08-31 19:24:16 -07:00
Doug Gregor
d8b745db77 Add a request to lazily parse function bodies.
Rework the lazy function body parsing mechanism to use the
request-evaluator, so that asking for the body of a function will
initiate parsing. Clean up a number of callers to
AbstractFunctionDecl::getBody() that don't actually need the body, so
we don't perform unnecessary parsing.

This change does not delay parsing of function bodies in the general
case; rather, it sets up the infrastructure to always delay parsing of
function bodies.
2019-08-31 16:23:08 -07:00
swift-ci
a9cb82e5e5 Merge remote-tracking branch 'origin/master' into master-rebranch 2019-08-31 03:44:11 -07:00
eeckstein
903eeb220b Revert "Add a request to lazily parse function bodies." 2019-08-31 12:29:01 +02:00
swift-ci
0449301870 Merge remote-tracking branch 'origin/master' into master-rebranch 2019-08-30 22:04:20 -07:00
Doug Gregor
2ab05a6835 Add a request to lazily parse function bodies.
Rework the lazy function body parsing mechanism to use the
request-evaluator, so that asking for the body of a function will
initiate parsing. Clean up a number of callers to
AbstractFunctionDecl::getBody() that don't actually need the body, so
we don't perform unnecessary parsing.

This change does not delay parsing of function bodies in the general
case; rather, it sets up the infrastructure to always delay parsing of
function bodies.
2019-08-30 16:48:23 -07:00
swift-ci
8f203f3930 Merge remote-tracking branch 'origin/master' into master-rebranch 2019-08-30 14:44:12 -07:00
Doug Gregor
0989943960 Add PersistentParserState constructor back for LLDB.
This is to avoid having to sychronize PRs across LLDB and Swift.
2019-08-30 09:07:48 -07:00
Doug Gregor
11969847c4 Simplify lazy parsing of nominal and extension members.
Lazy parsing for the members of nominal types and extensions depends
only on information already present in
`IterableDeclContext`. Eliminate the use of PersistentParserState as
an intermediary and have the member-parsing request construct a new
`Parser` instance itself to handle parsing. Make this possible even
for ill-formed nominal types/extensions to simplify the code path.

Eliminate `LazyMemberParser` and all of its uses, because it was only
present for lazy member parsing, which no longer needs it.
2019-08-30 08:29:43 -07:00
swift-ci
86bdfeb467 Merge remote-tracking branch 'origin/master' into master-rebranch 2019-08-29 14:04:23 -07:00
Doug Gregor
9dd5a3cdd6 [Parser] Make delayed member parsing not depend on "persistent parser" state.
The `DelayedDeclKind` structure that's allocated for each case where
we delay parsing the members of a nominal type definition or extension
contains information that is already available on the
`IterableDeclContext` (or can be reconstructed trivially from it). Use
that AST information rather than this side structure.
2019-08-29 11:05:25 -07:00
Doug Gregor
d8f7c9e72c [Parser] Introduce a request for parsing type and extension members.
Ensure that lazy parsing of the members of nominal type definitions
and extensions is handled through a request. Most of the effort here
is in establishing a new request zone for parser requests.
2019-08-28 21:39:56 -07:00
swift-ci
892b430a79 Merge remote-tracking branch 'origin/master' into master-rebranch 2019-08-28 10:24:36 -07:00
swift-ci
7b662362dc Merge remote-tracking branch 'origin/master' into master-rebranch 2019-08-27 14:44:31 -07:00
Rintaro Ishizaki
cb308b7e53 Revert "Revert "[Parser] Decouple the parser from AST creation (part 2)""
This reverts commit 8ad3cc8a82.
2019-08-27 14:36:41 -07:00
Rintaro Ishizaki
8ad3cc8a82 Revert "[Parser] Decouple the parser from AST creation (part 2)" 2019-08-27 12:28:48 -07:00
swift-ci
8b17a1aa49 Merge remote-tracking branch 'origin/master' into master-rebranch 2019-08-26 17:24:35 -07:00
Rintaro Ishizaki
3f4a4c0e2f [SyntaxParse] Don't record tokens while skipping 2019-08-26 19:10:51 +02:00
Rintaro Ishizaki
1551db619e [SyntaxParse] Support kindof() in isTopNode() 2019-08-26 19:10:51 +02:00
Rintaro Ishizaki
80e6d2793d [SyntaxParse] ParseError is not equivalent to code completion 2019-08-26 19:10:51 +02:00
Rintaro Ishizaki
52d999df9d [SyntaxParse] Use ArrayRef to pass list of nodes to ParsedSyntaxResult 2019-08-26 19:10:51 +02:00
Jan Svoboda
773cf5180e Update ASTGen documentation. 2019-08-26 19:10:51 +02:00
Jan Svoboda
a7051279bc Use SourceLoc as key in type map 2019-08-26 19:10:51 +02:00
Jan Svoboda
77924c4b84 [Parser] Decouple the parser from AST creation (part 2)
Instead of creating the AST directly in the parser (and libSyntax or
SwiftSyntax via SyntaxParsingContext), make Parser to explicitly create
a tree of ParsedSyntaxNodes. Their OpaqueSyntaxNodes can be either
libSyntax or SwiftSyntax. If AST is needed, it can be generated from the
libSyntax tree.
2019-08-26 19:10:51 +02:00
swift-ci
9b8c33e50b Merge remote-tracking branch 'origin/master' into master-rebranch 2019-08-23 14:03:49 -07:00
David Ungar
a40b694801 Use token start locations 2019-08-21 22:36:15 -07:00
David Ungar
d84d541e99 De-lazify 2019-08-21 12:02:25 -07:00
David Ungar
0dbf7e6ab6 Parser changes for lazy ASTScopes 2019-08-21 09:45:45 -07:00
swift-ci
b6e97a229e Merge remote-tracking branch 'origin/master' into master-rebranch 2019-08-15 19:24:21 -07:00