vogelsgesang wrote:

Afaict, the issue is not that the address gets optimized out, but rather that 
we are setting `LineNo` to 0:

```
      DBuilder.createGlobalVariableExpression(
          TheCU, SymbolName, VTable->getName(), Unit, /*LineNo=*/0,
          getOrCreateType(VoidPtr, Unit), VTable->hasLocalLinkage(),
          /*isDefined=*/true, nullptr, DT, /*TemplateParameters=*/nullptr,
          PAlign);
```

I think this can be solved by setting the line number to the line number of, 
e.g., the `class` / `struct` keyword or the line number of the class name, or 
whatever is easily available

https://github.com/llvm/llvm-project/pull/130255
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to