[llvm-commits] CVS: llvm/include/Support/GraphWriter.h

Chris Lattner lattner at cs.uiuc.edu
Sun Nov 10 00:48:01 PST 2002


Changes in directory llvm/include/Support:

GraphWriter.h updated: 1.11 -> 1.12

---
Log message:

Fix a problem where bad graphs could be generated


---
Diffs of the changes:

Index: llvm/include/Support/GraphWriter.h
diff -u llvm/include/Support/GraphWriter.h:1.11 llvm/include/Support/GraphWriter.h:1.12
--- llvm/include/Support/GraphWriter.h:1.11	Sun Oct 27 13:12:37 2002
+++ llvm/include/Support/GraphWriter.h	Sun Nov 10 00:47:03 2002
@@ -126,7 +126,6 @@
         // Figure out which edge this targets...
         unsigned Offset = std::distance(GTraits::child_begin(TargetNode),
                                         TargetIt);
-        if (Offset > 64) Offset = 64;  // Targetting the truncated part?
         DestPort = (int)Offset;
       }
 
@@ -160,6 +159,9 @@
   void emitEdge(const void *SrcNodeID, int SrcNodePort,
                 const void *DestNodeID, int DestNodePort,
                 const std::string &Attrs) {
+    if (SrcNodePort  > 64) return;             // Eminating from truncated part?
+    if (DestNodePort > 64) DestNodePort = 64;  // Targetting the truncated part?
+
     O << "\tNode" << SrcNodeID;
     if (SrcNodePort >= 0)
       O << ":g" << SrcNodePort;





More information about the llvm-commits mailing list