Commit Graph

243 Commits

Author SHA1 Message Date
Bob Wilson
548e7eaed4 master-next: Update to match LLVM r321411
The SymbolPropertySet subfield of the SymbolInfo struct was moved to the
end.
2017-12-28 14:19:38 -08:00
Slava Pestov
678f70bfb7 IDE: Remove a LValueAccessKind usage
Ok, so behind the scenes SourceEntityWalker is still using
Expr::getLValueAccessKind(). But now that SourceEntityWalker
is really the *only* remaining client, it makes sense to
refactor the calculation of this into a separate pass, which
only SourceKit needs to use.
2017-11-13 22:19:25 -08:00
Slava Pestov
0715eaeaed AST: Move SourceEntityWalker to IDE 2017-11-13 22:10:41 -08:00
Davide Italiano
87de4637fc [gardening] More unused variables/lambda captures. NFCI. 2017-10-31 10:35:24 -07:00
Slava Pestov
e32841d319 Index: Remove usages of getDeclaredTypeOfContext() 2017-09-19 22:12:29 -07:00
Xi Ge
21fd1f65bb [Index] Avoid mistaking nullptr to a meaningful parent identity. rdar://32861438 (#10864) 2017-07-10 18:08:39 -07:00
Nathan Hawes
6c128c2788 [index] Add missing parameter and return type references in subscript declarations
Resolves rdar://problem/32314185.
2017-06-22 23:29:51 -07:00
practicalswift
437a186032 [gardening] Remove redundant repetition of type names (DRY): RepeatedTypeName foo = dyn_cast<RepeatedTypeName>(bar) 2017-05-09 11:26:07 +02:00
practicalswift
492f5cd35a [gardening] Remove redundant repetition of type names (DRY): RepeatedTypeName foo = dyn_cast<RepeatedTypeName>(bar)
Replace `NameOfType foo = dyn_cast<NameOfType>(bar)` with DRY version `auto foo = dyn_cast<NameOfType>(bar)`.

The DRY auto version is by far the dominant form already used in the repo, so this PR merely brings the exceptional cases (redundant repetition form) in line with the dominant form (auto form).

