andykaylor wrote:

> The class traversal logic looks to be pretty much identical to the non-CIR 
> final class dynamic_cast optimization (`CGCXXABI::getExactDynamicCastInfo`) 
> is it possible to reuse that logic? maybe extending it if additional 
> information is needed? (also while trying to find that code again I found yet 
> another near copy of the same logic. _sigh_ :D0

Unfortunately, this is a recurring problem with CIR codegen. We've tried to 
keep the basic code structure as close to LLVM IR codegen as is practical. 
There are, of course, many places where we could be sharing the actual code for 
things that don't involve the target substrate. We've implemented a few of 
these, and for others we've just left comments saying that it should be done. 
We're trying to find the right balance between making fast progress on the 
upstreaming versus accumulating technical debt and baking in fragility.

Is the other "near copy" you were referring to in `computeOffsetHint`?

Where would you suggest moving this logic? `ASTRecordLayout` maybe?

https://github.com/llvm/llvm-project/pull/164007
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to