Commit Graph

175 Commits

Author SHA1 Message Date
David Ungar
7992e1c6c4 Lots of cleanups, renamings, etc. 2019-08-26 16:55:18 -07:00
Slava Pestov
d13353f43a AST: Split off ModuleNameLookup.h from NameLookup.h 2019-08-23 23:35:25 -04:00
Slava Pestov
80ccbe5116 AST: Stop passing around a LazyResolver in name lookup
Note that in all cases it was either nullptr or ctx.getLazyResolver().
While passing in nullptr might appear at first glance to mean something
("don't type check anything"), in practice we would check for a nullptr
value and pull out ctx.getLazyResolver() instead. Furthermore, with
the lazy resolver going away (at least for resolveDeclSignature() calls),
it won't make sense to do that anymore anyway.
2019-08-19 23:00:57 -04:00
Slava Pestov
94c5a35bf2 AST: Add some counters related to name lookup 2019-08-19 23:00:57 -04:00
Rintaro Ishizaki
0555d30b8c Merge pull request #26546 from rintaro/ide-completion-rdar53034550
[AST] Be lenient with PatternBindingIntializer without PatBindingDecl
2019-08-13 21:21:37 +02:00
Rintaro Ishizaki
428bbe1060 [AST] Be lenient with PatternBindingIntializer without PatBindingDecl
PatternBindingInitializer may not be attached to any
PatternBindingDecl. e.g.

  struct S {
    @CustomAttr(something)
  }

In this case DeclContext for 'something' is PatternBindingInitializer,
but it doesn't have PatternBindingDecl because it's not written yet.

Fixes a crash in code-completion.

rdar://problem/53034550
2019-08-08 10:48:47 -07:00
David Ungar
3a2d284d5d Merge pull request #26535 from davidungar/A-7-9-astscope-no-nesting-off
[NameLookup ASTScope] Latest experimental ASTScope code, off by default.
2019-08-07 19:02:09 -07:00
David Ungar
5b1726e99a ASTScope off by default 2019-08-07 11:59:44 -07:00
David Ungar
09342dfa47 Add frontend flag -warn-if-astscope-lookup w/ test 2019-08-06 23:17:49 -07:00
David Ungar
f64033a2d2 Manual rebase with master 2019-08-06 22:13:20 -07:00
David Ungar
3a3145c0f4 Alternate SelfDC computation, fixes, and cleanups.
ASTScopeLookup by default
Create empty fn bodies for IDE tests.
Include initializer source range for property wrappers.
Add -disable-astscope-lookup
2019-06-23 09:17:09 -07:00
David Ungar
aac3a3d2ae Add a test & don’t look for a module with a special name. 2019-06-20 11:19:12 -07:00
David Ungar
375e21232f Don’t lookupOverrides of special names. 2019-06-18 15:01:14 -07:00
David Ungar
69f6b41a13 Use unique_ptr for Scope, getScope returns a reference 2019-06-12 07:29:00 -07:00
David Ungar
2e9f6c0f15 Formats and fixes 2019-06-08 11:51:35 -07:00
David Ungar
13d3c009be Fixes to build release version. 2019-06-05 17:18:05 -07:00
David Ungar
f36648463a rm finishExpansion 2019-06-05 12:15:01 -07:00
David Ungar
15cc98cc14 WIP HERE 2019-06-04 21:52:57 -07:00
David Ungar
606ce7b8cb pattern fixes 2019-06-04 20:50:59 -07:00
David Ungar
94bd4a801a fmt 2019-06-04 18:11:35 -07:00
David Ungar
bae074e2ef More gross hackery for top-level 2019-06-04 18:10:59 -07:00
David Ungar
8ff4309580 WIP, unfmt 2019-06-04 17:14:32 -07:00
David Ungar
5c3bea52b1 Fixes 2019-06-04 11:01:41 -07:00
David Ungar
ad77af1b87 Catch top-level dependency for use under pattern.
var x = 3
_ = x
2019-06-03 21:13:25 -07:00
David Ungar
29f0204cdb WIP 2019-06-03 19:56:21 -07:00
David Ungar
665a282995 Temp debug change 2019-06-02 18:14:54 -07:00
David Ungar
5b2bf1268f Fix debug code. 2019-06-02 18:13:50 -07:00
David Ungar
e48ea31ce7 NDEBUG typo fix 2019-06-02 18:12:47 -07:00
David Ungar
8814390225 ifndef NDEBUG nify 2019-05-28 14:40:10 -07:00
David Ungar
3f820c374e Some review tweaks. 2019-05-28 11:12:12 -07:00
David Ungar
663760e3b7 ASTOOScope ontology 2019-05-28 10:48:22 -07:00
Slava Pestov
df633ffcbf AST: Fix shouldLookupMembers() for invalid extensions and nominals
If there are no braces, the start and end location of the range is
the same token. When performing a lookup at this token's location,
don't consider it to be "inside" the braces.

