Commit Graph

1 Commits

Author SHA1 Message Date
Kavon Farvardin
1e28b0a312 SILGen: revise emission of UnreachableExpr
The prior emission strategy produced some scary SIL where
we have a copy of uninitialized memory:

```
  ignored_use %14
  %16 = alloc_stack $T
  unreachable

bb1:
  copy_addr [take] %16 to [init] %0
  dealloc_stack %16
```

I assume this was done to dodge the SILVerifier, which
will catch a take of an uninitialized address, had the
alloc_stack been in any reachable predecessor.

We already have a representation for an undefined value
in SIL, so I'd rather use that than try to sneak one
past the verifier.

This adjusted emission also is opaque values friendly,
as it doesn't assume the result value is an address.

resolves rdar://162239557
2025-10-09 10:38:54 -07:00