Commit Graph

19 Commits

Author SHA1 Message Date
Michael Gottesman
6058b1d9bd [silgen] Change SILGen to emit ignored_user for emitIgnoredExpr and black hole initialization. 2025-01-22 21:12:36 -08:00
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
Andrew Trick
a1fe258692 Update tests for new trivial moves and extend_lifetimes. 2024-07-26 08:27:48 -07:00
Nate Chandler
dff0b2efaa [SILGen] Allocs for VDs are var_decl.
Annotate alloc_stack instructions that correspond to VarDecls with the
var_decl flag.
2024-03-08 22:28:22 -08:00
Nate Chandler
10ce0c6b16 [SILGen] Used move_value for lexical lets.
Instead of using begin_borrow [lexical] + copy_value.
2023-12-14 13:35:26 -08:00
Nate Chandler
9bb0187be1 [SILGen] Add begin_borrow [var_decl] lifetimes. 2023-11-28 07:26:09 -08:00
Slava Pestov
36e74c1331 ASTMangler: Mangle variadic pack markers before requirements 2023-04-19 18:32:18 -04:00
Slava Pestov
df5d531dc6 ASTPrinter: Fix printing of pack requirements
Also remove the flag for printing 'each' and make it always on.
2023-04-19 13:04:51 -04:00
Holly Borla
e48a9b5aeb [NFC] Remove the VariadicGenerics flag from tests that don't use generic types
with parameter packs.
2023-04-15 17:48:08 -07:00
Nate Chandler
cda365ca8d [stdlib] Collection types are eagerMove.
Types that have "value semantics" should not have lexical lifetimes.
Value types are not expected to have custom deinits. Are not expected to
expose unsafe interior pointers. And cannot have weak references because
they are structs. Therefore, deinitialization barriers are irrelevant.

rdar://107076869
2023-03-30 11:04:47 -07:00
John McCall
32fa74d374 Merge pull request #64374 from rjmccall/verify-multiple-opening
Verify instructions depending on multiple archetypes from the same open_pack_element
2023-03-15 15:07:54 -04:00
Slava Pestov
c3a6bfb5bc SIL: Implement SILTypeSubstituter::hasSameShape() 2023-03-15 11:59:47 -04:00
John McCall
22c05ba5a6 Fix the SIL verifier to handle openings of multiple element archetypes 2023-03-14 22:31:38 -04:00
John McCall
3bdee8c215 Fix an ownership bug when splitting an opaque tuple value into
a pack expansion.
2023-03-10 19:02:38 -05:00
Holly Borla
58c92269f4 [SILGen] Update variadic generics SILGen test for PackType representation change. 2023-03-07 08:26:14 -08:00
John McCall
dc477a0fd2 Merge pull request #64167 from rjmccall/variadic-results
Implement the caller side of return types containing variadic packs
2023-03-07 11:20:46 -05:00
John McCall
81f11c19ab Implement the caller side of return types containing variadic packs
This is all relatively nicely abstracted, which is not to say that
it didn't take an awful lot of plumbing to get it to work.  The basic
problem here is inherent: we need to do component-specific setup and
teardown, and unfortunately in the current representation we have to
do that with separate loops and without any dominance relationships.
(This is the same thing preventing us from doing borrows in the
general case.)  The result is that the general case of result emission
is to emit every element of the expansion into a temporary tuple
(requiring a pack loop before the call to initialize the pack), then
process those elements in the body of a second pack loop after the
call.  And that's terrible enough that we really have to do the work
to try to avoid it, which makes all the APIs more complicated.

Anyway, most of the way through the basic plumbing for variadic
generics now.  Next is reabstraction, I think, which I hope will
mostly mean fixing bugs in the infrastructure I've already written.
2023-03-07 03:15:31 -05:00
Holly Borla
fa3ffc6a44 [SILGen] Update a few callers of SubstitutionMap::get to use getSingletonPackExpansion,
and update variadic generics SILGen tests for the representation change.
2023-03-06 22:05:11 -08:00
John McCall
157be3420c Implement the callee side of returning a tuple containing a pack expansion.
This required quite a bit of infrastructure for emitting this kind of
tuple expression, although I'm not going to claim they really work yet;
in particular, I know the RValue constructor is going to try to explode
them, which it really shouldn't.

It also doesn't include the caller side of returns, for which I'll need
to teach ResultPlan to do the new abstraction-pattern walk.  But that's
next.
2023-03-06 04:26:18 -05:00