Commit Graph

787 Commits

Author SHA1 Message Date
Slava Pestov
fc80f75273 AST: Create new 'invalid' state for ProtocolConformanceRef 2018-07-16 16:44:27 -07:00
swift-ci
9e940b1782 Merge remote-tracking branch 'origin/master' into master-next 2018-07-15 16:49:04 -07:00
danielzheng
7dc8dd6fb0 [ASTDumper] Use consistent coloring.
- Print "assign_expr" with color (using `printCommon`).
- Print "function_ref" for UnresolvedDotExpr with color, to be
consistent with all other "function_ref" printing.
2018-07-15 05:11:24 -07:00
danielzheng
8239cf8c57 [ASTDumper] Use consistent coloring for ValueDecls ("decl=").
Most instances of "decl=" were printed with color but some were not.
Now, all instances of "decl=" (and the subsequent ValueDecl or
ConcreteDeclRef) are printed with color.
2018-07-15 05:11:16 -07:00
danielzheng
ad66f23a68 [ASTDumper] Use consistent coloring for closing parentheses.
Some colored open parentheses (printed by `printCommon`) had uncolored
closing parenthesis counterparts. Now, all such closing parentheses are
colored.
2018-07-15 03:18:35 -07:00
swift-ci
f9fbeb1068 Merge remote-tracking branch 'origin/master' into master-next 2018-07-06 06:08:58 -07:00
Slava Pestov
b102964729 AST: Remove unused function 2018-07-06 02:24:14 -07:00
swift-ci
0b12c9a5fa Merge remote-tracking branch 'origin/master' into master-next 2018-07-06 00:49:00 -07:00
Slava Pestov
381483bd74 AST: Remove Expr's LValueAccessKind 2018-07-05 23:54:13 -07:00
swift-ci
decf2b1130 Merge remote-tracking branch 'origin/master' into master-next 2018-07-05 11:49:26 -07:00
John McCall
34b0cbc11d Merge pull request #16237 from davezarzycki/metaprogram_ref_storage_types
[AST] NFC: Enable reference storage type meta-programming
2018-07-05 14:45:38 -04:00
swift-ci
f3b8a3cbaf Merge remote-tracking branch 'origin/master' into master-next 2018-06-30 10:09:20 -07:00
David Zarzycki
5b9f5062f9 [AST] NFC: Adopt reference storage type meta-programming macros 2018-06-30 06:44:33 -04:00
John McCall
9bee3cac5a Generalize storage implementations to support generalized accessors.
The storage kind has been replaced with three separate "impl kinds",
one for each of the basic access kinds (read, write, and read/write).
This makes it far easier to mix-and-match implementations of different
accessors, as well as subtleties like implementing both a setter
and an independent read/write operation.

AccessStrategy has become a bit more explicit about how exactly the
access should be implemented.  For example, the accessor-based kinds
now carry the exact accessor intended to be used.  Also, I've shifted
responsibilities slightly between AccessStrategy and AccessSemantics
so that AccessSemantics::Ordinary can be used except in the sorts of
semantic-bypasses that accessor synthesis wants.  This requires
knowing the correct DC of the access when computing the access strategy;
the upshot is that SILGenFunction now needs a DC.

Accessor synthesis has been reworked so that only the declarations are
built immediately; body synthesis can be safely delayed out of the main
decl-checking path.  This caused a large number of ramifications,
especially for lazy properties, and greatly inflated the size of this
patch.  That is... really regrettable.  The impetus for changing this
was necessity: I needed to rework accessor synthesis to end its reliance
on distinctions like Stored vs. StoredWithTrivialAccessors, and those
fixes were exposing serious re-entrancy problems, and fixing that... well.
Breaking the fixes apart at this point would be a serious endeavor.
2018-06-30 05:19:03 -04:00
swift-ci
9885d9e133 Merge remote-tracking branch 'origin/master' into master-next 2018-06-21 09:10:01 -07:00
Joe Groff
d17b767361 Merge pull request #17219 from fedetrim/master
[SR-7904] Add source filenames in the output of `-dump-ast`
2018-06-21 08:59:43 -07:00
swift-ci
01fe4cdcd7 Merge remote-tracking branch 'origin/master' into master-next 2018-06-20 19:09:02 -07:00
Huon Wilson
10b30fef78 [GSB] Explicit error on unsupported conditional conformance recursion.
This doesn't fix the fundamental problem of correctly handling such cases, but
it is better than the "error message" that occurred previously:

    Assertion failed: ((bool)typeSig == (bool)extensionSig && "unexpected generic-ness mismatch on conformance").

