Reid Spencer | ee7eaa2 | 2006-06-27 16:49:46 +0000 | [diff] [blame] | 1 | //===-- GraphWriter.cpp - Implements GraphWriter support routines ---------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | f3ebc3f | 2007-12-29 20:36:04 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
Reid Spencer | ee7eaa2 | 2006-06-27 16:49:46 +0000 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file implements misc. GraphWriter support routines. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
Chris Lattner | 2091cc8 | 2006-07-28 22:21:01 +0000 | [diff] [blame] | 14 | #include "llvm/Support/GraphWriter.h" |
Chandler Carruth | ed0881b | 2012-12-03 16:50:05 +0000 | [diff] [blame] | 15 | #include "llvm/Config/config.h" |
| 16 | #include "llvm/Support/CommandLine.h" |
Rafael Espindola | ce61b1e | 2013-06-13 17:20:48 +0000 | [diff] [blame] | 17 | #include "llvm/Support/FileSystem.h" |
Michael J. Spencer | 447762d | 2010-11-29 18:16:10 +0000 | [diff] [blame] | 18 | #include "llvm/Support/Program.h" |
Reid Spencer | ee7eaa2 | 2006-06-27 16:49:46 +0000 | [diff] [blame] | 19 | using namespace llvm; |
| 20 | |
Andrew Trick | edbb3b2 | 2012-03-07 00:18:27 +0000 | [diff] [blame] | 21 | static cl::opt<bool> ViewBackground("view-background", cl::Hidden, |
| 22 | cl::desc("Execute graph viewer in the background. Creates tmp file litter.")); |
| 23 | |
Chris Lattner | 4883d90 | 2009-08-23 07:19:13 +0000 | [diff] [blame] | 24 | std::string llvm::DOT::EscapeString(const std::string &Label) { |
| 25 | std::string Str(Label); |
| 26 | for (unsigned i = 0; i != Str.length(); ++i) |
| 27 | switch (Str[i]) { |
| 28 | case '\n': |
| 29 | Str.insert(Str.begin()+i, '\\'); // Escape character... |
| 30 | ++i; |
| 31 | Str[i] = 'n'; |
| 32 | break; |
| 33 | case '\t': |
| 34 | Str.insert(Str.begin()+i, ' '); // Convert to two spaces |
| 35 | ++i; |
| 36 | Str[i] = ' '; |
| 37 | break; |
| 38 | case '\\': |
| 39 | if (i+1 != Str.length()) |
| 40 | switch (Str[i+1]) { |
| 41 | case 'l': continue; // don't disturb \l |
| 42 | case '|': case '{': case '}': |
| 43 | Str.erase(Str.begin()+i); continue; |
| 44 | default: break; |
| 45 | } |
| 46 | case '{': case '}': |
| 47 | case '<': case '>': |
| 48 | case '|': case '"': |
| 49 | Str.insert(Str.begin()+i, '\\'); // Escape character... |
| 50 | ++i; // don't infinite loop |
| 51 | break; |
| 52 | } |
| 53 | return Str; |
| 54 | } |
| 55 | |
Andrew Trick | b36388a | 2013-01-25 07:45:25 +0000 | [diff] [blame] | 56 | /// \brief Get a color string for this node number. Simply round-robin selects |
| 57 | /// from a reasonable number of colors. |
| 58 | StringRef llvm::DOT::getColorString(unsigned ColorNumber) { |
| 59 | static const int NumColors = 20; |
| 60 | static const char* Colors[NumColors] = { |
| 61 | "aaaaaa", "aa0000", "00aa00", "aa5500", "0055ff", "aa00aa", "00aaaa", |
| 62 | "555555", "ff5555", "55ff55", "ffff55", "5555ff", "ff55ff", "55ffff", |
| 63 | "ffaaaa", "aaffaa", "ffffaa", "aaaaff", "ffaaff", "aaffff"}; |
| 64 | return Colors[ColorNumber % NumColors]; |
| 65 | } |
| 66 | |
Rafael Espindola | 6a6f04a | 2013-06-14 16:43:15 +0000 | [diff] [blame] | 67 | std::string llvm::createGraphFilename(const Twine &Name, int &FD) { |
| 68 | FD = -1; |
| 69 | SmallString<128> Filename; |
Rafael Espindola | 3acea39 | 2014-06-12 21:46:39 +0000 | [diff] [blame] | 70 | std::error_code EC = sys::fs::createTemporaryFile(Name, "dot", FD, Filename); |
Rafael Espindola | 6a6f04a | 2013-06-14 16:43:15 +0000 | [diff] [blame] | 71 | if (EC) { |
| 72 | errs() << "Error: " << EC.message() << "\n"; |
Rafael Espindola | ce61b1e | 2013-06-13 17:20:48 +0000 | [diff] [blame] | 73 | return ""; |
| 74 | } |
Rafael Espindola | 6a6f04a | 2013-06-14 16:43:15 +0000 | [diff] [blame] | 75 | |
| 76 | errs() << "Writing '" << Filename << "'... "; |
Rafael Espindola | ce61b1e | 2013-06-13 17:20:48 +0000 | [diff] [blame] | 77 | return Filename.str(); |
| 78 | } |
| 79 | |
Alp Toker | 125be84 | 2014-06-02 01:40:04 +0000 | [diff] [blame] | 80 | // Execute the graph viewer. Return true if there were errors. |
| 81 | static bool ExecGraphViewer(StringRef ExecPath, std::vector<const char *> &args, |
| 82 | StringRef Filename, bool wait, |
| 83 | std::string &ErrMsg) { |
| 84 | assert(args.back() == nullptr); |
Andrew Trick | edbb3b2 | 2012-03-07 00:18:27 +0000 | [diff] [blame] | 85 | if (wait) { |
Alp Toker | 125be84 | 2014-06-02 01:40:04 +0000 | [diff] [blame] | 86 | if (sys::ExecuteAndWait(ExecPath, args.data(), nullptr, nullptr, 0, 0, |
| 87 | &ErrMsg)) { |
Andrew Trick | edbb3b2 | 2012-03-07 00:18:27 +0000 | [diff] [blame] | 88 | errs() << "Error: " << ErrMsg << "\n"; |
Alp Toker | 125be84 | 2014-06-02 01:40:04 +0000 | [diff] [blame] | 89 | return true; |
Andrew Trick | edbb3b2 | 2012-03-07 00:18:27 +0000 | [diff] [blame] | 90 | } |
Rafael Espindola | 81e7fd0 | 2014-01-10 21:40:29 +0000 | [diff] [blame] | 91 | sys::fs::remove(Filename); |
Andrew Trick | edbb3b2 | 2012-03-07 00:18:27 +0000 | [diff] [blame] | 92 | errs() << " done. \n"; |
Alp Toker | 125be84 | 2014-06-02 01:40:04 +0000 | [diff] [blame] | 93 | } else { |
| 94 | sys::ExecuteNoWait(ExecPath, args.data(), nullptr, nullptr, 0, &ErrMsg); |
Yaron Keren | 075759a | 2015-03-30 15:42:36 +0000 | [diff] [blame] | 95 | errs() << "Remember to erase graph file: " << Filename << "\n"; |
Andrew Trick | edbb3b2 | 2012-03-07 00:18:27 +0000 | [diff] [blame] | 96 | } |
Alp Toker | 125be84 | 2014-06-02 01:40:04 +0000 | [diff] [blame] | 97 | return false; |
Andrew Trick | edbb3b2 | 2012-03-07 00:18:27 +0000 | [diff] [blame] | 98 | } |
Chris Lattner | 4883d90 | 2009-08-23 07:19:13 +0000 | [diff] [blame] | 99 | |
Benjamin Kramer | 51f6096c | 2015-03-23 12:30:58 +0000 | [diff] [blame] | 100 | namespace { |
Alp Toker | 125be84 | 2014-06-02 01:40:04 +0000 | [diff] [blame] | 101 | struct GraphSession { |
| 102 | std::string LogBuffer; |
| 103 | bool TryFindProgram(StringRef Names, std::string &ProgramPath) { |
| 104 | raw_string_ostream Log(LogBuffer); |
| 105 | SmallVector<StringRef, 8> parts; |
Chandler Carruth | e4405e9 | 2015-09-10 06:12:31 +0000 | [diff] [blame] | 106 | Names.split(parts, '|'); |
Alp Toker | 125be84 | 2014-06-02 01:40:04 +0000 | [diff] [blame] | 107 | for (auto Name : parts) { |
Michael J. Spencer | d48829b | 2014-11-07 21:30:36 +0000 | [diff] [blame] | 108 | if (ErrorOr<std::string> P = sys::findProgramByName(Name)) { |
Michael J. Spencer | f9074b5 | 2014-11-04 01:29:59 +0000 | [diff] [blame] | 109 | ProgramPath = *P; |
Alp Toker | 125be84 | 2014-06-02 01:40:04 +0000 | [diff] [blame] | 110 | return true; |
Michael J. Spencer | f9074b5 | 2014-11-04 01:29:59 +0000 | [diff] [blame] | 111 | } |
Alp Toker | 125be84 | 2014-06-02 01:40:04 +0000 | [diff] [blame] | 112 | Log << " Tried '" << Name << "'\n"; |
| 113 | } |
| 114 | return false; |
| 115 | } |
| 116 | }; |
Benjamin Kramer | 51f6096c | 2015-03-23 12:30:58 +0000 | [diff] [blame] | 117 | } // namespace |
Alp Toker | 125be84 | 2014-06-02 01:40:04 +0000 | [diff] [blame] | 118 | |
| 119 | static const char *getProgramName(GraphProgram::Name program) { |
| 120 | switch (program) { |
| 121 | case GraphProgram::DOT: |
| 122 | return "dot"; |
| 123 | case GraphProgram::FDP: |
| 124 | return "fdp"; |
| 125 | case GraphProgram::NEATO: |
| 126 | return "neato"; |
| 127 | case GraphProgram::TWOPI: |
| 128 | return "twopi"; |
| 129 | case GraphProgram::CIRCO: |
| 130 | return "circo"; |
| 131 | } |
Alp Toker | 1feec4b | 2014-06-02 04:34:10 +0000 | [diff] [blame] | 132 | llvm_unreachable("bad kind"); |
Alp Toker | 125be84 | 2014-06-02 01:40:04 +0000 | [diff] [blame] | 133 | } |
| 134 | |
| 135 | bool llvm::DisplayGraph(StringRef FilenameRef, bool wait, |
David Greene | 4417b4c | 2009-07-09 17:06:18 +0000 | [diff] [blame] | 136 | GraphProgram::Name program) { |
Rafael Espindola | 48944e7 | 2013-06-13 17:27:45 +0000 | [diff] [blame] | 137 | std::string Filename = FilenameRef; |
Reid Spencer | 944645a | 2006-08-21 06:04:45 +0000 | [diff] [blame] | 138 | std::string ErrMsg; |
Alp Toker | 125be84 | 2014-06-02 01:40:04 +0000 | [diff] [blame] | 139 | std::string ViewerPath; |
| 140 | GraphSession S; |
Reid Spencer | ee7eaa2 | 2006-06-27 16:49:46 +0000 | [diff] [blame] | 141 | |
Matthias Braun | e376d16 | 2015-04-03 17:22:36 +0000 | [diff] [blame] | 142 | #ifdef __APPLE__ |
Charlie Turner | 0912de3 | 2015-07-02 09:32:07 +0000 | [diff] [blame] | 143 | wait &= !ViewBackground; |
Matthias Braun | e376d16 | 2015-04-03 17:22:36 +0000 | [diff] [blame] | 144 | if (S.TryFindProgram("open", ViewerPath)) { |
| 145 | std::vector<const char *> args; |
| 146 | args.push_back(ViewerPath.c_str()); |
| 147 | if (wait) |
| 148 | args.push_back("-W"); |
| 149 | args.push_back(Filename.c_str()); |
| 150 | args.push_back(nullptr); |
| 151 | errs() << "Trying 'open' program... "; |
| 152 | if (!ExecGraphViewer(ViewerPath, args, Filename, wait, ErrMsg)) |
| 153 | return false; |
| 154 | } |
| 155 | #endif |
| 156 | if (S.TryFindProgram("xdg-open", ViewerPath)) { |
| 157 | std::vector<const char *> args; |
| 158 | args.push_back(ViewerPath.c_str()); |
| 159 | args.push_back(Filename.c_str()); |
| 160 | args.push_back(nullptr); |
| 161 | errs() << "Trying 'xdg-open' program... "; |
| 162 | if (!ExecGraphViewer(ViewerPath, args, Filename, wait, ErrMsg)) |
| 163 | return false; |
| 164 | } |
| 165 | |
Alp Toker | 125be84 | 2014-06-02 01:40:04 +0000 | [diff] [blame] | 166 | // Graphviz |
| 167 | if (S.TryFindProgram("Graphviz", ViewerPath)) { |
| 168 | std::vector<const char *> args; |
| 169 | args.push_back(ViewerPath.c_str()); |
| 170 | args.push_back(Filename.c_str()); |
| 171 | args.push_back(nullptr); |
Andrew Trick | edbb3b2 | 2012-03-07 00:18:27 +0000 | [diff] [blame] | 172 | |
Alp Toker | 125be84 | 2014-06-02 01:40:04 +0000 | [diff] [blame] | 173 | errs() << "Running 'Graphviz' program... "; |
| 174 | return ExecGraphViewer(ViewerPath, args, Filename, wait, ErrMsg); |
Dan Gohman | a0da889 | 2010-09-27 16:28:34 +0000 | [diff] [blame] | 175 | } |
Andrew Trick | edbb3b2 | 2012-03-07 00:18:27 +0000 | [diff] [blame] | 176 | |
Alp Toker | 125be84 | 2014-06-02 01:40:04 +0000 | [diff] [blame] | 177 | // xdot |
| 178 | if (S.TryFindProgram("xdot|xdot.py", ViewerPath)) { |
| 179 | std::vector<const char *> args; |
| 180 | args.push_back(ViewerPath.c_str()); |
| 181 | args.push_back(Filename.c_str()); |
Dan Gohman | a0da889 | 2010-09-27 16:28:34 +0000 | [diff] [blame] | 182 | |
Alp Toker | 125be84 | 2014-06-02 01:40:04 +0000 | [diff] [blame] | 183 | args.push_back("-f"); |
| 184 | args.push_back(getProgramName(program)); |
Dan Gohman | a0da889 | 2010-09-27 16:28:34 +0000 | [diff] [blame] | 185 | |
Alp Toker | 125be84 | 2014-06-02 01:40:04 +0000 | [diff] [blame] | 186 | args.push_back(nullptr); |
David Greene | 4417b4c | 2009-07-09 17:06:18 +0000 | [diff] [blame] | 187 | |
Alp Toker | 125be84 | 2014-06-02 01:40:04 +0000 | [diff] [blame] | 188 | errs() << "Running 'xdot.py' program... "; |
| 189 | return ExecGraphViewer(ViewerPath, args, Filename, wait, ErrMsg); |
| 190 | } |
| 191 | |
Michael Kruse | c1c9f8a | 2015-08-18 12:17:37 +0000 | [diff] [blame] | 192 | enum ViewerKind { |
| 193 | VK_None, |
| 194 | VK_OSXOpen, |
| 195 | VK_XDGOpen, |
| 196 | VK_Ghostview, |
| 197 | VK_CmdStart |
| 198 | }; |
| 199 | ViewerKind Viewer = VK_None; |
Alp Toker | 125be84 | 2014-06-02 01:40:04 +0000 | [diff] [blame] | 200 | #ifdef __APPLE__ |
Michael Kruse | c1c9f8a | 2015-08-18 12:17:37 +0000 | [diff] [blame] | 201 | if (!Viewer && S.TryFindProgram("open", ViewerPath)) |
| 202 | Viewer = VK_OSXOpen; |
David Greene | 4417b4c | 2009-07-09 17:06:18 +0000 | [diff] [blame] | 203 | #endif |
Michael Kruse | c1c9f8a | 2015-08-18 12:17:37 +0000 | [diff] [blame] | 204 | if (!Viewer && S.TryFindProgram("gv", ViewerPath)) |
| 205 | Viewer = VK_Ghostview; |
| 206 | if (!Viewer && S.TryFindProgram("xdg-open", ViewerPath)) |
| 207 | Viewer = VK_XDGOpen; |
| 208 | #ifdef LLVM_ON_WIN32 |
| 209 | if (!Viewer && S.TryFindProgram("cmd", ViewerPath)) { |
| 210 | Viewer = VK_CmdStart; |
| 211 | } |
| 212 | #endif |
David Greene | 4417b4c | 2009-07-09 17:06:18 +0000 | [diff] [blame] | 213 | |
Michael Kruse | c1c9f8a | 2015-08-18 12:17:37 +0000 | [diff] [blame] | 214 | // PostScript or PDF graph generator + PostScript/PDF viewer |
Alp Toker | 125be84 | 2014-06-02 01:40:04 +0000 | [diff] [blame] | 215 | std::string GeneratorPath; |
Michael Kruse | c1c9f8a | 2015-08-18 12:17:37 +0000 | [diff] [blame] | 216 | if (Viewer && |
Alp Toker | 125be84 | 2014-06-02 01:40:04 +0000 | [diff] [blame] | 217 | (S.TryFindProgram(getProgramName(program), GeneratorPath) || |
Alp Toker | 54b6ab0 | 2014-06-02 04:14:23 +0000 | [diff] [blame] | 218 | S.TryFindProgram("dot|fdp|neato|twopi|circo", GeneratorPath))) { |
Michael Kruse | c1c9f8a | 2015-08-18 12:17:37 +0000 | [diff] [blame] | 219 | std::string OutputFilename = |
| 220 | Filename + (Viewer == VK_CmdStart ? ".pdf" : ".ps"); |
Reid Spencer | ee7eaa2 | 2006-06-27 16:49:46 +0000 | [diff] [blame] | 221 | |
Alp Toker | 125be84 | 2014-06-02 01:40:04 +0000 | [diff] [blame] | 222 | std::vector<const char *> args; |
| 223 | args.push_back(GeneratorPath.c_str()); |
Michael Kruse | c1c9f8a | 2015-08-18 12:17:37 +0000 | [diff] [blame] | 224 | if (Viewer == VK_CmdStart) |
| 225 | args.push_back("-Tpdf"); |
| 226 | else |
| 227 | args.push_back("-Tps"); |
Alp Toker | 125be84 | 2014-06-02 01:40:04 +0000 | [diff] [blame] | 228 | args.push_back("-Nfontname=Courier"); |
| 229 | args.push_back("-Gsize=7.5,10"); |
| 230 | args.push_back(Filename.c_str()); |
| 231 | args.push_back("-o"); |
Michael Kruse | c1c9f8a | 2015-08-18 12:17:37 +0000 | [diff] [blame] | 232 | args.push_back(OutputFilename.c_str()); |
Alp Toker | 125be84 | 2014-06-02 01:40:04 +0000 | [diff] [blame] | 233 | args.push_back(nullptr); |
Andrew Trick | edbb3b2 | 2012-03-07 00:18:27 +0000 | [diff] [blame] | 234 | |
Alp Toker | 125be84 | 2014-06-02 01:40:04 +0000 | [diff] [blame] | 235 | errs() << "Running '" << GeneratorPath << "' program... "; |
David Greene | 9dadbbd | 2009-07-08 21:53:41 +0000 | [diff] [blame] | 236 | |
Michael Kruse | c1c9f8a | 2015-08-18 12:17:37 +0000 | [diff] [blame] | 237 | if (ExecGraphViewer(GeneratorPath, args, Filename, wait, ErrMsg)) |
Alp Toker | 125be84 | 2014-06-02 01:40:04 +0000 | [diff] [blame] | 238 | return true; |
Reid Spencer | ee7eaa2 | 2006-06-27 16:49:46 +0000 | [diff] [blame] | 239 | |
Michael Kruse | c1c9f8a | 2015-08-18 12:17:37 +0000 | [diff] [blame] | 240 | // The lifetime of StartArg must include the call of ExecGraphViewer |
| 241 | // because the args are passed as vector of char*. |
| 242 | std::string StartArg; |
| 243 | |
Alp Toker | 125be84 | 2014-06-02 01:40:04 +0000 | [diff] [blame] | 244 | args.clear(); |
| 245 | args.push_back(ViewerPath.c_str()); |
Michael Kruse | c1c9f8a | 2015-08-18 12:17:37 +0000 | [diff] [blame] | 246 | switch (Viewer) { |
| 247 | case VK_OSXOpen: |
Alp Toker | 125be84 | 2014-06-02 01:40:04 +0000 | [diff] [blame] | 248 | args.push_back("-W"); |
Michael Kruse | c1c9f8a | 2015-08-18 12:17:37 +0000 | [diff] [blame] | 249 | args.push_back(OutputFilename.c_str()); |
Alp Toker | 125be84 | 2014-06-02 01:40:04 +0000 | [diff] [blame] | 250 | break; |
Michael Kruse | c1c9f8a | 2015-08-18 12:17:37 +0000 | [diff] [blame] | 251 | case VK_XDGOpen: |
Alp Toker | e3fbe2c | 2014-06-04 03:57:44 +0000 | [diff] [blame] | 252 | wait = false; |
Michael Kruse | c1c9f8a | 2015-08-18 12:17:37 +0000 | [diff] [blame] | 253 | args.push_back(OutputFilename.c_str()); |
Alp Toker | e3fbe2c | 2014-06-04 03:57:44 +0000 | [diff] [blame] | 254 | break; |
Michael Kruse | c1c9f8a | 2015-08-18 12:17:37 +0000 | [diff] [blame] | 255 | case VK_Ghostview: |
Alp Toker | 125be84 | 2014-06-02 01:40:04 +0000 | [diff] [blame] | 256 | args.push_back("--spartan"); |
Michael Kruse | c1c9f8a | 2015-08-18 12:17:37 +0000 | [diff] [blame] | 257 | args.push_back(OutputFilename.c_str()); |
Alp Toker | 125be84 | 2014-06-02 01:40:04 +0000 | [diff] [blame] | 258 | break; |
Michael Kruse | c1c9f8a | 2015-08-18 12:17:37 +0000 | [diff] [blame] | 259 | case VK_CmdStart: |
| 260 | args.push_back("/S"); |
| 261 | args.push_back("/C"); |
| 262 | StartArg = |
| 263 | (StringRef("start ") + (wait ? "/WAIT " : "") + OutputFilename).str(); |
| 264 | args.push_back(StartArg.c_str()); |
| 265 | break; |
| 266 | case VK_None: |
Alp Toker | 125be84 | 2014-06-02 01:40:04 +0000 | [diff] [blame] | 267 | llvm_unreachable("Invalid viewer"); |
| 268 | } |
| 269 | args.push_back(nullptr); |
Andrew Trick | edbb3b2 | 2012-03-07 00:18:27 +0000 | [diff] [blame] | 270 | |
Alp Toker | 125be84 | 2014-06-02 01:40:04 +0000 | [diff] [blame] | 271 | ErrMsg.clear(); |
Michael Kruse | c1c9f8a | 2015-08-18 12:17:37 +0000 | [diff] [blame] | 272 | return ExecGraphViewer(ViewerPath, args, OutputFilename, wait, ErrMsg); |
Alp Toker | 125be84 | 2014-06-02 01:40:04 +0000 | [diff] [blame] | 273 | } |
Andrew Trick | edbb3b2 | 2012-03-07 00:18:27 +0000 | [diff] [blame] | 274 | |
Alp Toker | 125be84 | 2014-06-02 01:40:04 +0000 | [diff] [blame] | 275 | // dotty |
| 276 | if (S.TryFindProgram("dotty", ViewerPath)) { |
| 277 | std::vector<const char *> args; |
| 278 | args.push_back(ViewerPath.c_str()); |
| 279 | args.push_back(Filename.c_str()); |
| 280 | args.push_back(nullptr); |
Andrew Trick | edbb3b2 | 2012-03-07 00:18:27 +0000 | [diff] [blame] | 281 | |
Chris Lattner | 33154c1 | 2010-04-13 04:35:39 +0000 | [diff] [blame] | 282 | // Dotty spawns another app and doesn't wait until it returns |
Alp Toker | 125be84 | 2014-06-02 01:40:04 +0000 | [diff] [blame] | 283 | #ifdef LLVM_ON_WIN32 |
| 284 | wait = false; |
Reid Spencer | ee7eaa2 | 2006-06-27 16:49:46 +0000 | [diff] [blame] | 285 | #endif |
Alp Toker | 125be84 | 2014-06-02 01:40:04 +0000 | [diff] [blame] | 286 | errs() << "Running 'dotty' program... "; |
| 287 | return ExecGraphViewer(ViewerPath, args, Filename, wait, ErrMsg); |
| 288 | } |
| 289 | |
| 290 | errs() << "Error: Couldn't find a usable graph viewer program:\n"; |
| 291 | errs() << S.LogBuffer << "\n"; |
| 292 | return true; |
Reid Spencer | ee7eaa2 | 2006-06-27 16:49:46 +0000 | [diff] [blame] | 293 | } |