[libcxx-commits] [libcxx] [libc++] Put [[gnu::nodebug]] on all internal aliases (PR #118710)

David Blaikie via libcxx-commits libcxx-commits at lists.llvm.org
Thu Dec 5 11:31:20 PST 2024


dwblaikie wrote:

> This patch significantly improves things. WIth it, instead of my gdb_index getting 9.5% larger, it gets 4.2% smaller.
> 
> One question: Is there a reason for preferring [[gnu::nodebug]] over _LIBCPP_NODEBUG? 

I'd be curious about this too - just to know if there's a change in policy, or minimum compiler version, etc. (perhaps we should stick with _LIBCPP_NODEBUG for now, to be consistent with existing practice, and have a separate RFC/discussion about changing that direction uniformly/as a mass refactoring?)

> The reason I ask: we've been moving away from using gdb_index in favor of using the debug_names index instead, and I worry about whether the code that builds the debug_names index would honor [[gnu::nodebug]]...

This isn't an issue. These are different spellings of the same behavior for clang, you can verify this with a small example on Compiler Explorer, like this: https://godbolt.org/z/o3jT967hE (you can see in the llvm-dwarfdump output that both t1 and t2 are omitted, but t3 is not)

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


More information about the libcxx-commits mailing list