From 103289e9383ad1eb66caf28c9b166aebce963a35 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 23 Aug 2009 07:19:13 +0000 Subject: convert LoopInfo.h and GraphWriter.h to use raw_ostream git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79836 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CompilerDriver/CompilationGraph.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/CompilerDriver') diff --git a/lib/CompilerDriver/CompilationGraph.cpp b/lib/CompilerDriver/CompilationGraph.cpp index f303943..bb0eb7b 100644 --- a/lib/CompilerDriver/CompilationGraph.cpp +++ b/lib/CompilerDriver/CompilationGraph.cpp @@ -514,13 +514,13 @@ namespace llvm { } void CompilationGraph::writeGraph(const std::string& OutputFilename) { - std::ofstream O(OutputFilename.c_str()); + std::string ErrorInfo; + raw_fd_ostream O(OutputFilename.c_str(), ErrorInfo); - if (O.good()) { + if (ErrorInfo.empty()) { errs() << "Writing '"<< OutputFilename << "' file..."; llvm::WriteGraph(O, this); errs() << "done.\n"; - O.close(); } else { throw std::runtime_error("Error opening file '" + OutputFilename -- cgit v1.1