Commit Graph

1486 Commits

Author SHA1 Message Date
Doug Gregor
bef06570c7 Merge pull request #244 from mohammadg/dev
Remove unnecessary 'visitDecl' default cases.
2016-01-11 20:48:58 -08:00
practicalswift
50baf2e53b Use consistent formatting in top of file headers. 2016-01-04 02:17:48 +01:00
practicalswift
dfcece7960 Use consistent style for comment separators. 2016-01-04 01:41:33 +01:00
Chris Lattner
6afe77d597 Eliminate the Parameter type completely - now ParameterList is just
an overblown array of ParamDecl*'s that also keeps track of parenlocs
and has helper methods.
2016-01-03 14:45:38 -08:00
Mark Lacey
0d2195ba6c Fixup SourceKit now that TypeLoc is in ParamDecl.
That change was introduced in 4479b46, but SourceKit wasn't updated at
the same time.
2016-01-01 15:15:56 -08:00
Chris Lattner
a30ae2bf55 Merge pull request #836 from zachpanz88/new-year
Update copyright date
2015-12-31 19:36:14 -08:00
Chris Lattner
7daaa22d93 Completely reimplement/redesign the AST representation of parameters.
Parameters (to methods, initializers, accessors, subscripts, etc) have always been represented
as Pattern's (of a particular sort), stemming from an early design direction that was abandoned.
Being built on top of patterns leads to patterns being overly complicated (e.g. tuple patterns
have to have varargs and default parameters) and make working on parameter lists complicated
and error prone.  This might have been ok in 2015, but there is no way we can live like this in
2016.

Instead of using Patterns, carve out a new ParameterList and Parameter type to represent all the
parameter specific stuff.  This simplifies many things and allows a lot of simplifications.
Unfortunately, I wasn't able to do this very incrementally, so this is a huge patch.  The good
news is that it erases a ton of code, and the technical debt that went with it.  Ignoring test
suite changes, we have:
   77 files changed, 2359 insertions(+), 3221 deletions(-)

This patch also makes a bunch of wierd things dead, but I'll sweep those out in follow-on
patches.

Fixes <rdar://problem/22846558> No code completions in Foo( when Foo has error type
Fixes <rdar://problem/24026538> Slight regression in generated header, which I filed to go with 3a23d75.

Fixes an overloading bug involving default arguments and curried functions (see the diff to
Constraints/diagnostics.swift, which we now correctly accept).

Fixes cases where problems with parameters would get emitted multiple times, e.g. in the
test/Parse/subscripting.swift testcase.

The source range for ParamDecl now includes its type, which permutes some of the IDE / SourceModel tests
(for the better, I think).

Eliminates the bogus "type annotation missing in pattern" error message when a type isn't
specified for a parameter (see test/decl/func/functions.swift).

This now consistently parenthesizes argument lists in function types, which leads to many diffs in the
SILGen tests among others.

This does break the "sibling indentation" test in SourceKit/CodeFormat/indent-sibling.swift, and
I haven't been able to figure it out.  Given that this is experimental functionality anyway,
I'm just XFAILing the test for now.  i'll look at it separately from this mongo diff.
2015-12-31 19:24:46 -08:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
Chris Lattner
feace85d5a Enhance SubscriptDecl to be a DeclContext, so it can hold its indices.
This is necessary for some other work I'm doing, which really wants
paramdecls to have reasonable declcontexts.  It is also a small step
towards generic subscripts.
2015-12-31 12:38:28 -08:00
Dmitri Gribenko
58e7032703 Merge pull request #798 from mayurkr/mayurkr-patch-1
Fixed Typos
2015-12-28 13:26:44 +02:00
Mayur Raiturkar
e917f8537a Typo fixes 2015-12-28 16:45:40 +05:30
practicalswift
149b50d901 Fix typos in code (non-comment/documentation typos). 2015-12-28 11:42:15 +01:00
practicalswift
d89b4d45e1 Fix typos in code (non-comment typos). 2015-12-27 13:05:01 +01:00
practicalswift
fa0b339a21 Fix typos. 2015-12-26 17:51:59 +01:00
practicalswift
22e10737e2 Fix typos 2015-12-26 01:19:40 +01:00
practicalswift
4ff12be924 Fix typos. 2015-12-24 14:26:57 +01:00
practicalswift
cd7d8dfaff Fix alignment as requested by @gribozavr in #692 2015-12-21 08:54:24 +01:00
practicalswift
176f487d76 Fix incorrect filenames in headers. 2015-12-20 23:59:05 +01:00
Andrew Trick
739b0e9c56 Reorganize SILOptimizer directories for better discoverability.
(libraries now)

