[clang] [Clang][Driver] Expose `-fno-eliminate-unused-debug-types` to clang-cl (PR #95259)

Alexandre Ganea via cfe-commits cfe-commits at lists.llvm.org
Sun Jun 23 12:27:33 PDT 2024


aganea wrote:

> I will say, `-fno-eliminate-unused-debug-types` is a really heavy hammer that makes debug info much larger - and my understanding was that games tended to have trouble with large debug builds, so I'd be surprised if this was a great path forward.

Absolutely, this is only a short term hack until I figure out a better way to fix it.

> Do you have a small example of where Clang and MSVC differ in emitting some particular unreferenced type? I would imagine MSVC isn't emitting /every/ written type...

It's essentially the examples in https://github.com/llvm/llvm-project/issues/46924. A class that is only used to hold some const/constexpr values. These values are then used by the .NATVIS file. With `/Z7`, MSVC seems to always emit them as `S_CONSTANT`s. But in Clang since the type isn't used, it is never emitted by `CGDebugInfo::EmitAndRetainType()`. Setting `DebugInfo == llvm::codegenoptions::UnusedTypeInfo` fixes the problem. Is there a better way?

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


More information about the cfe-commits mailing list