- O << "label=\"{"
- << DOT::EscapeString(DOTTraits::getNodeLabel(Node, G));
-
- // Print out the fields of the current node...
- child_iterator EI = GTraits::child_begin(Node);
- child_iterator EE = GTraits::child_end(Node);
- if (EI != EE) {
+ O << "label=\"{";
+
+ if (!DTraits.renderGraphFromBottomUp()) {
+ O << DOT::EscapeString(DTraits.getNodeLabel(Node, G));
+
+ // If we should include the address of the node in the label, do so now.
+ if (DTraits.hasNodeAddressLabel(Node, G))
+ O << "|" << static_cast<const void*>(Node);
+ }
+
+ std::string edgeSourceLabels;
+ raw_string_ostream EdgeSourceLabels(edgeSourceLabels);
+ bool hasEdgeSourceLabels = getEdgeSourceLabels(EdgeSourceLabels, Node);
+
+ if (hasEdgeSourceLabels) {
+ if (!DTraits.renderGraphFromBottomUp()) O << "|";
+
+ O << "{" << EdgeSourceLabels.str() << "}";
+
+ if (DTraits.renderGraphFromBottomUp()) O << "|";
+ }
+
+ if (DTraits.renderGraphFromBottomUp()) {
+ O << DOT::EscapeString(DTraits.getNodeLabel(Node, G));
+
+ // If we should include the address of the node in the label, do so now.
+ if (DTraits.hasNodeAddressLabel(Node, G))
+ O << "|" << static_cast<const void*>(Node);
+ }
+
+ if (DTraits.hasEdgeDestLabels()) {