Commit Graph

8 Commits

Author SHA1 Message Date
Erik Eckstein
7cceaff5f3 SIL: don't print operand types in textual SIL
Type annotations for instruction operands are omitted, e.g.

```
  %3 = struct $S(%1, %2)
```

Operand types are redundant anyway and were only used for sanity checking in the SIL parser.

But: operand types _are_ printed if the definition of the operand value was not printed yet.
This happens:

* if the block with the definition appears after the block where the operand's instruction is located

* if a block or instruction is printed in isolation, e.g. in a debugger

The old behavior can be restored with `-Xllvm -sil-print-types`.
This option is added to many existing test files which check for operand types in their check-lines.
2024-11-21 18:49:52 +01:00
Pavel Yaskevich
ab54ea71fa [SILGen] InitAccessors: Prevent setter closure from escaping
The closure with applied base is not escaping and gets applied
only once (when self is fully initialized). Let's make sure that
the partial application results in on-stack closure that borrows
"self" instead of copying it.
2023-09-29 11:44:02 -07:00
Pavel Yaskevich
e0bf2ff854 [SIL/DI] NFC: Remove TypeWrappers feature functionality 2023-02-08 10:14:29 -08:00
Pavel Yaskevich
df87a494c2 [SIL] Add originator to assign_by_wrapper instruction
Originator of this temporary instruction could be either
type or property wrapper.
2022-09-29 20:50:36 -07:00
Holly Borla
0842b42127 [SILGen] Only use assign_by_wrapper for wrapped instance properties inside an
initializer, and for wrapped local variables.
2020-09-28 16:57:35 -07:00
Joe Groff
3d377fb1fc Update resilient_assign_by_wrapper test for subst function types 2020-02-24 12:14:21 -08:00
Robert Widmann
3e4a820fb4 [SILGen] Handle Reabstraction and Substitution in assign_by_wrapper
Use the substitution map for the LValue component to properly handle the
case where we need to re-abstract the argument to the assign_by_wrapper
setter.

Resolves rdar://59553318
2020-02-18 14:59:03 -08:00
Robert Widmann
3b11c2b170 [SILGen] Materialize Arguments To Property Wrapper Setters If Needed
Codegen for the assign_by_wrapper instruction emits prepared arguments
directly into the initializer or accessor functions. This means it
misses out on the CC matching code that the general apply path uses.

In this particular case, an enum value was constructed within the
resilience boundary, but passed to the setter for a wrapper property
that expected it to be in memory.

Check the calling convention before we emit the assign_by_wrapper
instruction, and materialize an address for indirect CCs as required.

resolves rdar://59071930
2020-02-18 09:10:07 -08:00