From: Ted Kremenek Date: Thu, 22 May 2008 16:28:24 +0000 (+0000) Subject: Don't use ostringstream (pulling in ) when creating the dead store diagnosti... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c07ba352b7604435e80269be23ace72a52bd04f1;p=clang Don't use ostringstream (pulling in ) when creating the dead store diagnostic (simply not needed). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51432 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/DeadStores.cpp b/lib/Analysis/DeadStores.cpp index fb241fd552..0f08b233b5 100644 --- a/lib/Analysis/DeadStores.cpp +++ b/lib/Analysis/DeadStores.cpp @@ -20,7 +20,6 @@ #include "clang/Basic/Diagnostic.h" #include "clang/AST/ASTContext.h" #include "llvm/Support/Compiler.h" -#include using namespace clang; @@ -36,10 +35,12 @@ public: virtual ~DeadStoreObs() {} - unsigned GetDiag(VarDecl* VD) { - std::ostringstream os; - os << "value stored to '" << VD->getName() << "' is never used"; - return Diags.getCustomDiagID(Diagnostic::Warning, os.str().c_str()); + unsigned GetDiag(VarDecl* VD) { + std::string msg = "value stored to '" + std::string(VD->getName()) + + "' is never used"; + + return Diags.getCustomDiagID(Diagnostic::Warning, msg.c_str()); + } void CheckDeclRef(DeclRefExpr* DR, Expr* Val,