Commit Graph

13930 Commits

Author SHA1 Message Date
Kuba (Brecka) Mracek
680d151963 Return back the '-report-errors-to-debugger' frontend flag to support custom toolchains from master in Xcode. (#12218) 2017-10-02 17:13:59 -07:00
Jordan Rose
31f97cf93c Use AnyObject instead of Builtin.UnknownObject
...for addressors and for dynamic self.
2017-10-02 09:05:35 -07:00
Jordan Rose
b6c28b02d0 [SIL] Remove the builtins related to UnknownObject.
No functionality change; nothing is using them.
2017-10-02 09:05:31 -07:00
swift-ci
57dd36698b Merge pull request #12171 from graydon/rdar-25802399-change-may-to-must 2017-09-29 18:06:03 -07:00
Graydon Hoare
e063767091 [Diagnostics] s/may/must/ in 'may not have operator requirements' 2017-09-29 16:09:23 -04:00
Graydon Hoare
81aecb6a54 [Diagnostics] s/may/must/ in 'may not be applied to' 2017-09-29 16:09:23 -04:00
Graydon Hoare
b0cc5c9113 [Diagnostics] s/may/must/ in 'may not have observers' 2017-09-29 16:09:23 -04:00
Graydon Hoare
6c64f86720 [Diagnostics] s/may/must/ in 'may not be used on an already-lazy global' 2017-09-29 16:09:23 -04:00
Graydon Hoare
84418a5155 [Diagnostics] s/may/must/ in 'may not be used on a computed property' 2017-09-29 16:09:23 -04:00
Graydon Hoare
3d8cc2f66a [Diagnostics] s/may/must/ in 'may not be used on subscript parameters' 2017-09-29 16:09:23 -04:00
Graydon Hoare
0539cc5836 [Diagnostics] s/may/must/ in 'may not be used on variadic parameters' 2017-09-29 16:09:23 -04:00
Graydon Hoare
131e85fbf1 [Diagnostics] s/may/must/ in 'may not contain stored properties' 2017-09-29 16:09:23 -04:00
Graydon Hoare
17aa7aa910 [Diagnostics] s/may/must/ in 'may not be declared mutating' 2017-09-29 16:09:23 -04:00
Graydon Hoare
867224dbde [Diagnostics] s/may/must/ in 'may not be declared both' 2017-09-29 16:09:23 -04:00
Graydon Hoare
5d7d1201d4 [Diagnostics] s/may/must/ in 'may not be indexed with' 2017-09-29 16:09:23 -04:00
Graydon Hoare
f4df23eefb [Diagnostics] s/may/must/ in 'may not be juxtaposed' 2017-09-29 16:09:23 -04:00
Graydon Hoare
367a1500a3 [Diagnostics] s/may/must/ in 'may not be named' 2017-09-29 16:09:23 -04:00
Graydon Hoare
bf42def404 [Diagnostics] s/may/must/ in 'may not have multiple' 2017-09-29 16:09:23 -04:00
Graydon Hoare
08bb212967 [Diagnostics] s/may/must/ in 'may not have bodies' 2017-09-29 16:09:23 -04:00
Graydon Hoare
c2ce848563 [Diagnostics] s/may/must/ in 'may not have a generic parameter list' 2017-09-29 16:09:23 -04:00
Graydon Hoare
0097adf4c0 [Diagnostics] s/may/must/ in 'may not also have a' 2017-09-29 16:09:23 -04:00
Graydon Hoare
3eed841f51 [Diagnostics] s/may/must/ in 'may not be assigned to' 2017-09-29 16:09:23 -04:00
Graydon Hoare
d8094e52b4 [Diagnostics] s/may/must/ in 'may not be passed inout' 2017-09-29 16:09:23 -04:00
Graydon Hoare
324471a2bc [Diagnostics] s/may/must/ in 'may not fall through' 2017-09-29 16:09:23 -04:00
Roman Levenstein
fb0761d97a Add predicates to check if a SILModule is representing the (optimized) OnoneSupport
It is cleaner to use these predicates rather than checking for a complex condition in different places.
2017-09-29 12:36:35 -07:00
Doug Gregor
d93bed5ed1 [GSB] Move a well-formed GenericSignatureBuilder to be the canonical builder.
Once we compute a generic signature from a generic signature builder,
all queries involving that generic signature will go through a separate
(canonicalized) builder, and the original builder can no longer be used.
The canonicalization process then creates a new, effectively identical
generic signature builder. How silly.

Once we’ve computed the signature of a generic signature builder, “register”
it with the ASTContext, allowing us to move the existing generic signature
builder into place as the canonical generic signature builder. The builder
requires minimal patching but is otherwise fully usable.

Thanks to Slava Pestov for the idea!
2017-09-28 16:19:08 -07:00
Doug Gregor
2f9c18639d [GSB] Kill off resolveArchetype().
This is somewhat of a pyrrhic victory, because it was just a shell over
resolvePotentialArchetype() anyway, but we now have fewer entry points that
produce potential archetypes.
2017-09-28 15:47:57 -07:00
Doug Gregor
9f580fe7ad [GSB] Move getTypeInContext() over to EquivalenceClass.
We shouldn’t need a potential archetype to map an interface type to a
contextual type. Port `getTypeInContext()` over to `EquivalenceClass`,
largely unchanged, so we don’t directly form archetypes.

Kills a few more uses of `GenericSignatureBuilder::resolveArchetype()`.
2017-09-28 15:47:57 -07:00
Doug Gregor
6374a17df9 [GSB] Introduce EquivalenceClass::getAnchor().
The anchor of an equivalence class canonically represents that equivalence
class. Add API for computing the anchor directly, and switch a few more
clients off of `resolveArchetype()`.
2017-09-28 15:47:57 -07:00
Doug Gregor
54864f858c [Type checker] Replace a use of GenericSignatureBuilder::resolveArchetype().
The type checker shouldn’t know about potential archetypes. Use
GenericSignatureBuilder::resolveEquivalenceClass() and perform the lookup
into that instead.

The test case change highlights an existing problem with generic signature
minimization.
2017-09-28 14:27:42 -07:00
Doug Gregor
f08a85ab11 [GSB] Cache the nested types of an equivalence class.
The GSB performs repeated lookups of the same nested type (by name) within
a given equivalence class. Cache the results of this lookup.
2017-09-28 14:27:16 -07:00
Doug Gregor
24780d9c95 [GSB] Inline getGenericSignature() into it’s only caller.
It’s small and straightforward. NFC
2017-09-28 14:27:15 -07:00
Doug Gregor
0a1583fb87 [GSB] Tighten up interfaces for computing a generic signature.
Funnel all places where we create a generic signature builder to compute
the generic signature through a single entry point in the GSB
(`computeGenericSignature()`), and make `finalize` and `getGenericSignature`
private so no new uses crop up.

Tighten up the signature of `computeGenericSignature()` so it only works on
GSB rvalues, and ensure that all clients consider the GSB dead after that
point by clearing out the internal representation of the GSB.
2017-09-28 14:27:15 -07:00
Doug Gregor
c9761fc821 [GSB] Simplify some interfaces. NFC 2017-09-28 14:27:14 -07:00
Doug Gregor
71deb0d928 [GSB] Centralize lookup of nested types.
We had two similar loops that performed name lookup for nested types on a
potential archetype, so consolidate those into a single implementation on
the equivalence class itself.
2017-09-28 14:27:14 -07:00
Doug Gregor
4df2958eea [GSB] Track equivalence classes in an intrusive linked list.
Managing equivalence classes via the implicit structure of potential
archetypes is silly, and leads to weird patterns where we visit all
potential archetypes just to find the equivalence classes. Teach the
GSB implementation to manage equivalence classes in a linked list, so we
can easily iterate over them, and switch most uses of
`visitPotentialArchetypes()` over to that iteration.
2017-09-28 14:27:09 -07:00
Kacper Harasim
1bec63d911 [IDE] Remove convenience function added to SourceEditConsumer 2017-09-28 10:21:00 -07:00
swift-ci
e801fa1185 Merge pull request #12142 from DougGregor/valgrind-appeasement 2017-09-27 11:46:32 -07:00
David Ungar
9f178f57e2 Merge pull request #12137 from davidungar/fixing-radar-34475709
Moves formerly statically-allocated RecursiveSharedTimer(s) effectively into ASTContext
2017-09-27 11:38:19 -07:00
Doug Gregor
3079b8441b [ASTWalker] Initialize fields of ASTWalker::ParentTy consistently.
Eliminates a use of uninitialized memory found by valgrind.
2017-09-27 10:53:21 -07:00
Doug Gregor
f6ad2a06d7 [GSB] Initialize FloatingPointSource's "as written" field consistently.
Eliminates a use of uninitialized memory.
2017-09-27 10:37:36 -07:00
Jordan Rose
ec5c145835 Merge pull request #11465 from KingOfBrian/bugfix/SR-964
Warn if the getter is used, but the setter argument is not used
2017-09-27 10:11:05 -07:00
Marcelo Fabri
95383df793 [SourceKit] Introduce "source.lang.swift.expr.tuple" (SR-5977) (#12089) 2017-09-27 10:08:27 -07:00
Doug Gregor
98e88bc015 Merge pull request #12135 from DougGregor/sr-5753
SR-5753: Don't warn about constraints redundant with inferred constraints
2017-09-27 09:03:50 -07:00
Joe Shajrawi
cc5fe6deee Merge pull request #12006 from shajrawi/pgo_2
Initial PGO Support
2017-09-27 00:35:15 -07:00
Joe Shajrawi
065d1917c3 if 'count' happens to be UINT64_MAX - set it to UINT64_MAX - 1. 2017-09-26 18:55:22 -07:00
David Ungar
443ab7d950 git-clang-format 2017-09-26 18:02:35 -07:00
David Ungar
7759d3cdda Clean up 2017-09-26 18:00:42 -07:00
Brian King
a5a6684fce Improve diagnostic language 2017-09-26 20:47:09 -04:00
David Ungar
90b456b116 Use if (auto for getting Stats 2017-09-26 17:32:38 -07:00