Commit Graph

5 Commits

Author SHA1 Message Date
Erik Eckstein
bb38711894 DestoyHoisting: handle infinite loops correctly
Ignore blocks in infinite loops and don't insert destroys where they don't belong.

Fixes an ownership verifier crash.
2019-11-20 11:16:05 +01:00
Erik Eckstein
33afd0eb2b MemoryLifetime: Make debug dump functions for bitsets usable from other optimizations
NFC
2019-10-14 13:07:22 +02:00
Erik Eckstein
3d0b12e7bc MemoryLifetime: fix a problem where DestroyHoisting moved a destroy_addr before a use of a trivial type.
Even if a destroy_addr of a trivial type is a no-op, we must not end up with using such a value after a destroy_addr.
The fix is to also handle aggregate fields of trivial types in MemoryLifetime.

rdar://problem/55125020
2019-09-11 13:49:23 +02:00
Erik Eckstein
9e67408307 MemoryLifetime: Make the dataflow solving functions of MemoryDataflow more flexible.
Add the possibility to solve with a custom join operator.
2019-08-28 12:14:38 +02:00
Erik Eckstein
fdcb46eacd SIL: Utilities for calculating and verifying memory lifetimes.
In analogy to the ownership verifier, the MemoryLifetimeVerifier checks the lifetime of memory locations.
It's based on MemoryLocations and MemoryDataflow, which are general utilities for analysing memory locations and calculating the lifetime of locations.

Memory locations are limited to addresses which are guaranteed to be not aliased, like @in/inout parameters or alloc_stack.
2019-08-13 09:50:30 +02:00