It has been generally agreed that we need to do this reorg, and now
seems like the perfect time. Some major pass reorganization is in the
works.

This does not have to be the final word on the matter. The consensus
among those working on the code is that it's much better than what we
had and a better starting point for future bike shedding.

Note that the previous organization was designed to allow separate
analysis and optimization libraries. It turns out this is an
artificial distinction and not an important goal.
2015-12-11 15:14:23 -08:00
Andrew Trick
84450b4c43 Reorganize SILOptimizer directories for better discoverability.
(Headers first)

It has been generally agreed that we need to do this reorg, and now
seems like the perfect time. Some major pass reorganization is in the
works.

This does not have to be the final word on the matter. The consensus
among those working on the code is that it's much better than what we
had and a better starting point for future bike shedding.

Note that the previous organization was designed to allow separate
analysis and optimization libraries. It turns out this is an
artificial distinction and not an important goal.
2015-12-11 12:34:51 -08:00
Xi Ge
cf11ca48b9 [SourceKit] Sanitize -embed-bitcode flag to avoid crashing. rdar://22874139 2015-12-09 15:05:21 -08:00
Tysun M
faddc283be Two typo corrections for SwiftEditor.cpp
Lines 1132 and 2666. Thank you.
2015-12-09 14:25:30 -08:00
Xi Ge
ab969d14a4 [SourceKit][PlaceholderExpand] Avoid function signatures when expanding trailing closures of ()->(). rdar://21879249 2015-12-07 11:48:53 -08:00
Mohammad Ghasembeigi
ee2ceca8d1 Remove unnecessary 'visitDecl' default cases.
The default cases are unnecessary and provide no benefits so they should
just be removed.
2015-12-06 03:08:08 +11:00
Martin Kiss
b2ed2af54a Fix spelling 2015-12-03 20:55:43 +01:00
Dmitri Gribenko
4324e7c903 Remove conditional compilation of tvOS 2015-12-01 14:43:45 -07:00
Xi Ge
9beeb56a90 [TypeInterface] When printing type-specific interfaces, replace parameter and return types with instantiated types. 2015-11-17 19:12:30 -08:00
Xi Ge
4b847abf92 [SourceKit][CodeFormat] Align the comments before a case statement with the statement. rdar://20985149 2015-11-11 11:40:49 -08:00
Ben Langmuir
11444373a5 [CodeCompletion] Don't fuzzy-match on single characters
Use prefix matching on the first character, switch to fuzzy after 2 or
more. With only a single character, we often get silly fuzzy results.
2015-11-06 19:26:48 -08:00
Ben Langmuir
ef8338fe86 [CodeCompletion] Don't add inner results on non-declarations
We were getting some ridiculous completions that were just two
independentdcompletions concatenated together.

rdar://problem/22945376
2015-11-06 19:02:22 -08:00
Xi Ge
6d19519e14 [SourceKit][CodeFormat] Adjust the indentation for getter methods that have no explicit "getter" keyword.
rdar://21598808
2015-11-06 11:34:18 -08:00
Argyrios Kyrtzidis
f0f83d32c2 Fix -Wunused-function warnings. 2015-11-05 19:04:10 -08:00
Argyrios Kyrtzidis
a11b5628e3 [SourceKit] Use the correct macro, 'SWIFT_ENABLE_TARGET_TVOS'. 2015-11-05 18:34:42 -08:00
Xi Ge
c022c9925c [CodeComplete] Start to support keyword-based code completion. rdar://23101032
Conventionally, code completion results are matched with user input solely by
names. However, names are limited in expressiveness. From this comments, we start to
decorate code completion results with @keywords fields extracted from Clang doc comments.
These fields are added by API authors to comment the decl with information that
is not manifested clear enough through names. Code completion users' typing of the
keyword leads to the corresponding code completion results being selected as well.
Keywords can be arbitrarily long and can be multiple.

For instance, a function called "index()" has "@keyword find" in its doc comment.
Users' typing of "find" leads to "index()" being selected in the code completion list.
2015-11-05 15:36:55 -08:00
Argyrios Kyrtzidis
d19e4ae026 [SourceKit] Add license notices to all the source files. 2015-11-05 12:01:14 -08:00
Argyrios Kyrtzidis
8ff6a98a99 [sourcekit] Merge SourceKit into the Swift repo.
The code goes into its own sub-tree under 'tools' but tests go under 'test',
so that running 'check-swift' will also run all the SourceKit tests.

SourceKit is disabled on non-darwin platforms.
2015-11-05 01:09:08 -08:00