Commit Graph

3719 Commits

Author SHA1 Message Date
Doug Gregor
503d9ce1f5 [SIL] Store SubstitutionMaps in MarkUninitializedBehaviorInst. 2018-05-03 15:40:10 -07:00
Doug Gregor
f911ef7c8f [SIL cloner] Canonicalize substituted substitution maps.
Fixes the recent source compatibility failures in ReactiveCocoa and
ReactiveSwift, rdar://problem/39949332.
2018-05-03 14:11:17 -07:00
swift-ci
5f22c9ceec Merge remote-tracking branch 'origin/master' into master-next 2018-05-03 13:49:29 -07:00
Doug Gregor
ae9d0f6f18 [SIL] Store SubstitutionMaps in all of the "apply"-like instructions.
Replace the tail-allocated Substitution arrays with a SubstitutionMap.
This only affects the internal representation of the instructions, not their
constructors or serialization.
2018-05-03 12:57:12 -07:00
Doug Gregor
4136a1897a [AST] Split SubstitutionMap::Storage into its own header.
Now that SubstitutionMap is used in so many places, reduce it's header
dependencies by moving SubstitutionMap::Storage into its own separate
implementation header. Use forward declarations of other entities
(GenericSignature, Substitution) instead.

Good for build times and general sanity.
2018-05-03 09:49:09 -07:00
Doug Gregor
b1f338a00b [SIL Opt] Switch GenericSpecializationInformation over to SubstitutionMap.
There isn't a clean cut point here, so switch
GenericSpecializationInformation from SubstitutionList to
SubstitutionMap and carry along dual SubstitutionMap/SubstitutionList
representations for a small part of ReabstractionInfo.
2018-05-03 09:27:21 -07:00
swift-ci
5ce78da1d3 Merge remote-tracking branch 'origin/master' into master-next 2018-05-03 08:49:46 -07:00
Doug Gregor
408aaa5332 [SIL] Use SubstitutionMap in BuiltinInst. 2018-05-03 08:48:55 -07:00
Doug Gregor
d5c9f71a6d [SIL] Switch InitBlockStorageHeaderInst over to SubstitutionMap. 2018-05-03 08:48:54 -07:00
Doug Gregor
7e08b66499 [SIL] Use SubstitutionMap in KeyPathInst rather than SubstitutionList. 2018-05-03 08:48:54 -07:00
Doug Gregor
5724338abe [SIL] Switch "external" key path pattern components to SubstitutionMap.
Eliminates another source of SubstitutionList.
2018-05-03 08:48:54 -07:00
Doug Gregor
d2cf60c465 Revert "[SIL] Replace more SubstitutionLists with SubstitutionMap" 2018-05-03 08:35:20 -07:00
swift-ci
32853a9ed1 Merge remote-tracking branch 'origin/master' into master-next 2018-05-03 01:29:45 -07:00
swift-ci
2ea33a93e9 Merge remote-tracking branch 'origin/master' into master-next 2018-05-03 00:09:35 -07:00
Doug Gregor
ed1983d9d0 [SIL] Use SubstitutionMap in BuiltinInst. 2018-05-03 00:05:21 -07:00
Doug Gregor
216906cf59 [SIL] Switch InitBlockStorageHeaderInst over to SubstitutionMap. 2018-05-03 00:05:21 -07:00
Doug Gregor
a6dfe0ff88 [SIL] Use SubstitutionMap in KeyPathInst rather than SubstitutionList. 2018-05-03 00:05:21 -07:00
Doug Gregor
25b9afe20f [SIL] Switch "external" key path pattern components to SubstitutionMap.
Eliminates another source of SubstitutionList.
2018-05-03 00:05:21 -07:00
Doug Gregor
9c5a222b95 Merge pull request #16291 from DougGregor/ast-use-substitution-map
[AST] Store SubstitutionMaps in the AST rather than Substitution lists.
2018-05-02 23:52:18 -07:00
swift-ci
c6b2f566ba Merge remote-tracking branch 'origin/master' into master-next 2018-05-02 15:29:28 -07:00
Doug Gregor
192234415d [AST] Store SubstitutionMaps in ConcreteDeclRef and Witness data structures.
Replace two prominent uses of SubstitutionList, in ConcreteDeclRef and
Witness, with SubstitutionMap. Deal with the myriad places where we
now have substitution maps and need substitution lists (or vice versa)
caused by this change.

Overall, removes ~50 explicit uses of SubstitutionList (of ~400).
2018-05-02 13:38:14 -07:00
Saleem Abdulrasool
4d30cd39b4 SIL: explicitly mark overloads as friends (NFC)
The class contains two inline operator overloads which are marked as
friends.  These overloads actually will be promoted to a global
function.  MSVC will not mark them as friends resulting in access to the
members being lost.  Explicitly mark the overloads as friends.  This is
needed by LLDB.
2018-05-02 10:51:01 -07:00
Saleem Abdulrasool
311fe2a2f4 SIL: rename template parameter (NFC)
Rename `Base` to `InstBase`.  This is needed to help MSVC disambiguate
the typename from the enumerator member in certain specializations.  The
SILInstruction is used in LLDB and when building with MSVC would fail
due to an ambiguous resolution.
2018-05-02 10:48:52 -07:00
swift-ci
bc792f22af Merge remote-tracking branch 'origin/master' into master-next 2018-05-02 10:28:58 -07:00
swift-ci
9d3b6be3fc Merge pull request #16003 from atrick/access-analysis 2018-05-02 10:22:26 -07:00
swift-ci
49b2c7fe2a Merge remote-tracking branch 'origin/master' into master-next 2018-05-01 12:08:52 -07:00
Arnold Schwaighofer
1f65ee25f6 Distinguish between withoutActuallyEscaping and passing @noescape
Objective C closures when reporting that a closure has escaped