See the [C++ Core Guidelines](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#es11-use-auto-to-avoid-redundant-repetition-of-type-names) for a general discussion on why to use `auto` to avoid redundant repetition of type names.
2017-05-05 09:45:53 +02:00
Nathan Hawes
9abeb0d97a [indexer] Don't index closure params. Resolves rdar://problem/31905371. 2017-05-01 23:28:36 -07:00
Argyrios Kyrtzidis
40c89048ba [index] Make sure that we index implicit constructors
These can be explicitely referenced so we should index their definitions as well
2017-04-29 19:14:03 -07:00
Nathan Hawes
4ff254de97 Move canDeclProvideDefaultImplementationFor() from libIDE into libIndex 2017-04-27 23:23:45 -07:00
Nathan Hawes
8ad6aa4e0d [migrator] Add pass for API type changes
This handles optionality changes and type rewrites in function param and return types and constructor param and failability types.
Resolves rdar://problem/31766010
2017-04-27 22:19:52 -07:00
practicalswift
ab5aaeb359 Merge pull request #9001 from practicalswift/gardening-20170425
[gardening] Unused variables. Unused diagnostics. Namespace comments. Typos.
2017-04-26 09:28:24 +02:00
Argyrios Kyrtzidis
79ef8ae77c [index] Index documentation comment tags
rdar://30569973
2017-04-25 12:16:25 -07:00
practicalswift
861f70e13d [gardening] Use consistent spacing 2017-04-25 21:03:43 +02:00
Nathan Hawes
0127469a27 Merge pull request #8889 from nathawes/rdar31665007-index-memberwise-init-arglabels-as-property-references
[indexer] Index the the arg labels of memberwise initializers as references to the properties they correspond to
2017-04-20 16:53:32 -07:00
Nathan Hawes
081500a4d0 [indexer] Index the the arg labels of memberwise initializers as references to the properties they correspond to
Resolves rdar://problem/31665007
2017-04-20 13:28:50 -07:00
Argyrios Kyrtzidis
e152d4ac1f [index] Mark indexed methods as 'dynamic' when appropriate
'dynamic' for indexing purposes means the method is overridable.
2017-04-19 11:48:52 -07:00
Argyrios Kyrtzidis
dc7373c05b [index] Improve handling of property accessors
- Report accessor function definitions for stored properties as well
- Fix issue where a call to a computed accessor was not reported if its parent was a statement
- Take into account if the stored property is member or not to adjust the symbol kind for the accessor
2017-04-17 22:25:08 -07:00
practicalswift
40cf4d183d [gardening] Use consistent spacing after if, for and while 2017-04-14 17:35:36 +02:00
Nathan Hawes
a57fd2a4b0 [indexer] Add an option to index local symbols too, and a new index::indexDeclContext() entry point
Resolves rdar://problem/31433002.
2017-04-12 09:04:03 -07:00
Xi Ge
936b4a25da Revert "Index: Expose the logic for deciding whether to index a symbol. NFC. (#8438)"
We currently don't need this logic elsewhere, thus it's good to give
indexer some privacy.
2017-04-01 10:39:36 -07:00
Xi Ge
9e6d584b60 Index: Expose the logic for deciding whether to index a symbol. NFC. (#8438) 2017-03-30 14:00:44 -07:00
Xi Ge
0ccbfdb933 Index: Record override-of relationship between a decl in protocol extension and the protocol requirements it can provide default implementations for. (#8418) 2017-03-29 19:39:39 -07:00
Xi Ge
1827fb1436 RangeInfo: Report RValue type if a decl reference is of read-only LValue type. (#8300) 2017-03-23 15:52:54 -07:00
Hugh Bellamy
7a704b2605 Fix MSVC control path warnings 2017-03-16 08:55:51 +07:00
Nathan Hawes
2c4bee9935 Merge pull request #8094 from nathawes/rdar31039915-index-local-params
[indexer] Index parameter definitions with a distinct external argument label too (but not their refs)
2017-03-14 17:44:25 -07:00
Nathan Hawes
7b75cf792c [indexer] Index parameter definitions with a distinct external argument label too (but not their refs)
Parameter defs with a separate external argument label are marked with the 'Local' symbol property.
This ensures the indexer has enough information for clients to match up a function's argument labels with its child parameter definitions.
Resolves rdar://problem/31039915.
2017-03-14 16:12:48 -07:00
Slava Pestov
162b2d252e AST: Include gardening to minimize dependencies on Expr.h
A lot of files transitively include Expr.h, because it was
included from SILInstruction.h, SILLocation.h and SILDeclRef.h.

However in reality most of these files don't do anything
with Exprs, especially not anything in IRGen or the SILOptimizer.

Now we're down to 171 files in the frontend which depend on
Expr.h, which is still a lot but much better than before.
2017-03-12 22:26:56 -07:00
Nathan Hawes
28719efd7a [indexer] Fix missing references to protocol properties
Only accessors uses were being reported previously. Resolves rdar://problem/30773201
2017-03-07 16:19:19 -08:00
Argyrios Kyrtzidis
2b9e102b75 [index] Move determination of SymbolProperty::UnitTest at index::getSymbolInfoForDecl()
Otherwise symbol info for relations of such methods does not contain this property.
2017-03-06 12:42:23 -08:00
Argyrios Kyrtzidis
c5456e38ed [index] Handle properly typealiases as inherited types
Report the typalias as reference and its underlying nominal type as an 'implicit' base relation.
2017-03-04 19:23:02 -08:00
Nathan Hawes
583f74017b [indexer] Add RelationContainedBy from references to their containing functions
Resolves rdar://problem/30765261
2017-02-28 16:55:18 -08:00
Nathan Hawes
2684564590 [indexer] report defs/refs of parameters without a separate external name 2017-02-28 11:55:34 -08:00
practicalswift
efb4183c8f [gardening] Remove unused variable NTD 2017-02-24 09:38:00 +01:00
Nathan Hawes
50113b74cf [indexer] Fix all function references being reported with the call role regardless of them actually being called or not 2017-02-22 13:37:32 -08:00
Argyrios Kyrtzidis
4b1d99fcc3 [index] Relate extension members with the extension symbol. 2017-02-19 20:10:33 -08:00
Argyrios Kyrtzidis
a13289835e [index] For extensions, relate the symbol reference that gets extended and base references with the extension symbol.
They were getting related with the original extended symbol, which was incorrect.
2017-02-19 18:19:39 -08:00
Argyrios Kyrtzidis
560bb99c02 [index] Provide distinct USRs for extension symbols
For indexing purposes we need to be able to treat extensions as distinct symbols.
rdar://30512293
2017-02-14 11:15:45 -08:00
Argyrios Kyrtzidis
459a5c604d [index] Make sure hasUsefulRoleInSystemModule() checks if 'any' of the listed SymbolRoles is present. 2017-02-06 08:48:02 -08:00
practicalswift
e2f8af7762 [gardening] Fix clang-tidy warnings 2017-02-04 09:23:10 +01:00
practicalswift
0193f2b872 [gardening] Fix typos 2017-02-04 09:22:38 +01:00
Xi Ge
6b699d8855 SourceEntityWalker: keep track of type reference in extension declarations' openings. (#7192)
This is necessary when we want to differentiate between type reference
on extension declaration's start, e.g "extension A {}", and other
references of "A". NFC on existing functionality.
2017-02-01 17:09:01 -08:00
Argyrios Kyrtzidis
9dc03b4442 [index] Avoid using getSatisfiedProtocolRequirements() when indexing the stdlib.
This is quite expensive and not worth the cost for indexing purposes of system modules.
2017-01-31 21:13:40 -08:00
Argyrios Kyrtzidis
a3919f5352 [index] Add testing for indexing a system overlay module, along with fine-grained control on the relations we want to index. 2017-01-31 11:14:21 -08:00
Nathan Hawes
e0ffbfb91b [indexer] Rename initCallRefIndexSymbol -> initFuncRefIndexSymbol as its now more general 2017-01-26 10:51:16 -08:00
Nathan Hawes
8ccccc6f74 [indexer] Fix crash in initVarRefIndexSymbols by handling func/var references in ImportDecls
IndexSwiftASTWalker::initVarRefIndexSymbols wasn't handling getCurrentExpr() returning a nullptr
as it does when processing a reference to someVar in the below import:
import var SomeModule.someVar

This patch fixes rdar://problem/30118572 and adds tests for import var/func references.
2017-01-26 09:15:42 -08:00
Argyrios Kyrtzidis
cfa1749836 [index] Report @IB and @GKInspectable properties in the index info. 2017-01-24 08:58:51 -08:00
Argyrios Kyrtzidis
703382701e [index] Mark unit test methods if the class subclasses XCTestCase.
This takes advantage of semantic checking during indexing so that it is more accurate.
2017-01-24 02:30:29 -08:00