1 unusedcode.easy is generated via callcatcher[1] and filtered to remove some
2 tricky edge-cases (see Makefile), e.g. anything which could plausibly be
3 dlsymed or any symbol defined in an external library bundled into LibreOffice
4 which doesn't happen to get used by LibreOffice.
6 unusedcode.easy is generated on an x86_64 --enable-debug --enable-dbgutil
9 Code listed as unused is code that gcc outputs but that nothing calls
10 (or takes the address of).
12 a) It's possible that some other platform or configuration uses the code,
13 so manual inspection is always required.
14 b) callcatcher ignores virtuals. But implementations of "pure virtuals"
15 are not actually virtual methods. If something is declared pure virtual
16 and provides an impl and that base-class impl is not explicitly called
17 anywhere, then that impl can go away.
18 c) gcc will only emit code for inlines if those inlines are used, so
19 sometimes something is listed correctly as unused but some inline
20 code takes a pointer or reference to something which cannot be
21 instantiated so removal of some method/class fails at build time because
22 gcc never emits any code for the unused inline but trips over it at
23 compile time after an attempt at removal. i.e. generally the inline method
24 can go as well because nothing calls it either, a double win.
25 d) if a constructor is listed as unused, and it's the *only* ctor in the class,
26 then no object of that class can be constructed, so the whole thing is
27 unused, which can lead to a whole cascade of tricky but logical fallout.
28 e) if a destructor is listed as unused, and a constructor isn't, then there's
29 a leak somewhere, and the destructor most likely *should* be called.
30 f) there's more actually unused code then what's listed. The idea is that what's
31 listed is definitely unused under the generation configuration, not that
32 it's a list of all unused code. If the count of unused easy hits 0 then
33 we can have a look at the non-easy and if that hits 0, then strip out
34 code from the "release" binaries which only makes sense in debug/dbgutil
35 configurations, and then tackle unused virtual method slots :-)
37 Symbols that are known to be false alarms are listed in: unusedcode.exclude
39 [1] http://www.skynet.ie/~caolan/Packages/callcatcher.html