Fixes the crash rdar://problem/41281406 (that in
https://bugs.swift.org/browse/SR-6569 (rdar://problem/36068136)),
https://bugs.swift.org/browse/SR-8019 (rdar://problem/41216423) and
https://bugs.swift.org/browse/SR-7989 (rdar://problem/41126254).
2018-06-21 10:53:30 +10:00
swift-ci
8eae3f0fc4 Merge remote-tracking branch 'origin/master' into master-next 2018-06-18 17:09:50 -07:00
swift-ci
8f23048c85 Merge pull request #17097 from brentdax/noescape-from-the-ast-dump-scrape 2018-06-18 16:59:37 -07:00
Federico Trimboli
63f0697df1 [SR-7904] Add source filenames in the output of -dump-ast 2018-06-15 11:29:29 -03:00
Bob Wilson
5df3d1f100 Merge remote-tracking branch 'origin/master' into master-next 2018-06-14 20:51:48 -07:00
John McCall
9022b5152f Rename accessor kinds from IsGetter -> IsGet, etc.
Introduce some metaprogramming of accessors and generally prepare
for storing less-structured accessor lists.

NFC except for a change to the serialization format.
2018-06-14 17:08:55 -04:00
swift-ci
1bb550e4ea Merge remote-tracking branch 'origin/master' into master-next 2018-06-11 16:49:21 -07:00
Bob Wilson
033b884de6 [master-next] Replace use of F_RW flag that was removed in LLVM r334221
Use a combination of the new FA_Read and FA_Write flags instead.
2018-06-11 14:53:35 -07:00
Robert Widmann
7d82e70f2c Excise getInput() from printing
Not NFC because it changes the printing behavior for function type
parameters.  They are no longer reported as types (paren, tuple, or raw),
but as Params.
2018-06-10 19:40:26 -07:00
Brent Royal-Gordon
fb79b8f44e Indicate which closures are escaping in AST dumps 2018-06-10 14:03:01 -07:00
Doug Gregor
147e6e937f Merge pull request #16778 from brentdax/semantic-expr-dump
Dump semantic expressions in AST consistently
2018-05-23 15:06:11 -07:00
Brent Royal-Gordon
e6debec9c4 Dump various nodes’ semanticExprs
Previously, only DictionaryExpr dumped its semanticExpr, and it replaced the direct contents. With this change, all nodes with a semanticExpr dump it, and they all handle it in the same way: they append it to the end of the list of children, in a separate S-expression marked by “semantic_expr”.
2018-05-22 14:17:21 -07:00
Brent Royal-Gordon
531109ca1f Add closing paren after ObjectLiteralExpr dump 2018-05-22 14:14:04 -07:00
Mark Rowe
88629e9dbc Include source ranges for statements in the AST dump. 2018-05-17 10:50:19 -07:00
Mark Rowe
b4481a1300 Include source ranges for parameter lists in the AST dump. 2018-05-17 10:50:19 -07:00
Mark Rowe
62eb12b652 Include source ranges for decls in the AST dump. 2018-05-17 10:50:19 -07:00
Ben Langmuir
f20586b3d8 Revert "Include source ranges for statements, declarations, and parameter lists in the AST dump" 2018-05-17 09:53:05 -07:00
Jordan Rose
cb6c8f0a8e Merge pull request #16473 from bdash/ast-dump-source-ranges
Include source ranges for statements, declarations, and parameter lists in the AST dump
2018-05-17 09:16:35 -07:00
Mark Rowe
4ba6dd3a92 Fix some style issues. 2018-05-15 10:24:27 -07:00
Huon Wilson
35cc2d65e4 [AST] Desugar associated types in ProtocolConformance::dump.
Otherwise, since typealiases are used so often, one ends up with dumps
that say nothing new/useful:

    (normal_conformance type=X protocol=P
      (assoc_type req=A type=X.A))
