Commit Graph

3981 Commits

Author SHA1 Message Date
Nathan Hawes
d930599394 Merge pull request #27591 from nathawes/r55680999-fix-object-literals-in-invalid-code
[syntax-coloring] Add fallback handling for object literals when no ObjectLiteralExpr appears in the AST
2019-10-10 13:54:10 -07:00
swift-ci
84f192ddce Merge remote-tracking branch 'origin/master' into master-next 2019-10-10 13:50:08 -07:00
Xi Ge
dd33540231 AST: rename printDeclUSRForModuleDoc to printDeclUSR. NFC 2019-10-09 15:29:52 -07:00
Nathan Hawes
666a98cfd8 [syntax-coloring] Add fallback handling for coloring object literals when they don't appear in the AST
Resolves rdar://problem/55680999
2019-10-09 12:15:43 -07:00
swift-ci
3bad1c2af4 Merge remote-tracking branch 'origin/master' into master-next 2019-10-08 07:49:04 -07:00
Slava Pestov
a260d0a445 AST: getInterfaceType() returns ErrorType instead of Type() on circularity 2019-10-08 01:37:09 -04:00
swift-ci
d410fb848d Merge remote-tracking branch 'origin/master' into master-next 2019-10-07 22:09:16 -07:00
Slava Pestov
7063ecd338 IDE: Eliminate typeCheckCompletionDecl() 2019-10-05 00:39:32 -04:00
swift-ci
82f5b72f7f Merge remote-tracking branch 'origin/master' into master-next 2019-10-02 18:49:28 -07:00
Robert Widmann
9b7ab6bfe7 Merge pull request #27403 from CodaFi/thursday-night-raw
Requestify the Raw Value Accessor
2019-10-02 18:31:28 -07:00
Robert Widmann
2fe3ce8af8 Requestify the Raw Value Accessor
Make getRawValueExpr() return a checked value.

This entails a strange kind of request that effectively acts like
a cache warmer.  In order to properly check the raw value expression for
a single case, we actually need all the other cases for the
autoincrementing synthesis logic.  The strategy is therefore to have the
request act at the level of the parent EnumDecl and check all the values
at once.  We also cache at the level of the EnumDecl so the cache
"warms" for all enum elements simultaneously.

The request also abuses TypeResolutionStage to act as an indicator for
how much information to compute.  In the minimal case, we will return
a complete accounting of (auto-incremented) raw values.  In the maximal
case we will also check and record types and emit diagnostics.  The
minimal case is uncached to support repeated evaluation.

Note that computing the interface type of an @objc enum decl *must*
force this request.  The enum's raw values are part of the ABI, and we
should not get all the way to IRGen before discovering that we cannot
possibly lay out the enum.  In the future, we might want to consider
moving this check earlier or have IRGen tolerate broken cases but for
now we will maintain the status quo and not have IRGen emit
diagnostics.
2019-10-02 16:09:25 -07:00
swift-ci
fce78ed221 Merge remote-tracking branch 'origin/master' into master-next 2019-10-02 14:49:41 -07:00
Argyrios Kyrtzidis
4f07dcbb76 [lib/IDE] Improve error message outputted from getPlistEntry function. NFC 2019-10-02 13:54:49 -07:00
swift-ci
5e50242b5e Merge remote-tracking branch 'origin/master' into master-next 2019-09-30 16:09:53 -07:00
Robert Widmann
75670c1727 Merge pull request #27436 from CodaFi/signed-sealed-delivered
[NFC] Adopt TypeBase-isms for GenericSignature
2019-09-30 15:50:42 -07:00
Joe Groff
b92c37e434 Merge branch 'master' into master-next 2019-09-30 15:43:57 -07:00
Robert Widmann
5a8d0744c3 [NFC] Adopt TypeBase-isms for GenericSignature
Structurally prevent a number of common anti-patterns involving generic
signatures by separating the interface into GenericSignature and the
implementation into GenericSignatureBase.  In particular, this allows
the comparison operators to be deleted which forces callers to
canonicalize the signature or ask to compare pointers explicitly.
2019-09-30 14:04:36 -07:00
David Ungar
ea81fdc7d8 Merge pull request #27313 from davidungar/generic-request-or-extended-nominal-assertion
Fail early if getExtendedNominal is called before extension has been bound.
2019-09-30 08:37:33 -07:00
David Ungar
4bc4030338 Catch failures earlier caused by premature requests for extended nominal 2019-09-28 15:19:32 -07:00
swift-ci
4996f30dd7 Merge remote-tracking branch 'origin/master' into master-next 2019-09-24 14:09:47 -07:00
Nathan Hawes
03bdd1c5c6 Merge pull request #27329 from nathawes/r55045797-image-literal-syntax-map
[IDE] Fix ModelASTWalker passing syntax nodes before the corresponding AST nodes have been visited
2019-09-24 13:58:35 -07:00
swift-ci
45461160d6 Merge remote-tracking branch 'origin/master' into master-next 2019-09-24 11:49:46 -07:00
Rintaro Ishizaki
439b9111b7 Merge pull request #27325 from rintaro/syntaxparse-cctype
[SyntaxParse] Introduce CodeCompletionTypeSyntax
2019-09-24 20:43:43 +02:00
Nathan Hawes
888529cf97 [IDE] Fix ModelASTWalker passing syntax nodes before the corresponding AST nodes had been visited
This was causing the tokens comprising image literals to be output separately,
rather than as a single object literal.

