]> granicus.if.org Git - clang/commitdiff
Don't use ostringstream (pulling in <sstream>) when creating the dead store diagnosti...
authorTed Kremenek <kremenek@apple.com>
Thu, 22 May 2008 16:28:24 +0000 (16:28 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 22 May 2008 16:28:24 +0000 (16:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51432 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/DeadStores.cpp

index fb241fd5525b3c5abf6da1ba42877ca31a802b17..0f08b233b5467896b189d5b3b67a5b3cd4178c7b 100644 (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,