On Wed Jul 15, 2026 at 12:25 AM WEST, David Malcolm wrote: > On Tue, 2026-07-14 at 12:32 +0100, Egas Ribeiro wrote: >> The analyzer doesn't currently support virtual function call >> resolution, >> and has no way to devirtualize concrete calls. >> >> This patch adds support for devirtualization of virtual methods by >> adding logic around OBJ_TYPE_REF calls and using the information it >> tracks to link the calls back to the concrete subclass implementation >> stored in the OBJ_TYPE_REF_OBJECT's vptr field. >> >> This approach relies on the pre-existing store binding mechanism to >> keep >> track of which _ZTV* instance the object's vptr field points to, and >> thus doesn't require any additional modeling of the dynamic type of >> the >> object to resolve calls. >> >> can_throw_p is also extended to consider thunks that wrap virtual >> methods when dealing with multiple inheritance, and now checks >> TREE_NOTHROW for more accurate results (i.e considers noexcept >> attributes on methods). > > Thanks; this looks good to push, assuming it's been through a usual > test cycle. > > Dave >
Compared to v1 I only changed comments and altered the new tests, and they are still working as intended with the new changes (thus I didn't rerun the rest of the regtests+bootstrap, as the code is the same minus comments). Egas