Resolves rdar://problem/55045797
2019-09-24 11:39:54 -07:00
swift-ci
41d0ab088e Merge remote-tracking branch 'origin/master' into master-next 2019-09-24 11:29:41 -07:00
Rintaro Ishizaki
1a9b6d0dbf [SyntaxParse] Introduce CodeCompletionTypeSyntax
To represent a type with code completion.

  type? '.'? <code-completion-token>

This is "parser only" node which is not exposed to SwiftSyntax.
Using this, defer to set the parsed type to code-completion callbacks.
2019-09-24 10:21:38 -07:00
Robert Widmann
50d9ab6694 [NFC] Drop some unnecesary interface type forcing 2019-09-24 10:12:16 -07:00
swift-ci
388697b23c Merge remote-tracking branch 'origin/master' into master-next 2019-09-23 22:50:12 -07:00
Robert Widmann
792e1db448 Port getInterfaceType() patterns in ancillary libraries 2019-09-23 16:49:51 -07:00
swift-ci
7a21185ac1 Merge remote-tracking branch 'origin/master' into master-next 2019-09-21 08:11:08 -07:00
Robert Widmann
b135928125 Drop CheckingWithValidSignature from the validation state machine
Now that the generic signature is computable on demand, this predicate is doubly useless.  All of the callers intended to ask "hasInterfaceType" anyways.
2019-09-20 22:22:49 -07:00
swift-ci
448807f579 Merge remote-tracking branch 'origin/master' into master-next 2019-09-20 19:09:54 -07:00
Robert Widmann
f0e73c84fc Merge pull request #26480 from CodaFi/makes-a-nominal-decl-healthy-wealthy-and-memberwise
[FB6918951] Expand "Make Memberwise Initializer" Refactoring Action
2019-09-20 19:01:16 -07:00
swift-ci
5df0999ebc Merge remote-tracking branch 'origin/master' into master-next 2019-09-20 18:29:54 -07:00
Slava Pestov
8f346a0ca8 IDE: Pick off another usage of isConvertibleTo() with openArchetypes=true 2019-09-20 17:59:56 -04:00
swift-ci
8ce5b01307 Merge remote-tracking branch 'origin/master' into master-next 2019-09-18 15:09:47 -07: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
swift-ci
dce64e93ee Merge remote-tracking branch 'origin/master' into master-next 2019-09-18 10:49:47 -07:00
Nathan Hawes
4dac0d1e8b Merge pull request #27218 from nathawes/r53958454-getFixedTypeRecursive-code-completion-crash
[code-completion] Remove special handling for completion on the RHS of an assignment
2019-09-18 10:49:38 -07:00
swift-ci
a453eda2dc Merge remote-tracking branch 'origin/master' into master-next 2019-09-18 10:09:53 -07:00
Nathan Hawes
54defbc7f7 [code-completion] Remove special handling for completion on the RHS of an assignment
This simplifies the code and prevents an assertion failure this code was
hitting computing the type relations between the result types and what it
determined as the expected type.

Resolves rdar://problem/53958454
2019-09-17 18:59:33 -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
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
swift-ci
1b531a3491 Merge remote-tracking branch 'origin/master' into master-next 2019-09-13 11:50:18 -07:00
Sasha Krassovsky
d4110e44f2 Fix warnings in IDE 2019-09-13 09:57:48 -07:00
swift-ci
cdffb88fe8 Merge remote-tracking branch 'origin/master' into master-next 2019-09-12 18:10:45 -07:00
Slava Pestov
18c05a51c1 IDE: Remove dead workaround 2019-09-12 16:37:53 -04:00
Slava Pestov
fbb1537c58 IDE: Use methods on TypeBase instead of going through canSatisfy() 2019-09-12 16:37:53 -04:00
swift-ci
42faf00579 Merge remote-tracking branch 'origin/master' into master-next 2019-09-11 13:57:43 -07:00