[PATCH] D25132: Invoke add-discriminator at -g0 -fsample-profile

Paul Robinson via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 3 18:02:31 PDT 2016


probinson added inline comments.


> danielcdh wrote in AddDiscriminators.cpp:165
> With -g0, getDwarfVersion() will return 0. I think it's fine to have discriminators even when the debug info does not support it. It will simply not getting emitted?

What happens if you specify -fsample-profile -gdwarf-3?  Do you get a DWARF 4 line table with discriminators even though you said you wanted DWARF 3?  I don't think that's a great idea.
I think it's fine to emit a DWARF 4 line table with discriminators if you see -fsample-profile and no debug info (-g0 or no -g at all), but if somebody asked for DWARF 2 or 3 then you should respect that.
If you want to tell the user that -fsample-profile requires DWARF 4, you should do that in the Clang driver, not simply override their choice here.

https://reviews.llvm.org/D25132





More information about the llvm-commits mailing list