rdar://39682865
2018-05-01 07:24:19 -07:00
Arnold Schwaighofer
c4ed564a46 Fixes to AccessSummaryAnalysis
The pattern we see for noescape closure passed to objective c is different:
There is the additional without actually escaping closure sentinel.

rdar://39682865
2018-05-01 07:24:19 -07:00
Arnold Schwaighofer
15e26c9640 Fix DiagnoseStaticExclusivity
After the copy_block_without_actually_escaping change it might see a
mark_dependence instruction on a noescape closure.

rdar://39682865
2018-05-01 07:24:19 -07:00
Arnold Schwaighofer
4525722395 SIL: Add getSingleDealloc to AllocStack and remove two copies of it
I am going to introduce a third use in a follow-up
2018-05-01 07:24:19 -07:00
Arnold Schwaighofer
678a99e76a Add a copy_block_without_escaping %block withoutEscaping %closure instruction
Mandatory pass will clean it up and replace it by a copy_block and
is_escaping/cond_fail/release combination on the %closure in follow-up
patches.

The instruction marks the dependence of a block on a closure that is
used as an 'withoutActuallyEscaping' sentinel.

rdar://39682865
2018-05-01 07:24:19 -07:00
swift-ci
c12d46675a Merge remote-tracking branch 'origin/master' into master-next 2018-04-30 17:49:07 -07:00
Huon Wilson
1283b54678 Merge pull request #16251 from huonw/no-std-function
std::function -> llvm::function_ref for some non-escaping params.
2018-05-01 10:30:16 +10:00
swift-ci
13ab622cba Merge remote-tracking branch 'origin/master' into master-next 2018-04-30 17:09:26 -07:00
Huon Wilson
08ccf0499d [SIL] std::function -> llvm::function_ref for some non-escaping params. 2018-05-01 08:29:07 +10:00
David Zarzycki
95473a10d7 [Misc] NFC: Fix random build warnings
Unused variables/methods, language extensions, extra semicolons, intentional
self assignment, platform specific quirks, etc.
2018-04-30 12:52:43 -04:00
swift-ci
b87673dc82 Merge remote-tracking branch 'origin/master' into master-next 2018-04-27 00:29:08 -07:00
Slava Pestov
175b40919f AST: Fewer headers include Expr.h, Module.h, Stmt.h 2018-04-26 22:55:26 -07:00
swift-ci
2befd1681d Merge remote-tracking branch 'origin/master' into master-next 2018-04-26 10:49:13 -07:00
Bob Wilson
9dc02e67a2 master-next: Stop using ilist_default_traits
LLVM r330736 removed ilist_default_traits. Apparently it is not needed
and ilist_node_traits works just as well.
2018-04-25 22:44:58 -07:00
Andrew Trick
33ca063bc5 Improve -enable-verify-exclusivity.
Cleanup the memory access utilities to for more robust detection of local
initialization patterns that don't use access markers.
2018-04-25 22:40:21 -07:00
swift-ci
dcba36c4fe Merge remote-tracking branch 'origin/master' into master-next 2018-04-20 14:09:35 -07:00
Slava Pestov
1602580303 SIL: Sort vtable entries for synthesized methods
Completes the fix for <rdar://problem/35647420> and
<https://bugs.swift.org/browse/SR-6468>.
2018-04-20 12:36:02 -07:00
swift-ci
ba8d46eae5 Merge remote-tracking branch 'origin/master' into master-next 2018-04-19 08:29:46 -07:00
Andrew Trick
ef21916ff7 Add ApplyInstBase::getCalleeOrigin helper.
Centralize the logic for finding a callee while ignoring conversions. We already
use getCalleeFunction() in many places, but sometimes you want to know if the
callee is a partial_apply.

This may be a functional change because the existing getCalleeFunction() helper
now uses the new helper, which also looks through ConvertEscapeToNoescape.
2018-04-18 22:32:59 -07:00
Andrew Trick
b66fa09c29 Add AccessedStorageAnalysis.
An interprocedural analysis pass that summarizes the dynamically
enforced formal accesses within a function. These summaries will be
used by a new AccessEnforcementOpts pass to locally fold access scopes
and remove dynamic checks based on whole module analysis.
2018-04-17 17:35:39 -07:00
swift-ci
a1b34f4b95 Merge remote-tracking branch 'origin/master' into master-next 2018-04-17 16:09:36 -07:00
Slava Pestov
a3ab7561c5 SIL: Move LinkingMode to SILModule 2018-04-17 15:13:35 -07:00
swift-ci
b95dd21966 Merge remote-tracking branch 'origin/master' into master-next 2018-04-17 06:29:07 -07:00
Arnold Schwaighofer
7b472f983e Merge pull request #15927 from aschwaighofer/remove_postponed_cleanup
Remove SILGen's PostponedCleanup
2018-04-17 06:19:29 -07:00