Slava Pestov
9516575d1c
ASTDemangler: Simplify createBoundGenericType()
...
It's clever how it leverages the type checker to check generic arguments,
but calling checkGenericArguments() would have been simpler, and it doesn't
work for interface types anyway, so we would fail to demangle those.
Let's just cut this all out for now and build a BoundGenericType directly.
2019-01-25 21:44:02 -05:00
Slava Pestov
bbe6a56e22
ASTDemangler: Implement builtin types
2019-01-25 21:44:02 -05:00
Slava Pestov
2d21233378
ASTDemangler: Implement unresolved DependentMemberType
...
The debug mangling emits these when the type parameter only
conforms to one protocol having an associated type with this
name.
2019-01-25 21:44:02 -05:00
Doug Gregor
0181ea586d
Merge pull request #22118 from DougGregor/remote-ast-private-types
...
[RemoteAST] Improve resolution of private types from metadata
2019-01-25 15:21:00 -08:00
David Ungar
ff011bb35b
Add a comment and also emit dependencies even if compilation error.
2019-01-24 22:39:28 -08:00
David Ungar
91b3780e03
Fix include order to minimize diffs.
2019-01-24 19:06:09 -08:00
David Ungar
a7e9a4f8c7
Fixes
2019-01-24 18:47:50 -08:00
David Ungar
7c48f151d4
Brought over latest default type request
2019-01-24 18:46:49 -08:00
David Ungar
b520b242dc
Collapsed lots of changes.
2019-01-24 18:46:49 -08:00
Pavel Yaskevich
fe9376dd78
Merge pull request #22082 from xedin/move-weights-to-cs
...
[ConstraintSystem] Track AST depth information directly
2019-01-24 11:53:17 -08:00
Pavel Yaskevich
4342de969c
Merge pull request #22084 from dingobye/sr9732
...
[Sema] Improve diagnostics for `variable_never_mutated` in case of for-each loop's binding.
2019-01-24 10:04:56 -08:00
Ding Ye
421d6b065a
[Sema] Improve diagnostics for variable_never_mutated in case of for-each loop's binding.
...
The diagnostics for `variable_never_mutated` always suggests
changing `var` to `let`, which is misleading in case of
for-each loops where explicitly immutable context applies.
This patch adds some variety to the message to make it appropriate.
Resolves: SR-9732
2019-01-24 16:54:57 +11:00
Karoy Lorentey
df8eba480e
[Sema] Add dedicated fix-it for NSObject.hashValue overrides
...
NSObject.hashValue used to be declared `@objc open` by historical accident. This has been corrected to `@nonobjc public` in Swift 5’s SDK overlays, to catch accidental overrides. (These never did work correctly, and shouldn’t have been allowed.)
Help migration by adding a dedicated error message for NSObject.hashValue overrides, with a nice fix-it.
rdar://problem/45674813
2019-01-23 19:43:04 -08:00
Pavel Yaskevich
49c40d92f6
[AST] Augment getDepthMap with information about parent expressions
...
Which is very useful for the solver because otherwise it'd have to
compute and store this information twice.
2019-01-23 18:21:07 -08:00
Rintaro Ishizaki
16d97b2c5c
Merge pull request #22055 from rintaro/ide-contextinfo-suppliment
...
[SourceKit][IDE] Update for feedback
2019-01-23 17:24:20 -08:00
David Ungar
b7f3697387
Merge pull request #21907 from davidungar/A-defaultTypeReq-1-15-10
...
Use Request to getDefaultType & move cache to SourceFile.
2019-01-22 21:39:31 -08:00
David Ungar
66503ea978
Fix test typo & remove too-strict assertion.
2019-01-22 18:59:22 -08:00
Rintaro Ishizaki
32ebfa4761
[AST] Comment tweak
2019-01-22 15:38:13 -08:00
Doug Gregor
0c88b88322
[ABI] Optionally emit mangled names into anonymous context metadata.
...
When -enable-anonymous-context-mangled-names is provided, emit mangled
names as part of the metadata of an anonymous context. This will allow
us to match textual mangled names to the metadata.
This is a backward-compatible ABI extension. Part of rdar://problem/38231646/.
2019-01-22 09:48:47 -08:00
David Ungar
ec1797659e
Cosmetics.
2019-01-20 23:38:47 -08:00
David Ungar
e7882170a7
Use array for the cache.
2019-01-20 23:30:03 -08:00
David Ungar
babbfe0288
Another stray \n.
2019-01-20 23:29:17 -08:00
David Ungar
179166c623
Since cache is keyed by SourceFile, only need to check if dependency is missing.
2019-01-20 23:01:36 -08:00
David Ungar
fe999d9a47
Format.
2019-01-20 22:47:40 -08:00
David Ungar
4ca97abaff
Key cache by SourceFile.
2019-01-20 22:46:47 -08:00
David Ungar
ce17240781
Don’t output newline for simple_display of DeclContext. And clean up simple_display.
2019-01-20 22:46:13 -08:00
David Ungar
f1d74fe7ef
Record dependency for cached results.
2019-01-20 21:58:26 -08:00
David Ungar
3573eb4f7c
Don’t print enclosing contexts for simple_display.
2019-01-20 18:54:58 -08:00
David Ungar
5827ffae45
Format
2019-01-20 16:34:48 -08:00
David Ungar
51bb354328
Move cache to ASTContext
2019-01-20 16:34:18 -08:00
David Ungar
b3d4ca6ee0
FIx SFINAE
2019-01-20 14:11:46 -08:00
David Ungar
4dbf4c323f
Bug fix.
2019-01-19 22:02:59 -08:00
David Ungar
06356e64c9
Fixes.
2019-01-19 17:03:54 -08:00
David Ungar
15c5942077
Minor improvement
2019-01-18 17:09:16 -08:00
David Ungar
cb340af0f2
Format
2019-01-18 16:39:19 -08:00
David Ungar
d1fe7ca9a9
First cut at removing DeclContextWrapper
2019-01-18 16:38:46 -08:00
Robin Kunde
09f1bf8a40
[Diagnostics] Diagnose unresolved and typoed labels when using labeled break or continue statements inside loops ( #21915 )
...
Adds proper diagnostics when using unresolved labels on break statements inside loops. In case of simple typos, also provides suggestions and fixits. Right now, the misleading "error: 'break' is only allowed inside a loop, if, do, or switch" is emitted in 4.2 and master.
Resolves SR-9677.
2019-01-18 15:06:59 -08:00
Slava Pestov
d95861b399
Merge pull request #21967 from slavapestov/cache-inherited-protocols
...
AST: Cache ProtocolDecl::getInheritedProtocols()
2019-01-18 18:05:52 -05:00
Robert Widmann
d7a406dbc2
Merge pull request #20950 from CodaFi/christmas-declarations
...
[NFC] Upgrade EnumElementDecl to a DeclContext
2019-01-18 17:25:22 -05:00
David Ungar
12e7501561
Format
2019-01-18 14:19:29 -08:00
David Ungar
681fda399e
Eliminate const char*
2019-01-18 14:18:10 -08:00
Slava Pestov
eef3efbe42
AST: Cache ProtocolDecl::getInheritedProtocols()
...
Fixes <rdar://problem/47371754>.
2019-01-18 15:36:27 -05:00
David Ungar
584c157796
WIP move info to KnownProtocols.def, unformatted
2019-01-17 11:15:58 -08:00
Robert Widmann
c5b7230d22
[NFC] Upgrade EnumElementDecl to a DeclContext
...
Pure plumbing for the sake of default arguments.
2019-01-16 18:39:30 -05:00
John McCall
ac9dfe1a1e
Add a utility to substitute generic arguments into a canonical
...
generic function type.
2019-01-16 16:43:48 -05:00
David Ungar
cf3034bd26
Use Request to getDefaultType & move cache to SourceFile.
2019-01-15 23:18:44 -08:00
Slava Pestov
a8d1910552
AST: Cache SuperclassDeclRequest
...
This fixes a significant build time regression since 4.2.
Fixes <rdar://problem/47305605>.
2019-01-15 23:24:36 -05:00
Pavel Yaskevich
69c622fc06
Merge pull request #21783 from xedin/rdar-30933988
...
[AST] `Decl::is*AccessibleFrom` methods should respect access control…
2019-01-14 14:06:44 -08:00
Rintaro Ishizaki
b446d6b051
Merge pull request #21377 from rintaro/ide-contextinfo
...
[SourceKit][IDE] New SourceKit request to retrieve context type information
2019-01-15 01:54:16 +09:00
Pavel Yaskevich
ddc2fa415e
[AST] NFC: introduce ASTContext::isAccessControlDisabled
2019-01-11 17:30:10 -08:00