aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/InitHeaderSearch.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-04-19 19:51:10 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-04-19 19:51:10 +0000
commit6b6b42aed07726178f61954ac6e51f47da00275c (patch)
treedc03f21bd2fd89c3f94984cc3ee9d1713dfcea4e /lib/Frontend/InitHeaderSearch.cpp
parent1c860d5640e8eebb11a5d515a761242b66761b0b (diff)
We regard a function as 'unused' from the codegen perspective, so our warnings diverge from
gcc's unused warnings which don't get emitted if the function is referenced even in an unevaluated context (e.g. in templates, sizeof, etc.). Also, saying that a function is 'unused' because it won't get codegen'ed is somewhat misleading. - Don't emit 'unused' warnings for functions that are referenced in any part of the user's code. - A warning that an internal function/variable won't get emitted is useful though, so introduce -Wunneeded-internal-declaration which will warn if a function/variable with internal linkage is not "needed" ('used' from the codegen perspective), e.g: static void foo() { } template <int> void bar() { foo(); } test.cpp:1:13: warning: function 'foo' is not needed and will not be emitted static void foo() { } ^ Addresses rdar://8733476. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129794 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/InitHeaderSearch.cpp')
0 files changed, 0 insertions, 0 deletions