Commit Graph

12 Commits

Author SHA1 Message Date
Ben Langmuir
4082355244 Split KnownProtocolKind enum case from protocol name
This avoids us using reserved identifiers as the enum case names of all
our underscored protocols like _ObjectiveCBridgeable. I used the
convention PROTOCOL_WITH_NAME to mirror how the known identifiers work.

Swift SVN r32924
2015-10-27 23:10:36 +00:00
Erik Eckstein
b468f9f339 Add a way that SILAnalysis can retrieve (and store) other analysis which they depend on.
So far this was done by directly calling PM->getAnalysis() in create*Analysis().
But this required a correct order of analysis definitions in Analysis.def.



Swift SVN r31941
2015-09-14 22:34:36 +00:00
Michael Gottesman
0276d86694 Add Analysis.def to allow for metaprogramming with Analysis names.
This allows one by editing one place to create an Analysis kind and ensure that
your analysis is properly registered in all of the relevant places for use with
swift/sil-opt.

If we add tools like a sil bugpoint, this will make it easy to add analysis
without having to know about all of these locations.

It also standardizes the create***Analysis API to take a SILModule and a
SILPassManager. All passes take in a SILModule and some take in a
SILPassManager. By standardizing the API and in the cases where SILPassManager
is not used, just making it a dead argument enables metaprogramming.

Swift SVN r31420
2015-08-23 19:31:27 +00:00
Chris Lattner
79ed57f9f2 standardize naming of tuples and tuple patterns on "elements".
Previously some parts of the compiler referred to them as "fields",
and most referred to them as "elements".  Use the more generic 'elements'
nomenclature because that's what we refer to other things in the compiler
(e.g. the elements of a bracestmt).

At the same time, make the API better by providing "getElement" consistently
and using it, instead of getElements()[i].

NFC.



Swift SVN r26894
2015-04-02 20:23:49 +00:00
Doug Gregor
38cc1fe5c6 Remove LazyResolver arguments from API entry points to the conformance lookup table.
Swift SVN r26838
2015-04-02 00:06:01 +00:00
Doug Gregor
7708c5a65e Start moving away from (Nominal)?TypeDecl::getProtocols().
Instead, use other entry points, particularly those that use the conformance lookup table.

Swift SVN r26412
2015-03-22 12:35:21 +00:00
Arnold Schwaighofer
752c402dc2 DestructorAnalysis: Fix a spelling error
NFC.

Swift SVN r26081
2015-03-13 02:01:35 +00:00
Arnold Schwaighofer
a68f488e99 Revert "DestructorAnalysis: Don't rely on stable cannonical type pointers"
This reverts commit r26049.

Canonical types really should to be stable across the lifetime of one module.

Swift SVN r26080
2015-03-13 02:01:35 +00:00
Arnold Schwaighofer
07ef1bb68a DestructorAnalysis: Don't rely on stable cannonical type pointers
This should be NFC. Pointers to cannonical types should be stable accross
processing of a module.

Swift SVN r26049
2015-03-12 17:43:44 +00:00
Arnold Schwaighofer
165bfb6f95 DestructorAnalysis: Fix for recursive types
We can't just recursively process types without caching. Instead mark a type as
safe before we recurse and reset this assumption if we proved otherwise on the
recursive traversal.

rdar://20132313

Swift SVN r26048
2015-03-12 17:14:25 +00:00
Doug Gregor
09021d97ce Add a detailed AST dumper for types.
... because pretty-printed types are useless for debugging.

Swift SVN r25422
2015-02-20 06:22:46 +00:00
Arnold Schwaighofer
06a0a23562 Add a destructor memory effect analysis
This adds an analysis to the compiler that identifies types that are may store
to memory on destruction.

It adds a compiler known protocol _DestructorSafeContainer that allows the
standard library to identify containers whose destructor's memory effects
depends strictly on the type parameters of the container.

Array<T> : _DestructorSafeContainer {} may not store to memory during
destruction if the bound T is a type that does not store to memory on
destruction.

This is needed to deduce that for example Array<Array<Int>> is does not store to
memory on destruction (e.g during a call to release).

rdar://18940376

Swift SVN r23242
2014-11-11 19:27:41 +00:00