rogfer01 added a comment.

@rjmccall because we do not want to impact the clients of `ABIArgInfo` I 
thought of two possible approaches

1. extend `CGFunctionInfo` with a third trailing array (now it has two), with 
as many elements as `ABIArgInfo` (call it `ABIArgExtraInfo`) then during the 
creation of `CGFunctionInfo` link (somehow, see discussion below) each 
`ABIArgInfo`to its corresponding `ABIArgExtraInfo`.
2. add a dynamic container like a `SmallVector<ABIArgExtraInfo, 2>` in 
`CGFunctionInfo` and allocate `ABIArgExtraInfo` as needed.

In both cases during `getFOO`, `ABIArgInfo` would put the extra (less commonly 
used) data into the corresponding `ABIArgExtraInfo` (overflowing object).

In both cases too, we need a way to navigate to our enclosing `CGFunctionInfo` 
but strictly only during the `getFOO` that fills the `ABIArgInfo`. Getting it 
from the users is not possible, so we would need a pointer to `CGFunctionInfo` 
in `ABIArgInfo` (set up during the creation of `CGFunctionInfo`). That said, 
there is no need of its value all the time, only at the beginning of `getFOO`. 
We could reuse its storage to point the  overflowing object (if needed, and set 
it to null otherwise).

Do any of the approaches look any close to what you had in mind? Perhaps I'm 
missing the point.

Thank you!


https://reviews.llvm.org/D48589



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to