[clang] [Clang](NFC) Add coverage for VTable debug info (PR #151818)

Javier Lopez-Gomez via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 5 10:59:00 PDT 2025


================
@@ -0,0 +1,109 @@
+// For CInlined (member functions are inlined), we check in case of:
+// - The definition of its destructor is visible:
+//   * The vtable is generated with comdat
+//   * Its '_vtable$' is generated
+// - Otherwise:
+//   * The vtable is declared
+//   * Its '_vtable$' is NOT generated
+//
+// For CNoInline (member functions are defined as non-inline), we check in case of:
+// - The definition of its destructor is visible:
+//   * The vtable is generated
+//   * Its '_vtable$' is generated
+// - Otherwise:
+//   * The vtable is generated
+//   * Its '_vtable$' is generated
+//
+// For CNoFnDef (member functions are declared only), we check in case of:
+//   * The vtable is NOT generated
+//   * Its '_vtable$' is generated only if optimized
----------------
jalopezg-git wrote:

Let's improve wording a bit also here, e.g.
```suggestion
// For the `CInlined` struct, where all member functions are inlined, we check the following cases:
// - If the definition of its destructor is visible:
//   * The vtable is generated with a COMDAT specifier
//   * Its '_vtable$' is generated
// - Otherwise:
//   * The vtable is declared
//   * Its '_vtable$' is NOT generated
//
// For `CNoInline` struct, where member functions are defined out-of-line, we check the following:
//   * The vtable is generated
//   * Its '_vtable$' is generated
//
// For `CNoFnDef` (member functions are declared only), we check that:
//   * The vtable is NOT generated
//   * Its '_vtable$' is generated only if optimizations are enabled
```

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


More information about the cfe-commits mailing list