[cfe-commits] r58479 - /cfe/trunk/lib/Analysis/GRExprEngineInternalChecks.cpp

Ted Kremenek kremenek at apple.com
Thu Oct 30 17:18:30 PDT 2008


Author: kremenek
Date: Thu Oct 30 19:18:30 2008
New Revision: 58479

URL: http://llvm.org/viewvc/llvm-project?rev=58479&view=rev
Log:
Use llvm::raw_string_ostream instead of std::ostringstream.

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

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

==============================================================================
--- cfe/trunk/lib/Analysis/GRExprEngineInternalChecks.cpp (original)
+++ cfe/trunk/lib/Analysis/GRExprEngineInternalChecks.cpp Thu Oct 30 19:18:30 2008
@@ -16,7 +16,7 @@
 #include "clang/Analysis/PathSensitive/GRExprEngine.h"
 #include "clang/Basic/SourceManager.h"
 #include "llvm/Support/Compiler.h"
-#include <sstream>
+#include "llvm/Support/raw_ostream.h"
 
 using namespace clang;
 
@@ -200,7 +200,8 @@
                                                                E));
       
       // Generate a report for this bug.
-      std::ostringstream os;
+      std::string buf;
+      llvm::raw_string_ostream os(buf);
       SourceRange R;
       
       // Check if the region is a compound literal.
@@ -220,8 +221,7 @@
            << V.getRegion()->getString() << "' returned.";
       }
       
-      std::string s = os.str();      
-      RangedBugReport report(*this, N, s.c_str());
+      RangedBugReport report(*this, N, os.str().c_str());
       report.addRange(E->getSourceRange());
       if (R.isValid()) report.addRange(R);
       





More information about the cfe-commits mailing list