tromey wrote: > Hmmm, I see the wording in the spec nearby, "For indirect calls or jumps > where it is unknown at compile time which subprogram will be called [...]". I > suppose this shows that the thinking in the spec is that an indirect call is > something where you don't know the specific subprogram; and that means an > address; and that means consumers would legitimately assume if we put a > subprogram reference in then there's a direct call. Which moves me towards > thinking we would need an extra/new attribute to properly describe this.
The full text of that paragraph is: > The call site may have a DW_AT_call_target attribute which is a DWARF expression. For indirect calls or jumps where it is unknown at compile time which subprogram will be called the expression computes the address of the subprogram that will be called. I think this means that a virtual call should be represented by a `DW_AT_call_target` with a DWARF expression that finds the call target, i.e., by finding the correct slot in the vtable. A non-virtual call to a virtual method, like the devirtualized or upcall case, would instead use `DW_AT_call_origin` referencing the DIE for the specific method. https://github.com/llvm/llvm-project/pull/167666 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
