ojhunt 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`?
Possibly - I just noticed it when I searched for base traversal while trying to find the accursed function :D > > Where would you suggest moving this logic? `ASTRecordLayout` maybe? Ah, do you not have access to the ABI interface in CIR? (This is just an "Oliver doesn't know where the abstraction boundaries are" question) Anyway, I might have time this weekend to look into moving it into ASTRecordLayout - would you mind looking at the DynamicCastInfo struct and just noting what additional data you need? https://github.com/llvm/llvm-project/pull/164007 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
