args.push_back(0);
errs() << "Running 'Graphviz' program... ";
- if (sys::Program::ExecuteAndWait(Graphviz, &args[0],0,0,0,0,&ErrMsg))
- errs() << "Error viewing graph " << Filename.str() << ": " << ErrMsg
- << "\n";
- else
- Filename.eraseFromDisk();
+ if (sys::Program::ExecuteAndWait(Graphviz, &args[0],0,0,0,0,&ErrMsg)) {
+ errs() << "Error: " << ErrMsg << "\n";
+ return;
+ }
+ Filename.eraseFromDisk();
+ errs() << " done. \n";
#elif HAVE_XDOT_PY
- sys::Path XDotPy();
-
std::vector<const char*> args;
args.push_back(LLVM_PATH_XDOT_PY);
args.push_back(Filename.c_str());
errs() << "Running 'xdot.py' program... ";
if (sys::Program::ExecuteAndWait(sys::Path(LLVM_PATH_XDOT_PY),
- &args[0],0,0,0,0,&ErrMsg))
- errs() << "Error viewing graph " << Filename.str() << ": " << ErrMsg
- << "\n";
- else
- Filename.eraseFromDisk();
+ &args[0],0,0,0,0,&ErrMsg)) {
+ errs() << "Error: " << ErrMsg << "\n";
+ return;
+ }
+ Filename.eraseFromDisk();
+ errs() << " done. \n";
#elif (HAVE_GV && (HAVE_DOT || HAVE_FDP || HAVE_NEATO || \
HAVE_TWOPI || HAVE_CIRCO))
errs() << "Running '" << prog.str() << "' program... ";
if (sys::Program::ExecuteAndWait(prog, &args[0], 0, 0, 0, 0, &ErrMsg)) {
- errs() << "Error viewing graph " << Filename.str() << ": '"
- << ErrMsg << "\n";
+ errs() << "Error: " << ErrMsg << "\n";
return;
}
errs() << " done. \n";
ErrMsg.clear();
if (wait) {
if (sys::Program::ExecuteAndWait(gv, &args[0],0,0,0,0,&ErrMsg))
- errs() << "Error viewing graph: " << ErrMsg << "\n";
+ errs() << "Error: " << ErrMsg << "\n";
Filename.eraseFromDisk();
PSFilename.eraseFromDisk();
}
errs() << "Running 'dotty' program... ";
if (sys::Program::ExecuteAndWait(dotty, &args[0],0,0,0,0,&ErrMsg)) {
- errs() << "Error viewing graph " << Filename.str() << ": "
- << ErrMsg << "\n";
+ errs() << "Error: " << ErrMsg << "\n";
} else {
// Dotty spawns another app and doesn't wait until it returns
#if defined (__MINGW32__) || defined (_WINDOWS)