[clang] [llvm] [clang][DebugInfo] Add symbol for debugger with VTable information. (PR #130255)

Tom Tromey via llvm-commits llvm-commits at lists.llvm.org
Mon May 12 11:59:06 PDT 2025


tromey wrote:

> As a note - when you say "at the CU scope" do you mean a direct child of the CU, or anything outside a function or class definition? (ie: could be inside a namespace) - Clang puts definitions, I think, in the namespace nearest the declaration for the definition - compare these: https://godbolt.org/z/EoK4noe7o

Outside of function bodies is probably good enough.

For me conceptually the vtable is an artificial global, but I could understand wanting it to be in a namespace or whatever.

And really if one were going that route, having the vtable object be a function-scoped static would also make sense.  It's just that this incurs a new cost on the debuginfo reader -- but not for any deep source-related reason, because these aren't source-accessible objects anyway.


https://github.com/llvm/llvm-project/pull/130255


More information about the llvm-commits mailing list