Skip to content

Commit c0bc290

Browse files
committed
Tidy up "patch-up" logic.
In the last PR I added the ability to "patch-up later" instruction indices that are as-yet unknown. I stashed the info needed for this in a new field in the YKIRWriter. However, since that info is "per-function", there's no need to keep it alive that long. In fact the lifetime is the same as the `VLMap`. This change groups the VLMap and the patch-up info together into a `FuncLowerCtxt`. A fresh one of these is created for each LLVM function we lower, and it is then passed down through the serialiser using no object state from `YkIRWriter`. When we are done lowering a function, we allow the `FuncLowerCtxt` to fall out of scope, thus better capturing the lifetime of this information and preventing accidental reuse. No functional change.
1 parent 73ffc00 commit c0bc290

File tree

1 file changed

+115
-90
lines changed

1 file changed

+115
-90
lines changed

0 commit comments

Comments
 (0)