[cfe-commits] r51432 - /cfe/trunk/lib/Analysis/DeadStores.cpp

Ted Kremenek kremenek at apple.com
Thu May 22 09:28:26 PDT 2008


Author: kremenek
Date: Thu May 22 11:28:24 2008
New Revision: 51432

URL: http://llvm.org/viewvc/llvm-project?rev=51432&view=rev
Log:
Don't use ostringstream (pulling in <sstream>) when creating the dead store diagnostic (simply not needed).

Modified:
    cfe/trunk/lib/Analysis/DeadStores.cpp

Modified: cfe/trunk/lib/Analysis/DeadStores.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/DeadStores.cpp?rev=51432&r1=51431&r2=51432&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/DeadStores.cpp (original)
+++ cfe/trunk/lib/Analysis/DeadStores.cpp Thu May 22 11:28:24 2008
@@ -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,





More information about the cfe-commits mailing list