Don't use ostringstream (pulling in <sstream>) when creating the dead store diagnostic (simply not needed).

llvm-svn: 51432
This commit is contained in:
Ted Kremenek 2008-05-22 16:28:24 +00:00
parent 0954b4564e
commit a4010c698c
1 changed files with 6 additions and 5 deletions

View File

@ -20,7 +20,6 @@
#include "clang/Basic/Diagnostic.h"
#include "clang/AST/ASTContext.h"
#include "llvm/Support/Compiler.h"
#include <sstream>
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,