blob: ea86c0d591c5beb2a62f5e2ed8d78b2a34ca857f [file] [log] [blame]
Chris Lattner66328482005-01-10 23:08:40 +00001//===-- SelectionDAGPrinter.cpp - Implement SelectionDAG::viewGraph() -----===//
Misha Brukmanedf128a2005-04-21 22:36:52 +00002//
Chris Lattner66328482005-01-10 23:08:40 +00003// The LLVM Compiler Infrastructure
4//
Chris Lattner4ee451d2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Misha Brukmanedf128a2005-04-21 22:36:52 +00007//
Chris Lattner66328482005-01-10 23:08:40 +00008//===----------------------------------------------------------------------===//
9//
10// This implements the SelectionDAG::viewGraph method.
11//
12//===----------------------------------------------------------------------===//
13
Chris Lattner5839bf22005-08-26 17:15:30 +000014#include "llvm/Constants.h"
15#include "llvm/Function.h"
Chris Lattner52676512006-03-05 09:38:03 +000016#include "llvm/Assembly/Writer.h"
Chris Lattner66328482005-01-10 23:08:40 +000017#include "llvm/CodeGen/SelectionDAG.h"
Dan Gohman3e1a7ae2007-08-28 20:32:58 +000018#include "llvm/CodeGen/ScheduleDAG.h"
Evan Chengd6594ae2006-09-12 21:00:35 +000019#include "llvm/CodeGen/MachineConstantPool.h"
Chris Lattner66328482005-01-10 23:08:40 +000020#include "llvm/CodeGen/MachineFunction.h"
Bill Wendling10fff602008-07-03 22:53:42 +000021#include "llvm/CodeGen/MachineModuleInfo.h"
Dan Gohmandc5f9362008-07-17 21:12:16 +000022#include "llvm/CodeGen/PseudoSourceValue.h"
Dan Gohman6f0d0242008-02-10 18:45:23 +000023#include "llvm/Target/TargetRegisterInfo.h"
Chris Lattner7228aa72005-08-19 21:21:16 +000024#include "llvm/Target/TargetMachine.h"
Chris Lattner66328482005-01-10 23:08:40 +000025#include "llvm/Support/GraphWriter.h"
Chris Lattnere9c44cd2005-01-11 00:34:33 +000026#include "llvm/ADT/StringExtras.h"
Chris Lattner6e741f82005-07-15 22:48:31 +000027#include "llvm/Config/config.h"
Chris Lattner66328482005-01-10 23:08:40 +000028#include <fstream>
Chris Lattner52676512006-03-05 09:38:03 +000029#include <sstream>
Chris Lattner66328482005-01-10 23:08:40 +000030using namespace llvm;
31
Chris Lattnere0646b82005-01-10 23:26:00 +000032namespace llvm {
33 template<>
34 struct DOTGraphTraits<SelectionDAG*> : public DefaultDOTGraphTraits {
Dan Gohman35803312008-07-21 21:06:55 +000035 static bool hasEdgeDestLabels() {
36 return true;
37 }
38
39 static unsigned numEdgeDestLabels(const void *Node) {
40 return ((const SDNode *) Node)->getNumValues();
41 }
42
43 static std::string getEdgeDestLabel(const void *Node, unsigned i) {
44 return ((const SDNode *) Node)->getValueType(i).getMVTString();
45 }
46
47 /// edgeTargetsEdgeSource - This method returns true if this outgoing edge
48 /// should actually target another edge source, not a node. If this method is
49 /// implemented, getEdgeTarget should be implemented.
50 template<typename EdgeIter>
51 static bool edgeTargetsEdgeSource(const void *Node, EdgeIter I) {
52 return true;
53 }
54
55 /// getEdgeTarget - If edgeTargetsEdgeSource returns true, this method is
56 /// called to determine which outgoing edge of Node is the target of this
57 /// edge.
58 template<typename EdgeIter>
59 static EdgeIter getEdgeTarget(const void *Node, EdgeIter I) {
60 SDNode *TargetNode = *I;
61 SDNodeIterator NI = SDNodeIterator::begin(TargetNode);
62 std::advance(NI, I.getNode()->getOperand(I.getOperand()).ResNo);
63 return NI;
64 }
65
Chris Lattnere0646b82005-01-10 23:26:00 +000066 static std::string getGraphName(const SelectionDAG *G) {
67 return G->getMachineFunction().getFunction()->getName();
68 }
Chris Lattnere9c44cd2005-01-11 00:34:33 +000069
70 static bool renderGraphFromBottomUp() {
71 return true;
Chris Lattnere0646b82005-01-10 23:26:00 +000072 }
Chris Lattner37345fe2005-10-01 00:17:07 +000073
74 static bool hasNodeAddressLabel(const SDNode *Node,
75 const SelectionDAG *Graph) {
76 return true;
77 }
Chris Lattner34ab4d42006-10-20 18:06:09 +000078
79 /// If you want to override the dot attributes printed for a particular
80 /// edge, override this method.
81 template<typename EdgeIter>
82 static std::string getEdgeAttributes(const void *Node, EdgeIter EI) {
Dan Gohman475871a2008-07-27 21:46:04 +000083 SDValue Op = EI.getNode()->getOperand(EI.getOperand());
Duncan Sands83ec4b62008-06-06 12:08:01 +000084 MVT VT = Op.getValueType();
Chris Lattner34ab4d42006-10-20 18:06:09 +000085 if (VT == MVT::Flag)
86 return "color=red,style=bold";
87 else if (VT == MVT::Other)
Dan Gohman7a0a4fc2007-06-18 15:30:16 +000088 return "color=blue,style=dashed";
Chris Lattner34ab4d42006-10-20 18:06:09 +000089 return "";
90 }
91
Chris Lattnere0646b82005-01-10 23:26:00 +000092
Chris Lattnere9c44cd2005-01-11 00:34:33 +000093 static std::string getNodeLabel(const SDNode *Node,
94 const SelectionDAG *Graph);
Jim Laskeyec204022006-10-02 12:26:53 +000095 static std::string getNodeAttributes(const SDNode *N,
96 const SelectionDAG *Graph) {
97#ifndef NDEBUG
98 const std::string &Attrs = Graph->getGraphAttrs(N);
99 if (!Attrs.empty()) {
100 if (Attrs.find("shape=") == std::string::npos)
101 return std::string("shape=Mrecord,") + Attrs;
102 else
103 return Attrs;
104 }
105#endif
Chris Lattnere0646b82005-01-10 23:26:00 +0000106 return "shape=Mrecord";
107 }
Chris Lattnerfc08d9c2005-01-10 23:52:04 +0000108
109 static void addCustomGraphFeatures(SelectionDAG *G,
110 GraphWriter<SelectionDAG*> &GW) {
111 GW.emitSimpleNode(0, "plaintext=circle", "GraphRoot");
Jim Laskey26f7fa72006-10-17 19:33:52 +0000112 if (G->getRoot().Val)
Dan Gohman694caf52008-07-22 17:52:59 +0000113 GW.emitEdge(0, -1, G->getRoot().Val, G->getRoot().ResNo,
114 "color=blue,style=dashed");
Chris Lattnerfc08d9c2005-01-10 23:52:04 +0000115 }
Chris Lattnere0646b82005-01-10 23:26:00 +0000116 };
117}
118
Chris Lattnere9c44cd2005-01-11 00:34:33 +0000119std::string DOTGraphTraits<SelectionDAG*>::getNodeLabel(const SDNode *Node,
120 const SelectionDAG *G) {
Chris Lattnerad95d6a2005-08-16 18:31:23 +0000121 std::string Op = Node->getOperationName(G);
Chris Lattnerc871e1d2005-01-11 22:21:04 +0000122
Chris Lattnere9c44cd2005-01-11 00:34:33 +0000123 if (const ConstantSDNode *CSDN = dyn_cast<ConstantSDNode>(Node)) {
124 Op += ": " + utostr(CSDN->getValue());
125 } else if (const ConstantFPSDNode *CSDN = dyn_cast<ConstantFPSDNode>(Node)) {
Dale Johanneseneaf08942007-08-31 04:03:46 +0000126 Op += ": " + ftostr(CSDN->getValueAPF());
Misha Brukmanedf128a2005-04-21 22:36:52 +0000127 } else if (const GlobalAddressSDNode *GADN =
Chris Lattnere9c44cd2005-01-11 00:34:33 +0000128 dyn_cast<GlobalAddressSDNode>(Node)) {
Evan Cheng61ca74b2005-11-30 02:04:11 +0000129 int offset = GADN->getOffset();
Chris Lattnere9c44cd2005-01-11 00:34:33 +0000130 Op += ": " + GADN->getGlobal()->getName();
Evan Cheng61ca74b2005-11-30 02:04:11 +0000131 if (offset > 0)
132 Op += "+" + itostr(offset);
133 else
134 Op += itostr(offset);
Misha Brukmandedf2bd2005-04-22 04:01:18 +0000135 } else if (const FrameIndexSDNode *FIDN = dyn_cast<FrameIndexSDNode>(Node)) {
Chris Lattnere9c44cd2005-01-11 00:34:33 +0000136 Op += " " + itostr(FIDN->getIndex());
Evan Cheng6cc31ae2006-11-01 04:48:30 +0000137 } else if (const JumpTableSDNode *JTDN = dyn_cast<JumpTableSDNode>(Node)) {
138 Op += " " + itostr(JTDN->getIndex());
Chris Lattnere9c44cd2005-01-11 00:34:33 +0000139 } else if (const ConstantPoolSDNode *CP = dyn_cast<ConstantPoolSDNode>(Node)){
Evan Chengd6594ae2006-09-12 21:00:35 +0000140 if (CP->isMachineConstantPoolEntry()) {
Chris Lattner52676512006-03-05 09:38:03 +0000141 std::ostringstream SS;
Evan Chengd6594ae2006-09-12 21:00:35 +0000142 CP->getMachineCPVal()->print(SS);
Chris Lattner52676512006-03-05 09:38:03 +0000143 Op += "<" + SS.str() + ">";
Evan Chengd6594ae2006-09-12 21:00:35 +0000144 } else {
145 if (ConstantFP *CFP = dyn_cast<ConstantFP>(CP->getConstVal()))
Dale Johanneseneaf08942007-08-31 04:03:46 +0000146 Op += "<" + ftostr(CFP->getValueAPF()) + ">";
Evan Chengd6594ae2006-09-12 21:00:35 +0000147 else if (ConstantInt *CI = dyn_cast<ConstantInt>(CP->getConstVal()))
148 Op += "<" + utostr(CI->getZExtValue()) + ">";
149 else {
150 std::ostringstream SS;
151 WriteAsOperand(SS, CP->getConstVal(), false);
152 Op += "<" + SS.str() + ">";
153 }
Chris Lattner52676512006-03-05 09:38:03 +0000154 }
Misha Brukmandedf2bd2005-04-22 04:01:18 +0000155 } else if (const BasicBlockSDNode *BBDN = dyn_cast<BasicBlockSDNode>(Node)) {
Chris Lattnere9c44cd2005-01-11 00:34:33 +0000156 Op = "BB: ";
157 const Value *LBB = (const Value*)BBDN->getBasicBlock()->getBasicBlock();
158 if (LBB)
159 Op += LBB->getName();
160 //Op += " " + (const void*)BBDN->getBasicBlock();
Chris Lattnerd5d0f9b2005-08-16 21:55:35 +0000161 } else if (const RegisterSDNode *R = dyn_cast<RegisterSDNode>(Node)) {
Chris Lattner34ab4d42006-10-20 18:06:09 +0000162 if (G && R->getReg() != 0 &&
Dan Gohman6f0d0242008-02-10 18:45:23 +0000163 TargetRegisterInfo::isPhysicalRegister(R->getReg())) {
Bill Wendling74ab84c2008-02-26 21:11:01 +0000164 Op = Op + " " +
Bill Wendling6ef781f2008-02-27 06:33:05 +0000165 G->getTarget().getRegisterInfo()->getName(R->getReg());
Chris Lattner7228aa72005-08-19 21:21:16 +0000166 } else {
167 Op += " #" + utostr(R->getReg());
168 }
Dan Gohman7f460202008-06-30 20:59:49 +0000169 } else if (const DbgStopPointSDNode *D = dyn_cast<DbgStopPointSDNode>(Node)) {
170 Op += ": " + D->getCompileUnit()->getFileName();
171 Op += ":" + utostr(D->getLine());
172 if (D->getColumn() != 0)
173 Op += ":" + utostr(D->getColumn());
Dan Gohman44066042008-07-01 00:05:16 +0000174 } else if (const LabelSDNode *L = dyn_cast<LabelSDNode>(Node)) {
175 Op += ": LabelID=" + utostr(L->getLabelID());
Chris Lattnere9c44cd2005-01-11 00:34:33 +0000176 } else if (const ExternalSymbolSDNode *ES =
177 dyn_cast<ExternalSymbolSDNode>(Node)) {
178 Op += "'" + std::string(ES->getSymbol()) + "'";
Chris Lattner2bf3c262005-05-09 04:08:27 +0000179 } else if (const SrcValueSDNode *M = dyn_cast<SrcValueSDNode>(Node)) {
180 if (M->getValue())
Dan Gohman69de1932008-02-06 22:27:42 +0000181 Op += "<" + M->getValue()->getName() + ">";
Chris Lattner2bf3c262005-05-09 04:08:27 +0000182 else
Dan Gohman69de1932008-02-06 22:27:42 +0000183 Op += "<null>";
184 } else if (const MemOperandSDNode *M = dyn_cast<MemOperandSDNode>(Node)) {
Dan Gohmandc5f9362008-07-17 21:12:16 +0000185 const Value *V = M->MO.getValue();
186 Op += '<';
187 if (!V) {
188 Op += "(unknown)";
Duncan Sandsf8ac6452008-07-18 21:07:41 +0000189 } else if (isa<PseudoSourceValue>(V)) {
Dan Gohmandc5f9362008-07-17 21:12:16 +0000190 // PseudoSourceValues don't have names, so use their print method.
Dan Gohman91d49f52008-07-14 17:51:24 +0000191 std::ostringstream SS;
192 M->MO.getValue()->print(SS);
Dan Gohmandc5f9362008-07-17 21:12:16 +0000193 Op += SS.str();
Dan Gohman91d49f52008-07-14 17:51:24 +0000194 } else {
Dan Gohmandc5f9362008-07-17 21:12:16 +0000195 Op += V->getName();
Dan Gohman91d49f52008-07-14 17:51:24 +0000196 }
Dan Gohmandc5f9362008-07-17 21:12:16 +0000197 Op += '+' + itostr(M->MO.getOffset()) + '>';
Duncan Sands276dcbd2008-03-21 09:14:45 +0000198 } else if (const ARG_FLAGSSDNode *N = dyn_cast<ARG_FLAGSSDNode>(Node)) {
199 Op = Op + " AF=" + N->getArgFlags().getArgFlagsString();
Chris Lattnera23e8152005-08-18 03:31:02 +0000200 } else if (const VTSDNode *N = dyn_cast<VTSDNode>(Node)) {
Duncan Sands83ec4b62008-06-06 12:08:01 +0000201 Op = Op + " VT=" + N->getVT().getMVTString();
Evan Cheng45aeccc2006-10-10 20:11:26 +0000202 } else if (const LoadSDNode *LD = dyn_cast<LoadSDNode>(Node)) {
203 bool doExt = true;
204 switch (LD->getExtensionType()) {
205 default: doExt = false; break;
206 case ISD::EXTLOAD:
207 Op = Op + "<anyext ";
208 break;
209 case ISD::SEXTLOAD:
210 Op = Op + " <sext ";
211 break;
212 case ISD::ZEXTLOAD:
213 Op = Op + " <zext ";
214 break;
215 }
216 if (doExt)
Duncan Sands83ec4b62008-06-06 12:08:01 +0000217 Op += LD->getMemoryVT().getMVTString() + ">";
Chris Lattner94ffc7e2008-01-25 06:40:45 +0000218 if (LD->isVolatile())
219 Op += "<V>";
Evan Cheng00305822006-11-09 18:44:21 +0000220 Op += LD->getIndexedModeName(LD->getAddressingMode());
Chris Lattner94ffc7e2008-01-25 06:40:45 +0000221 if (LD->getAlignment() > 1)
222 Op += " A=" + utostr(LD->getAlignment());
Evan Cheng649b7ef2006-10-17 21:18:26 +0000223 } else if (const StoreSDNode *ST = dyn_cast<StoreSDNode>(Node)) {
224 if (ST->isTruncatingStore())
Duncan Sands83ec4b62008-06-06 12:08:01 +0000225 Op += "<trunc " + ST->getMemoryVT().getMVTString() + ">";
Chris Lattner94ffc7e2008-01-25 06:40:45 +0000226 if (ST->isVolatile())
227 Op += "<V>";
Evan Cheng00305822006-11-09 18:44:21 +0000228 Op += ST->getIndexedModeName(ST->getAddressingMode());
Chris Lattner94ffc7e2008-01-25 06:40:45 +0000229 if (ST->getAlignment() > 1)
230 Op += " A=" + utostr(ST->getAlignment());
Chris Lattnere9c44cd2005-01-11 00:34:33 +0000231 }
Chris Lattner59afba02007-10-15 05:32:43 +0000232
233#if 0
234 Op += " Id=" + itostr(Node->getNodeId());
235#endif
Chris Lattner36ce6912005-11-29 06:21:05 +0000236
Chris Lattnere9c44cd2005-01-11 00:34:33 +0000237 return Op;
238}
Misha Brukmanedf128a2005-04-21 22:36:52 +0000239
Chris Lattnere9c44cd2005-01-11 00:34:33 +0000240
Chris Lattner66328482005-01-10 23:08:40 +0000241/// viewGraph - Pop up a ghostview window with the reachable parts of the DAG
242/// rendered using 'dot'.
243///
Dan Gohman462dc7f2008-07-21 20:00:07 +0000244void SelectionDAG::viewGraph(const std::string &Title) {
Chris Lattnere388b5e2005-07-14 05:17:43 +0000245// This code is only for debugging!
Chris Lattnerc5f44ad2005-07-14 05:33:13 +0000246#ifndef NDEBUG
Dan Gohman462dc7f2008-07-21 20:00:07 +0000247 ViewGraph(this, "dag." + getMachineFunction().getFunction()->getName(),
248 Title);
Reid Spencer9d5b5322006-06-27 16:49:46 +0000249#else
Bill Wendling832171c2006-12-07 20:04:42 +0000250 cerr << "SelectionDAG::viewGraph is only available in debug builds on "
251 << "systems with Graphviz or gv!\n";
Reid Spencer9d5b5322006-06-27 16:49:46 +0000252#endif // NDEBUG
Chris Lattner66328482005-01-10 23:08:40 +0000253}
Jim Laskeyec204022006-10-02 12:26:53 +0000254
Dan Gohman0b12aef2008-07-30 18:48:53 +0000255// This overload is defined out-of-line here instead of just using a
256// default parameter because this is easiest for gdb to call.
257void SelectionDAG::viewGraph() {
258 viewGraph("");
259}
Jim Laskeyec204022006-10-02 12:26:53 +0000260
261/// clearGraphAttrs - Clear all previously defined node graph attributes.
262/// Intended to be used from a debugging tool (eg. gdb).
263void SelectionDAG::clearGraphAttrs() {
264#ifndef NDEBUG
265 NodeGraphAttrs.clear();
266#else
Bill Wendling832171c2006-12-07 20:04:42 +0000267 cerr << "SelectionDAG::clearGraphAttrs is only available in debug builds"
268 << " on systems with Graphviz or gv!\n";
Jim Laskeyec204022006-10-02 12:26:53 +0000269#endif
270}
271
272
273/// setGraphAttrs - Set graph attributes for a node. (eg. "color=red".)
274///
275void SelectionDAG::setGraphAttrs(const SDNode *N, const char *Attrs) {
276#ifndef NDEBUG
277 NodeGraphAttrs[N] = Attrs;
278#else
Bill Wendling832171c2006-12-07 20:04:42 +0000279 cerr << "SelectionDAG::setGraphAttrs is only available in debug builds"
280 << " on systems with Graphviz or gv!\n";
Jim Laskeyec204022006-10-02 12:26:53 +0000281#endif
282}
283
284
285/// getGraphAttrs - Get graph attributes for a node. (eg. "color=red".)
286/// Used from getNodeAttributes.
287const std::string SelectionDAG::getGraphAttrs(const SDNode *N) const {
288#ifndef NDEBUG
289 std::map<const SDNode *, std::string>::const_iterator I =
290 NodeGraphAttrs.find(N);
291
292 if (I != NodeGraphAttrs.end())
293 return I->second;
294 else
295 return "";
296#else
Bill Wendling832171c2006-12-07 20:04:42 +0000297 cerr << "SelectionDAG::getGraphAttrs is only available in debug builds"
298 << " on systems with Graphviz or gv!\n";
Jim Laskeyec204022006-10-02 12:26:53 +0000299 return std::string("");
300#endif
301}
302
303/// setGraphColor - Convenience for setting node color attribute.
304///
305void SelectionDAG::setGraphColor(const SDNode *N, const char *Color) {
306#ifndef NDEBUG
307 NodeGraphAttrs[N] = std::string("color=") + Color;
308#else
Bill Wendling832171c2006-12-07 20:04:42 +0000309 cerr << "SelectionDAG::setGraphColor is only available in debug builds"
310 << " on systems with Graphviz or gv!\n";
Jim Laskeyec204022006-10-02 12:26:53 +0000311#endif
312}
313
Dan Gohman3e1a7ae2007-08-28 20:32:58 +0000314namespace llvm {
315 template<>
316 struct DOTGraphTraits<ScheduleDAG*> : public DefaultDOTGraphTraits {
317 static std::string getGraphName(const ScheduleDAG *G) {
318 return DOTGraphTraits<SelectionDAG*>::getGraphName(&G->DAG);
319 }
320
321 static bool renderGraphFromBottomUp() {
322 return true;
323 }
324
325 static bool hasNodeAddressLabel(const SUnit *Node,
326 const ScheduleDAG *Graph) {
327 return true;
328 }
329
330 /// If you want to override the dot attributes printed for a particular
331 /// edge, override this method.
332 template<typename EdgeIter>
333 static std::string getEdgeAttributes(const void *Node, EdgeIter EI) {
Dan Gohman89bf0a62008-04-14 23:15:07 +0000334 if (EI.isSpecialDep())
335 return "color=cyan,style=dashed";
Evan Cheng713a98d2007-09-19 01:38:40 +0000336 if (EI.isCtrlDep())
Dan Gohman3e1a7ae2007-08-28 20:32:58 +0000337 return "color=blue,style=dashed";
338 return "";
339 }
340
341
342 static std::string getNodeLabel(const SUnit *Node,
343 const ScheduleDAG *Graph);
344 static std::string getNodeAttributes(const SUnit *N,
345 const ScheduleDAG *Graph) {
346 return "shape=Mrecord";
347 }
348
349 static void addCustomGraphFeatures(ScheduleDAG *G,
350 GraphWriter<ScheduleDAG*> &GW) {
351 GW.emitSimpleNode(0, "plaintext=circle", "GraphRoot");
Dan Gohman94d7a5f2008-06-21 19:18:17 +0000352 const SDNode *N = G->DAG.getRoot().Val;
353 if (N && N->getNodeId() != -1)
Dan Gohman29cdb262008-07-27 22:46:49 +0000354 GW.emitEdge(0, -1, &G->SUnits[N->getNodeId()], -1,
355 "color=blue,style=dashed");
Dan Gohman3e1a7ae2007-08-28 20:32:58 +0000356 }
357 };
358}
359
360std::string DOTGraphTraits<ScheduleDAG*>::getNodeLabel(const SUnit *SU,
361 const ScheduleDAG *G) {
362 std::string Op;
363
364 for (unsigned i = 0; i < SU->FlaggedNodes.size(); ++i) {
365 Op += DOTGraphTraits<SelectionDAG*>::getNodeLabel(SU->FlaggedNodes[i],
366 &G->DAG) + "\n";
367 }
368
Dan Gohman4145bd52008-03-21 22:51:06 +0000369 if (SU->Node)
370 Op += DOTGraphTraits<SelectionDAG*>::getNodeLabel(SU->Node, &G->DAG);
371 else
372 Op += "<CROSS RC COPY>";
Dan Gohman3e1a7ae2007-08-28 20:32:58 +0000373
374 return Op;
375}
376
377
378/// viewGraph - Pop up a ghostview window with the reachable parts of the DAG
379/// rendered using 'dot'.
380///
381void ScheduleDAG::viewGraph() {
382// This code is only for debugging!
383#ifndef NDEBUG
Dan Gohman462dc7f2008-07-21 20:00:07 +0000384 ViewGraph(this, "dag." + MF->getFunction()->getName(),
385 "Scheduling-Units Graph for " + MF->getFunction()->getName() + ':' +
386 BB->getBasicBlock()->getName());
Dan Gohman3e1a7ae2007-08-28 20:32:58 +0000387#else
388 cerr << "ScheduleDAG::viewGraph is only available in debug builds on "
389 << "systems with Graphviz or gv!\n";
390#endif // NDEBUG
391}