[poolalloc] r220629 - Update use of raw_fd_ostream, patch by Philip Pfaffe (thanks!)

Will Dietz wdietz2 at illinois.edu
Sat Oct 25 18:08:24 PDT 2014


Author: wdietz2
Date: Sat Oct 25 20:08:24 2014
New Revision: 220629

URL: http://llvm.org/viewvc/llvm-project?rev=220629&view=rev
Log:
Update use of raw_fd_ostream, patch by Philip Pfaffe (thanks!)

Fixes PR20846.

Modified:
    poolalloc/trunk/lib/DSA/Printer.cpp

Modified: poolalloc/trunk/lib/DSA/Printer.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Printer.cpp?rev=220629&r1=220628&r2=220629&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/Printer.cpp (original)
+++ poolalloc/trunk/lib/DSA/Printer.cpp Sat Oct 25 20:08:24 2014
@@ -25,6 +25,7 @@
 #include "llvm/Config/config.h"
 #include "llvm/Support/FormattedStream.h"
 #include <sstream>
+#include <system_error>
 using namespace llvm;
 
 // OnlyPrintMain - The DataStructure printer exposes this option to allow
@@ -293,11 +294,11 @@ void DSGraph::writeGraphToFile(llvm::raw
   std::string Filename = GraphName + ".dot";
   O << "Writing '" << Filename << "'...";
   if (!DontPrintGraphs) {
-    std::string Error;
-    llvm::raw_fd_ostream F(Filename.c_str(), Error, sys::fs::F_Text);
+    std::error_code Error;
+    llvm::raw_fd_ostream F(Filename, Error, sys::fs::F_Text);
 
-    if (Error.size()) {
-      O << "  error opening file for writing! " << Error << "\n";
+    if (Error) {
+      O << "  error opening file for writing! " << Error.message() << "\n";
       return;
     }
 





More information about the llvm-commits mailing list