4 ms·
C and C++ applications include lots and lots of headers from the systems and third party libraries. Dead code is common in such circumstances, and programmers w
by scott_s 11y ago
C and C++ applications include lots and lots of headers from the systems and third party libraries. Dead code is common in such circumstances, and programmers would drown in a sea of dead code eliminated warnings.
- rwmj 11y agoBut you can still see: is the source of this code something the user has written in a .c file, or something that came from a header file or from macro expansion, and only warn about the former. Granted this is difficult, because LLVM is multi-layered, but it's not impossible in the general case.
- scott_s 11y agoI think it's extremely difficult, to the point of not being practical. When you get to the point of the compiler that it's applying these optimizations, that the code came from a .c or .h file has been long thrown away.