diff options
author | Nate Begeman <natebegeman@mac.com> | 2008-04-20 06:29:50 +0000 |
---|---|---|
committer | Nate Begeman <natebegeman@mac.com> | 2008-04-20 06:29:50 +0000 |
commit | 4c13b7a3973d2d263d9682d7b68fbfeb76334af5 (patch) | |
tree | 9a387cde53b7eceee1735bf2ce2cbd558c3a3648 /include/clang/Basic | |
parent | b1698cf972be75084d760c82389ab5b49a386c31 (diff) |
Only generate code for static functions and global variables that are actually used.
Warn about unused static functions and variables.
This fixes PR1998.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49987 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic')
-rw-r--r-- | include/clang/Basic/DiagnosticKinds.def | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/clang/Basic/DiagnosticKinds.def b/include/clang/Basic/DiagnosticKinds.def index 8fdf716aea..4591210032 100644 --- a/include/clang/Basic/DiagnosticKinds.def +++ b/include/clang/Basic/DiagnosticKinds.def @@ -1036,4 +1036,10 @@ DIAG(ext_return_missing_expr, EXTENSION, DIAG(ext_return_has_expr, EXTENSION, "void function '%0' should not return a value") +//===----------------------------------------------------------------------===// +// Codegen +//===----------------------------------------------------------------------===// + +DIAG(warn_unused_static, WARNING, "static '%0' defined but not used") + #undef DIAG |