Commit Graph

2357 Commits

Author SHA1 Message Date
Rintaro Ishizaki
8a03e08966 Revert "Merge pull request #26403 from rintaro/gsoc-2019-part1"
This reverts commit 1a211e6e5f, reversing
changes made to 482d0621a6.
2019-10-14 15:18:05 -07:00
Rintaro Ishizaki
570ed9361f Revert "Merge pull request #26883 from rintaro/revert-revert-26478-gsoc-2019-parser-types"
This reverts commit faaa3a859d, reversing
changes made to 62f947d6ba.
2019-10-14 15:18:05 -07:00
Rintaro Ishizaki
8df497dab6 Revert "Merge pull request #26974 from rintaro/syntaxparse-roundtrip2"
This reverts commit 27ded648cf, reversing
changes made to 42fdacc079.
2019-10-14 13:45:48 -07:00
Rintaro Ishizaki
00613db8db Revert "Merge pull request #27230 from rintaro/syntaxparsse-rdar55421369"
This reverts commit b09f87594a, reversing
changes made to d0b7ecab00.
2019-10-14 12:47:23 -07:00
Rintaro Ishizaki
8768832f24 Revert "Merge pull request #27281 from rintaro/reapply-syntaxparse-genericparam"
This reverts commit 5d3e8d6c83, reversing
changes made to 27e881d97e.
2019-10-14 12:46:31 -07:00
Rintaro Ishizaki
045593dcd9 Revert "Merge pull request #27308 from rintaro/parse-debuggercontextchange"
This reverts commit 3fd8481f06, reversing
changes made to e9bf767cbd.
2019-10-14 12:21:54 -07:00
Rintaro Ishizaki
fbc7c6c1c5 Revert "Merge pull request #27416 from rintaro/syntaxparse-declassociatedtype"
This reverts commit 5726179da9, reversing
changes made to d5adbe2c55.
2019-10-14 12:19:53 -07:00
Rintaro Ishizaki
4eadbaa9f6 Revert "Merge pull request #27466 from rintaro/syntaxparse-type"
This reverts commit a4fcd26b38, reversing
changes made to 88ecae4b9a.
2019-10-14 12:19:04 -07:00
Rintaro Ishizaki
c773c3b5cf Revert "Merge pull request #27485 from rintaro/syntaxparse-decltypealias"
This reverts commit 8c5dcc0fe5, reversing
changes made to af5eda5d24.
2019-10-14 12:18:47 -07:00
Rintaro Ishizaki
550865caf6 Revert "Merge pull request #27528 from rintaro/syntaxparse-rdar55952739"
This reverts commit 2ddba9cf21, reversing
changes made to 33770fa665.
2019-10-14 12:18:05 -07:00
Rintaro Ishizaki
cd1a2995ff Revert "Merge pull request #27531 from rintaro/syntaxparse-matchingtoken"
This reverts commit 2035658c57, reversing
changes made to 18f2b97641.
2019-10-14 12:17:45 -07:00
Rintaro Ishizaki
6f4dc258f5 Revert "Merge pull request #27544 from rintaro/syntaxparse-attrincomplete"
This reverts commit 071a7134b3, reversing
changes made to dbddb0d89a.
2019-10-14 12:17:27 -07:00
Rintaro Ishizaki
0e8010d8b9 Revert "Merge pull request #27592 from rintaro/syntaxparse-exprtuple"
This reverts commit cdfd1ab2cf, reversing
changes made to eb02f20f99.
2019-10-14 12:15:48 -07:00
Robert Widmann
660f66d7c0 Delete the IsTypeLocImplicit Bit 2019-10-11 13:41:19 -07:00
Slava Pestov
12231d2df3 Merge pull request #27571 from slavapestov/circular-validation-cleanups-5
Circular validation cleanups, part 5
2019-10-10 19:52:56 -04:00
Slava Pestov
d8b61ff24b Sema: Peel off typeCheckParameterList()'s specifier computation into a request
Since getSpecifier() now kicks off a request instead of always
returning what was previously set, we can't pass a ParamSpecifier
to the ParamDecl constructor anymore. Instead, callers either
call setSpecifier() if the ParamDecl is synthesized, or they
rely on the request, which can compute the specifier in three
specific cases:

