[cfe-dev] Disabling debug mode for system headers

Mikael Persson mikael.s.persson at gmail.com
Fri Dec 19 13:53:19 PST 2014


Hi Clang people,

I was just having a discussion that involved someone complaining that when
building his code in debug mode (-g and -O0 or -Og), the code from standard
libraries, especially the STL, would become very slow as a result of the
disabled optimizations and the general debug symbol overhead. Given that
typical debugging tasks don't involve digging into standard libraries or
other "system-headers" (included with -isystem option), I thought that it
might be a good idea for compilers to provide the option to disable
debugging for anything that is from a system header. It would also have the
practical benefit of avoiding having to link to debug-enabled libraries for
those headers.

>From my admittedly superficial knowledge of how compilers work, it seems
like this could be possible. (or does this kind of an option already exist?)

I just thought I should let you guys know about it. You certainly would
know better than me if this is at all possible, and if it is, would know
how to make it happen for Clang. What do you think?

Cheers,
Mikael.


-- 
Sven Mikael Persson, M.Sc.(Tech.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20141219/420b586b/attachment.html>


More information about the cfe-dev mailing list