[cfe-commits] r50263 - in /cfe/trunk: include/clang/Basic/DiagnosticKinds.def lib/CodeGen/CodeGenModule.cpp test/CodeGen/unusedstatic.c
Chris Lattner
sabre at nondot.org
Fri Apr 25 08:47:14 PDT 2008
Author: lattner
Date: Fri Apr 25 10:47:13 2008
New Revision: 50263
URL: http://llvm.org/viewvc/llvm-project?rev=50263&view=rev
Log:
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).
Removed:
cfe/trunk/test/CodeGen/unusedstatic.c
Modified:
cfe/trunk/include/clang/Basic/DiagnosticKinds.def
cfe/trunk/lib/CodeGen/CodeGenModule.cpp
Modified: cfe/trunk/include/clang/Basic/DiagnosticKinds.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticKinds.def?rev=50263&r1=50262&r2=50263&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticKinds.def (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticKinds.def Fri Apr 25 10:47:13 2008
@@ -1043,10 +1043,4 @@
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
Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=50263&r1=50262&r2=50263&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Fri Apr 25 10:47:13 2008
@@ -355,14 +355,6 @@
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) {
Removed: cfe/trunk/test/CodeGen/unusedstatic.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/unusedstatic.c?rev=50262&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/unusedstatic.c (original)
+++ cfe/trunk/test/CodeGen/unusedstatic.c (removed)
@@ -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}}
More information about the cfe-commits
mailing list