Skip to content

Commit 87235fa

Browse files
[NFC] CoroElide: Refactor Lowerer into CoroIdElider (#91539)
This patch contains no functional changes. The main goal of this patch is to get better clarity out of the code, to make intentions and assumptions clear. One major design problem I had in the past were `Lowerer`. It previously inherited from `coro::LowererBase` but it doesn't use any of the fields or methods from `LowererBase`. It might be an artifact leftover from previous designs of this code. Furthermore, we should clarify that although one such instance is bound to the function, `Lowerer` was dedicated to one `CoroId` instruction at a time. We rely on a sequence of fragile constructs like `CoroBegins.clear(); DestroyAddr.clear()`. This doesn't help understand the code. What's worse is that we have confusing calls like `elideHeapAllocations(CoroId->getFunction(), ...` and it might get confused with `CoroId->getCoroutine()`. The new structure intends to make it clear that we always operate on one `CoroId` at a time, which may have multiple `CoroBegin`s. Such structure doesn't rely on frequent `.clear()` that's prone to miss.
1 parent aa9d467 commit 87235fa

File tree

1 file changed

+169
-149
lines changed

1 file changed

+169
-149
lines changed

0 commit comments

Comments
 (0)