2018-05-16 00:57:26 +10:00
Huon Wilson
835c2c9c48 [AST] Break recursion in SubstitutionMap::dump too. 2018-05-15 22:17:52 +10:00
Huon Wilson
ad503e913e [AST] Don't \n when dumping an abstract ProtocolConformanceRef as part of a larger dump. 2018-05-15 22:17:52 +10:00
Huon Wilson
9d13361964 [AST] Introduce a minimal SubstitutionMap dump for use inside expressions.
Within a dump of a DeclRef (or, more likely, a larger entity that includes one),
the full multiline details of a substitution map are likely to not be hugely
relevant, and just get in the way of understanding the interesting parts of the
dump. Thus, this is a variant that is a single line and just includes the
substitutions; the conformances (or, at least, the protocols involved) can be
inferred from the generic signature combined with those substitutions.

The style is controlled via a enum rather than a boolean, to avoid problems with
trying to pass an indent like `map->dump(out, indent)`, where the integer indent
coerces to a bool, rather than error.

Fixes rdar://problem/40074968.
2018-05-15 22:17:52 +10:00
Huon Wilson
dad4169333 [AST] Make dumping for SubstitutionMap lisp-formatted and indent-aware.
This is much easier to read when part of a larger dump, where it now occurs in
expressions and specialized conformances.

Part of rdar://problem/40074968.
2018-05-15 22:17:52 +10:00
Huon Wilson
f2e2f837b5 [AST] Make dumping a recursive conformance not a horrible mistake.
A recursive conformance would previously recur infinitely, but now prints just
the header plus "(details printed above)".

Fixes (most of) rdar://problem/40074968
2018-05-15 22:17:52 +10:00
Doug Gregor
ef020c74aa Eliminate all vestiges of Substitution and SubstitutionList.
Introduced during the bring-up of the generics system in July, 2012,
Substitution (and SubstitutionList) has been completely superseded by
SubstitutionMap. R.I.P.
2018-05-11 21:43:40 -07:00
Mark Rowe
c58dcfc5cc Include source ranges for statements in the AST dump. 2018-05-09 11:15:35 -07:00
Mark Rowe
46f95d615d Include source ranges for parameter lists in the AST dump. 2018-05-09 11:15:35 -07:00
Mark Rowe
28af6959b8 Include source ranges for decls in the AST dump. 2018-05-09 11:15:35 -07:00
Mark Rowe
ffe6a8756e Remove an unmatched single quote from unresolved_member_expr 2018-05-03 11:44:50 -07:00
Mark Rowe
8bcff89790 Add a missing closing paren for a dictionary_expr that has a semantic expression 2018-05-03 11:44:50 -07:00
Doug Gregor
3e2bed119b [AST] Switch SpecializedProtocolConformance over to SubstitutionMap.
Eliminate another common use of SubstitutionList from the AST.
2018-05-02 13:38:15 -07:00
Doug Gregor
192234415d [AST] Store SubstitutionMaps in ConcreteDeclRef and Witness data structures.
Replace two prominent uses of SubstitutionList, in ConcreteDeclRef and
Witness, with SubstitutionMap. Deal with the myriad places where we
now have substitution maps and need substitution lists (or vice versa)
caused by this change.

Overall, removes ~50 explicit uses of SubstitutionList (of ~400).
2018-05-02 13:38:14 -07:00