diff options
author | Andrew Trick <atrick@apple.com> | 2013-01-25 07:45:25 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2013-01-25 07:45:25 +0000 |
commit | c6ada8e5f38168f13830e448f2b9e2d8e3eac72b (patch) | |
tree | 4ea636736947bf200b145430436b821c5a4c50f8 /include/llvm/Support/GraphWriter.h | |
parent | a5a73ad15905c18843a8312bb3f20f5c501744de (diff) | |
download | external_llvm-c6ada8e5f38168f13830e448f2b9e2d8e3eac72b.zip external_llvm-c6ada8e5f38168f13830e448f2b9e2d8e3eac72b.tar.gz external_llvm-c6ada8e5f38168f13830e448f2b9e2d8e3eac72b.tar.bz2 |
ScheduleDAG: colorize the DOT graph and improve formatting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173431 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/GraphWriter.h')
-rw-r--r-- | include/llvm/Support/GraphWriter.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/llvm/Support/GraphWriter.h b/include/llvm/Support/GraphWriter.h index 30cfe61..22181d4 100644 --- a/include/llvm/Support/GraphWriter.h +++ b/include/llvm/Support/GraphWriter.h @@ -34,6 +34,10 @@ namespace llvm { namespace DOT { // Private functions... std::string EscapeString(const std::string &Label); + + /// \brief Get a color string for this node number. Simply round-robin selects + /// from a reasonable number of colors. + StringRef getColorString(unsigned NodeNumber); } namespace GraphProgram { @@ -173,6 +177,10 @@ public: // 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 NodeDesc = DTraits.getNodeDescription(Node, G); + if (!NodeDesc.empty()) + O << "|" << DOT::EscapeString(NodeDesc); } std::string edgeSourceLabels; @@ -193,6 +201,10 @@ public: // 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 NodeDesc = DTraits.getNodeDescription(Node, G); + if (!NodeDesc.empty()) + O << "|" << DOT::EscapeString(NodeDesc); } if (DTraits.hasEdgeDestLabels()) { |