diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2006-08-21 06:04:45 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2006-08-21 06:04:45 +0000 |
commit | 8ea5ecb0564b8822c70ad84202471f03e2690da7 (patch) | |
tree | 2b32a1dc217579d1cc5799b60e575dcb0a6dcc5d /lib/Support/GraphWriter.cpp | |
parent | 4ce5dc63778f36f61b510456783f15a224406e68 (diff) |
For PR797:
Adjust usage of the ExecuteAndWait function to use the last argument which
is the ErrMsg string. This is necessitated because this function no longer
throws exceptions on error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29791 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/GraphWriter.cpp')
-rw-r--r-- | lib/Support/GraphWriter.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/Support/GraphWriter.cpp b/lib/Support/GraphWriter.cpp index 152261fbac..501cc6d89d 100644 --- a/lib/Support/GraphWriter.cpp +++ b/lib/Support/GraphWriter.cpp @@ -19,6 +19,7 @@ using namespace llvm; void llvm::DisplayGraph(const sys::Path &Filename) { + std::string ErrMsg; #if HAVE_GRAPHVIZ sys::Path Graphviz(LLVM_PATH_GRAPHVIZ); @@ -28,8 +29,8 @@ void llvm::DisplayGraph(const sys::Path &Filename) { args.push_back(0); std::cerr << "Running 'Graphviz' program... " << std::flush; - if (sys::Program::ExecuteAndWait(Graphviz, &args[0])) { - std::cerr << "Error viewing graph: 'Graphviz' not in path?\n"; + if (sys::Program::ExecuteAndWait(Graphviz, &args[0],0,0,0,&ErrMsg)) { + std::cerr << "Error viewing graph: " << ErrMsg << "\n"; } #elif (HAVE_GV && HAVE_DOT) sys::Path PSFilename = Filename; @@ -48,8 +49,8 @@ void llvm::DisplayGraph(const sys::Path &Filename) { args.push_back(0); std::cerr << "Running 'dot' program... " << std::flush; - if (sys::Program::ExecuteAndWait(dot, &args[0])) { - std::cerr << "Error viewing graph: 'dot' not in path?\n"; + if (sys::Program::ExecuteAndWait(dot, &args[0],0,0,0,&ErrMsg)) { + std::cerr << "Error viewing graph: '" << ErrMsg << "\n"; } else { std::cerr << " done. \n"; @@ -59,8 +60,9 @@ void llvm::DisplayGraph(const sys::Path &Filename) { args.push_back(PSFilename.c_str()); args.push_back(0); - if (sys::Program::ExecuteAndWait(gv, &args[0])) { - std::cerr << "Error viewing graph: 'gv' not in path?\n"; + ErrMsg.clear(); + if (sys::Program::ExecuteAndWait(gv, &args[0],0,0,0,&ErrMsg)) { + std::cerr << "Error viewing graph: " << ErrMsg << "\n"; } } PSFilename.eraseFromDisk(); @@ -72,8 +74,8 @@ void llvm::DisplayGraph(const sys::Path &Filename) { args.push_back(0); std::cerr << "Running 'dotty' program... " << std::flush; - if (sys::Program::ExecuteAndWait(dotty, &args[0])) { - std::cerr << "Error viewing graph: 'dotty' not in path?\n"; + if (sys::Program::ExecuteAndWait(dotty, &args[0],0,0,0,&ErrMsg)) { + std::cerr << "Error viewing graph: " << ErrMsg << "\n"; } else { #ifdef __MINGW32__ // Dotty spawns another app and doesn't wait until it returns. return; |