aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CompilerDriver/CompilationGraph.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-08-23 07:19:13 +0000
committerChris Lattner <sabre@nondot.org>2009-08-23 07:19:13 +0000
commit4883d90396c210a95bb70409c0d4e712c2a79744 (patch)
tree9c09f657b0740b9ecbf8f2b27e4170b984c60028 /llvm/lib/CompilerDriver/CompilationGraph.cpp
parent7e3cfe35ff03fed7bea78ab408962a46ca774466 (diff)
downloadllvm-4883d90396c210a95bb70409c0d4e712c2a79744.zip
llvm-4883d90396c210a95bb70409c0d4e712c2a79744.tar.gz
llvm-4883d90396c210a95bb70409c0d4e712c2a79744.tar.bz2
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.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CompilerDriver/CompilationGraph.cpp b/llvm/lib/CompilerDriver/CompilationGraph.cpp
index f303943..bb0eb7b 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