[llvm] [NFC] Remove UnwindTable dependency on CIE, and FDE (PR #142520)

AmirHossein PashaeeHir via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 18 11:48:46 PDT 2025


amsen20 wrote:

> > The old code created an immutable object, which is usually preferable from a design perspective. Would it be better to add a constructor to pass a pre-filled `RowContainer` instead of a public method that fills the object row by row and which, technically, allows the object to be modified after creation?
> 
> The method `parseRows` actually doesn't modify the internal state of the `UnwindTable` (other than two corner cases) and doesn't even read from it. It gets the current `Row` value and applies the `CFIProgram` instructions to it.
> 
> So `UnwindTable` is nothing but a `RowsContainer` that is convenient to access and dump. I think making the `parseRows` static and renaming it to something like `applyCFIProgramToCurrentRow` would resolve the problem.
> 
> I believe `UnwindTable` should be mutable, if not it can be a bunch of functions to operate on a `vector<Row>`. For now it's only updated once during creation, but my use case described in this [RFC](https://discourse.llvm.org/t/rfc-dwarf-cfi-validation/86936) is to update them regularly.



https://github.com/llvm/llvm-project/pull/142520


More information about the llvm-commits mailing list