diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-08-23 07:19:13 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-08-23 07:19:13 +0000 |
| commit | 4883d90396c210a95bb70409c0d4e712c2a79744 (patch) | |
| tree | 9c09f657b0740b9ecbf8f2b27e4170b984c60028 /llvm/lib/CompilerDriver/CompilationGraph.cpp | |
| parent | 7e3cfe35ff03fed7bea78ab408962a46ca774466 (diff) | |
| download | bcm5719-llvm-4883d90396c210a95bb70409c0d4e712c2a79744.tar.gz bcm5719-llvm-4883d90396c210a95bb70409c0d4e712c2a79744.zip | |
convert LoopInfo.h and GraphWriter.h to use raw_ostream
llvm-svn: 79836
Diffstat (limited to 'llvm/lib/CompilerDriver/CompilationGraph.cpp')
| -rw-r--r-- | llvm/lib/CompilerDriver/CompilationGraph.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CompilerDriver/CompilationGraph.cpp b/llvm/lib/CompilerDriver/CompilationGraph.cpp index f3039433b03..bb0eb7bcf19 100644 --- a/llvm/lib/CompilerDriver/CompilationGraph.cpp +++ b/llvm/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 |

