summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.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
commit1618023018cd6d3cb33fb39d268729772be82a85 (patch)
tree9d0ca1d2a799b2c8d992508dee39112a206276eb /clang/lib/CodeGen/CodeGenModule.cpp
parentaedbe0f3476e02eb79e5472ab09dea463e12acf8 (diff)
downloadbcm5719-llvm-1618023018cd6d3cb33fb39d268729772be82a85.tar.gz
bcm5719-llvm-1618023018cd6d3cb33fb39d268729772be82a85.zip
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. llvm-svn: 129794
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud