aboutsummaryrefslogtreecommitdiffstats
path: root/tools/opt/GraphPrinters.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/opt/GraphPrinters.cpp')
-rw-r--r--tools/opt/GraphPrinters.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/opt/GraphPrinters.cpp b/tools/opt/GraphPrinters.cpp
index d689a4a..a1b518f 100644
--- a/tools/opt/GraphPrinters.cpp
+++ b/tools/opt/GraphPrinters.cpp
@@ -19,7 +19,7 @@
#include "llvm/Value.h"
#include "llvm/Analysis/CallGraph.h"
#include "llvm/Analysis/Dominators.h"
-#include "llvm/Support/raw_ostream.h"
+#include "llvm/Support/ToolOutputFile.h"
using namespace llvm;
template<typename GraphType>
@@ -31,16 +31,16 @@ static void WriteGraphToFile(raw_ostream &O, const std::string &GraphName,
tool_output_file F(Filename.c_str(), ErrInfo);
if (ErrInfo.empty()) {
- WriteGraph(F, GT);
- F.close();
- if (!F.has_error()) {
+ WriteGraph(F.os(), GT);
+ F.os().close();
+ if (!F.os().has_error()) {
O << "\n";
F.keep();
return;
}
}
- F.clear_error();
O << " error opening file for writing!\n";
+ F.os().clear_error();
}