Don't use ostringstream (pulling in <sstream>) 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 fb241fd..0f08b23 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 <sstream>
 
 using namespace clang;
 
@@ -36,10 +35,12 @@
   
   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,