summaryrefslogtreecommitdiff
path: root/lib/CompilerDriver
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
commit103289e9383ad1eb66caf28c9b166aebce963a35 (patch)
tree610f140c3f32fdfab3f0ec1d59b6a28875577f9d /lib/CompilerDriver
parenta36b81d64f90f7cc7c946080d317322c3f4e3a0f (diff)
downloadllvm-103289e9383ad1eb66caf28c9b166aebce963a35.tar.gz
llvm-103289e9383ad1eb66caf28c9b166aebce963a35.tar.bz2
llvm-103289e9383ad1eb66caf28c9b166aebce963a35.tar.xz
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
Diffstat (limited to 'lib/CompilerDriver')
-rw-r--r--lib/CompilerDriver/CompilationGraph.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/CompilerDriver/CompilationGraph.cpp b/lib/CompilerDriver/CompilationGraph.cpp
index f3039433b0..bb0eb7bcf1 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