summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
Diffstat (limited to 'clang')
-rw-r--r--clang/include/clang/Basic/DiagnosticKinds.def6
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp8
-rw-r--r--clang/test/CodeGen/unusedstatic.c7
3 files changed, 0 insertions, 21 deletions
diff --git a/clang/include/clang/Basic/DiagnosticKinds.def b/clang/include/clang/Basic/DiagnosticKinds.def
index a8560e1cb36..6f58ae1e820 100644
--- a/clang/include/clang/Basic/DiagnosticKinds.def
+++ b/clang/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/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 98a8aaaf86d..7e5e8f06b70 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/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/clang/test/CodeGen/unusedstatic.c b/clang/test/CodeGen/unusedstatic.c
deleted file mode 100644
index 902596e30e1..00000000000
--- a/clang/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}}
OpenPOWER on IntegriCloud