summaryrefslogtreecommitdiff
path: root/include/llvm/Support/GraphWriter.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Support/GraphWriter.h')
-rw-r--r--include/llvm/Support/GraphWriter.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/llvm/Support/GraphWriter.h b/include/llvm/Support/GraphWriter.h
index 845367bc80..6bf43d29c7 100644
--- a/include/llvm/Support/GraphWriter.h
+++ b/include/llvm/Support/GraphWriter.h
@@ -251,7 +251,11 @@ sys::Path WriteGraph(const GraphType &G,
return Filename;
}
Filename.appendComponent(Name + ".dot");
- Filename.makeUnique();
+ if (Filename.makeUnique(true,&ErrMsg)) {
+ std::cerr << "Error: " << ErrMsg << "\n";
+ return sys::Path();
+ }
+
std::cerr << "Writing '" << Filename << "'... ";
std::ofstream O(Filename.c_str());