diff options
author | Chris Lattner <sabre@nondot.org> | 2008-04-25 15:47:13 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-04-25 15:47:13 +0000 |
commit | 5827754da1773a7288480ce34bdf1f0a909fff21 (patch) | |
tree | ad5b45e634acede6ee00f4900dcef0c4d339a320 | |
parent | 27ae6c6531ac13e4b316e7e0e7b7c846b61a8d15 (diff) |
remove the 'unused static' diagnostic from codegen. This should be
reimplemented in Sema someday. This is tracked in PR2236. Until then
disabling it removes some bogus diagnostics (see 2236).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50263 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/Basic/DiagnosticKinds.def | 6 | ||||
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 8 | ||||
-rw-r--r-- | test/CodeGen/unusedstatic.c | 7 |
3 files changed, 0 insertions, 21 deletions
diff --git a/include/clang/Basic/DiagnosticKinds.def b/include/clang/Basic/DiagnosticKinds.def index a8560e1cb3..6f58ae1e82 100644 --- a/include/clang/Basic/DiagnosticKinds.def +++ b/include/clang/Basic/DiagnosticKinds.def @@ -1043,10 +1043,4 @@ 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 diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 98a8aaaf86..7e5e8f06b7 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -355,14 +355,6 @@ void CodeGenModule::EmitStatics() { Changed = true; } } while (Changed); - - // Warn about all statics that are still unused at end of code generation. - for (unsigned i = 0, e = StaticDecls.size(); i != e; ++i) { - const NamedDecl *D = StaticDecls[i]; - std::string Msg = D->getName(); - getDiags().Report(Context.getFullLoc(D->getLocation()), - diag::warn_unused_static, &Msg, 1); - } } llvm::Constant *CodeGenModule::EmitGlobalInit(const Expr *Expr) { diff --git a/test/CodeGen/unusedstatic.c b/test/CodeGen/unusedstatic.c deleted file mode 100644 index 902596e30e..0000000000 --- a/test/CodeGen/unusedstatic.c +++ /dev/null @@ -1,7 +0,0 @@ -// RUN: clang %s -emit-llvm -verify -// PR1998 -// PR2236 -static void a (void); -void b (void) { a (); } -static void a(void) {} -static void c(void) {} // expected-warning {{static 'c' defined but not used}} |