NFC for now, but this problem causes some tests to fail once we
enable cycle diagnostics.
2019-04-22 21:51:42 -04:00
Jordan Rose
0ba6c495ba Add @_implementationOnly
This is an attribute that gets put on an import in library FooKit to
keep it from being a requirement to import FooKit. It's not checked at
all, meaning that in this form it is up to the author of FooKit to
make sure nothing in its API or ABI depends on the implementation-only
dependency. There's also no debugging support here (debugging FooKit
/should/ import the implementation-only dependency if it's present).

The goal is to get to a point where it /can/ be checked, i.e. FooKit
developers are prevented from writing code that would rely on FooKit's
implementation-only dependency being present when compiling clients of
FooKit. But right now it's not.

rdar://problem/48985979
2019-03-28 15:57:53 -07:00
Jordan Rose
9ed3fe061d Change ModuleDecl::getImportedModules to take an option set
...in preparation for me adding a third kind of import, making the
existing "All" kind a problem. NFC, except that I did rewrite the
ClangModuleUnit implementation of getImportedModules to be simpler!
2019-03-28 14:44:41 -07:00
David Ungar
7b099c5906 Remove legacy cross-check. 2019-03-02 08:44:46 -08:00
David Ungar
937600cd9f Fix typo 2019-03-01 09:15:02 -08:00
David Ungar
82a842fd23 Rename addPrivateImports 2019-02-28 14:29:34 -08:00
David Ungar
543c826004 Rename ResultFinderForSelfsConformances 2019-02-28 14:25:54 -08:00
David Ungar
85d6012242 Renamed “DCAnd” to “ContextAnd” 2019-02-28 12:39:11 -08:00
David Ungar
8f67ef602d Add comment and renamed lookUpTopLevelNames… 2019-02-27 17:44:21 -08:00
David Ungar
d5983dab73 Minor prettying. 2019-02-27 17:20:12 -08:00
David Ungar
3c32a41425 Introduce runIfNotDoneYet 2019-02-27 10:15:14 -08:00
David Ungar
81c0299c1c Incorperate Doug’s comments & factor a bit more. 2019-02-26 23:35:22 -08:00
David Ungar
1f914fbe58 Pull out top-level recording. 2019-02-24 23:52:28 -07:00
David Ungar
ee6acae3c1 Remove bool returns 2019-02-24 23:34:50 -07:00
David Ungar
7c003aae8a Simply retuirn of put asside 2019-02-24 22:59:44 -07:00
David Ungar
66a9cace32 void return from addGeneric… 2019-02-24 22:54:39 -07:00
David Ungar
3641e35721 Pass individual arguments. 2019-02-24 22:38:37 -07:00
David Ungar
0a817a9ba6 Pass flag for addGenericParameters 2019-02-24 21:59:16 -07:00
David Ungar
bd5bff6516 Renaming 2019-02-24 16:45:34 -07:00