summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/DeadStores.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Analysis/DeadStores.cpp')
-rw-r--r--clang/lib/Analysis/DeadStores.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/clang/lib/Analysis/DeadStores.cpp b/clang/lib/Analysis/DeadStores.cpp
index fb241fd5525..0f08b233b54 100644
--- a/clang/lib/Analysis/DeadStores.cpp
+++ b/clang/lib/Analysis/DeadStores.cpp
@@ -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,
OpenPOWER on IntegriCloud