Commit Graph

3 Commits

Author SHA1 Message Date
Nate Chandler
648cede13b [Diagnostics] Allow multiple non-custom _effects.
Adjust `SILFunctionBuilder` to allow distinct non-custom effects and to
interpret such "conflicting" guarantees to provide the strongest
guarantee. For example, annotating a function both `@_effects(readnone)`
and `@_effects(releasenone)` is equivalent to only annotating it
`@_effects(readnone)`.

First step to reapplying https://github.com/apple/swift/pull/68285 .

rdar://118216287
2023-11-09 21:39:43 -08:00
nate-chandler
a9e03df58c Revert "[Diagnostics] Require explicit releasenone." 2023-10-04 14:19:15 -07:00
Nate Chandler
2ca262c03a [SIL] Require explicit releasenone.
Functions which which consume their arguments will release them on any
branches where the arguments are unused.  Users of `@_effects(readnone)`
and `@_effects(readonly)` may not consider this when annotating their
functions.  Require that functions annotated thus are also annotated
@_effects(releasenone).

In order to support this, adjust SILFunctionBuilder to allow distinct
non-custom effects and to interpret such "conflicting" guarantees to
provide the strongest guarantee.  For example, annotating a function
both `@_effects(readnone)` and `@_effects(releasenone)` is equivalent to
only annotating it `@_effects(readnone)`.
2023-09-05 08:18:06 -07:00