- Ordinary parsed parameters get their specifier from the TypeRepr.

- The 'self' parameter's specifier is based on the self access kind.

- Accessor parameters are either the 'newValue' parameter of a
  setter, or a cloned subscript parameter.

For closure parameters with inferred types, we still end up
calling setSpecifier() twice, once to set the initial defalut
value and a second time when applying the solution in the
case that we inferred an 'inout' specifier. In practice this
should not be a big problem because expression type checking
walks the AST in a pre-determined order anyway.
2019-10-10 15:00:07 -04:00
Rintaro Ishizaki
bb08667bf5 [SyntaxParse] Parse tuple/paren expression syntax 2019-10-09 14:48:47 -07:00
Rintaro Ishizaki
f42f60f233 [Syntax] Consolidate 'TupleElement' and 'FunctionCallArgument' kinds
into 'TupleExprElement'. They had exact the same layout.
2019-10-07 20:52:11 -07:00
Rintaro Ishizaki
2035658c57 Merge pull request #27531 from rintaro/syntaxparse-matchingtoken
[SyntaxParse] Adjust parseMatchingToken()
2019-10-08 02:52:41 +02:00
Rintaro Ishizaki
d2971fa1a0 [SyntaxParse] Fix crasher for generic parameter with attributes
It used to crash for:
Attribute without its name (e.g. Foo<@>)
Missing name with attributes (e.g. Foo<@available(*, unavailable)>

- Synthesize identifier token so that the SyntaxParsingContext can
  successfully construct the Attribute syntax.
- Don't throw away the parsed attributes if the parameter name is
  missing. Instead, construct GenericParamater syntax anyway, and handle
  it in ASTGen.
2019-10-04 11:03:23 -07:00
Rintaro Ishizaki
c022ff23e8 [SyntaxParse] Adjust parseMatchingToken() 2019-10-03 13:48:57 -07:00
Rintaro Ishizaki
edbf24c5b3 [SyntaxParse] Fix attribute generation in ASTGen
For the intermediate lookup table of the parsed decl attributes, use
location the first token of the attributes instead of the start location
of the *parsed* attribute list because some attributes can be ignored
during the parsing.

rdar://problem/55952739
2019-10-03 12:57:53 -07:00
Rintaro Ishizaki
5914325a02 [SyntaxParse] Parse typealias declaration 2019-10-02 14:24:33 -07:00
Rintaro Ishizaki
7b31d2b4fb [SyntaxParse] Finish type parsing
- Type attributes
- SIL types
2019-10-01 15:40:10 -07:00
Rintaro Ishizaki
c56421c5be [SyntaxParse] Ignore token in consecutive ID diagnostics 2019-09-27 23:52:39 -07:00
Rintaro Ishizaki
9eb4c216ee Revert "Revert "[SyntaxParse] Parse associatedtype decl""
This reverts commit 859f90afc1.
2019-09-27 23:52:39 -07:00
Rintaro Ishizaki
859f90afc1 Revert "[SyntaxParse] Parse associatedtype decl" 2019-09-25 11:00:21 -07:00
Rintaro Ishizaki
fc8a2e6f86 [SyntaxParse] Parse associatedtype decl
Along with inheritance clause.
2019-09-24 12:03:06 -07:00
Rintaro Ishizaki
33cf98360b [Parse] DebuggerContextChange.h 2019-09-23 15:07:09 -07:00
Rintaro Ishizaki
a42bdf4c20 [Parse] Simplify parseIdentifierDeclName()
As a preparation for syntax parsing.
2019-09-20 23:10:48 -07:00
Rintaro Ishizaki
0569cbfb28 Revert "Revert "[SyntaxParse] Parse generic parameter clause and generic where clause""
This reverts commit 1584e87aa7.
2019-09-20 15:26:04 -07:00
Rintaro Ishizaki
1584e87aa7 Revert "[SyntaxParse] Parse generic parameter clause and generic where clause" 2019-09-20 14:02:53 -07:00
Rintaro Ishizaki
f919b2ddd8 [SyntaxParse] Parse generic parameter clause and generic where clause 2019-09-19 23:09:58 -07:00
Rintaro Ishizaki
b09f87594a Merge pull request #27230 from rintaro/syntaxparsse-rdar55421369
[SyntaxParse] Re-apply move-only ParsedRawSyntaxNode
2019-09-19 07:36:14 +02:00
Robert Widmann
38bde33067 Merge pull request #27172 from CodaFi/aliasing-artifacts-and-noise-reduction-techniques
Kill validateDeclForNameLookup Harder
2019-09-18 15:00:51 -07:00
Jordan Rose
8d7f1b7c5d [AST] Separate SourceFile from FileUnit.h
Like the last commit, SourceFile is used a lot by Parse and Sema, but
less so by the ClangImporter and (de)Serialization. Split it out to
cut down on recompilation times when something changes.

This commit does /not/ split the implementation of SourceFile out of
Module.cpp, which is where most of it lives. That might also be a
reasonable change, but the reason I was reluctant to is because a
number of SourceFile members correspond to the entry points in
ModuleDecl. Someone else can pick this up later if they decide it's a
good idea.

No functionality change.
2019-09-17 17:54:41 -07:00
Jordan Rose
853caa66d4 [AST] Split FileUnit and its subclasses out of Module.h
Most of AST, Parse, and Sema deal with FileUnits regularly, but SIL
and IRGen certainly don't. Split FileUnit out into its own header to
cut down on recompilation times when something changes.

No functionality change.
2019-09-17 17:54:41 -07:00
Rintaro Ishizaki
9f642f0bc1 Revert "Merge pull request #27203 from CodaFi/movin-on-up"
This reverts commit 387d2a9aee, reversing
changes made to bf1ab6c29d.
2019-09-17 16:42:44 -07:00
Robert Widmann
5e34169aca Separate computing interface types and underlying types
Computing the interface type of a typealias used to push validation forward and recompute the interface type on the fly.  This was fragile and inconsistent with the way interface types are computed in the rest of the decls.  Separate these two notions, and plumb through explicit interface type computations with the same "computeType" idiom.  This will better allow us to identify the places where we have to force an interface type computation.

Also remove access to the underlying type loc.  It's now just a cache location the underlying type request will use.  Push a type repr accessor to the places that need it, and push the underlying type accessor for everywhere else.  Getting the structural type is still preferred for pre-validated computations.

This required the resetting of a number of places where we were - in many cases tacitly - asking the question "does the interface type exist".  This enables the removal of validateDeclForNameLookup
2019-09-17 08:20:55 -07:00
Robert Widmann
362b21926c Revert "Merge pull request #26937 from rintaro/syntaxparse-leakfix"
This reverts commit e49401bbca, reversing
changes made to bd222ad71c.
2019-09-16 15:07:19 -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
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
Slava Pestov
c87e1a23db Sema: Try harder not to page in all members of imported classes 2019-09-03 22:39:35 -04:00
Rintaro Ishizaki
27ded648cf Merge pull request #26974 from rintaro/syntaxparse-roundtrip2
[SyntaxParse] Don't discard 'typealias' without identifier
2019-09-03 19:58:59 +02: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
Doug Gregor
b3e3d39ab3 [Parser] Only skip function bodies when delayed callbacks tell us to. 2019-09-02 19:03:07 -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
eeckstein
903eeb220b Revert "Add a request to lazily parse function bodies." 2019-08-31 12:29:01 +02:00
Doug Gregor
7ce3553c45 Merge pull request #26972 from DougGregor/request-function-body-parse
Add a request to lazily parse function bodies.
2019-08-30 21:57:15 -07:00
Rintaro Ishizaki
992cc032a7 [SyntaxParse] Don't discard 'typealias' without identifier
Fixes round trip issue
2019-08-30 16:59:40 -07:00