Properly escape edge source and destination labels.
authorDan Gohman <gohman@apple.com>
Fri, 30 Apr 2010 18:27:57 +0000 (18:27 +0000)
committerDan Gohman <gohman@apple.com>
Fri, 30 Apr 2010 18:27:57 +0000 (18:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102728 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/GraphWriter.h

index 28fa92f99e087b0ddf22f1eb2047086913f6dfaa..13e6682ebfd67373c3b582e5efccf931ee440fcd 100644 (file)
@@ -174,7 +174,8 @@ public:
       unsigned i = 0, e = DTraits.numEdgeDestLabels(Node);
       for (; i != e && i != 64; ++i) {
         if (i) O << "|";
-        O << "<d" << i << ">" << DTraits.getEdgeDestLabel(Node, i);
+        O << "<d" << i << ">"
+          << DOT::EscapeString(DTraits.getEdgeDestLabel(Node, i));
       }
 
       if (i != e)
@@ -230,7 +231,7 @@ public:
       for (unsigned i = 0; i != NumEdgeSources; ++i) {
         if (i) O << "|";
         O << "<s" << i << ">";
-        if (EdgeSourceLabels) O << (*EdgeSourceLabels)[i];
+        if (EdgeSourceLabels) O << DOT::EscapeString((*EdgeSourceLabels)[i]);
       }
       O << "}}";
     }