diff options
author | Chris Lattner <sabre@nondot.org> | 2003-02-05 19:40:59 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-02-05 19:40:59 +0000 |
commit | a329733f471a51d64dadbc4ac400c7e54d94358b (patch) | |
tree | 0292ec0efab8d8e2df86344d5affd44b746dde85 | |
parent | b8925bce833b85227be9c5534e8ac8e6f1ba437c (diff) |
Allow the addition of edge source labels
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5493 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/Support/GraphWriter.h | 5 | ||||
-rw-r--r-- | include/llvm/Support/GraphWriter.h | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/include/Support/GraphWriter.h b/include/Support/GraphWriter.h index 5481274a3f..3b7b357554 100644 --- a/include/Support/GraphWriter.h +++ b/include/Support/GraphWriter.h @@ -18,6 +18,7 @@ #include "Support/DOTGraphTraits.h" #include "Support/GraphTraits.h" +#include <vector> #include <iostream> namespace DOT { // Private functions... @@ -136,7 +137,8 @@ public: /// emitSimpleNode - Outputs a simple (non-record) node void emitSimpleNode(const void *ID, const std::string &Attr, - const std::string &Label, unsigned NumEdgeSources = 0) { + const std::string &Label, unsigned NumEdgeSources = 0, + const std::vector<std::string> *EdgeSourceLabels = 0) { O << "\tNode" << ID << "[ "; if (!Attr.empty()) O << Attr << ","; @@ -149,6 +151,7 @@ public: for (unsigned i = 0; i != NumEdgeSources; ++i) { if (i) O << "|"; O << "<g" << i << ">"; + if (EdgeSourceLabels) O << (*EdgeSourceLabels)[i]; } O << "}}"; } diff --git a/include/llvm/Support/GraphWriter.h b/include/llvm/Support/GraphWriter.h index 5481274a3f..3b7b357554 100644 --- a/include/llvm/Support/GraphWriter.h +++ b/include/llvm/Support/GraphWriter.h @@ -18,6 +18,7 @@ #include "Support/DOTGraphTraits.h" #include "Support/GraphTraits.h" +#include <vector> #include <iostream> namespace DOT { // Private functions... @@ -136,7 +137,8 @@ public: /// emitSimpleNode - Outputs a simple (non-record) node void emitSimpleNode(const void *ID, const std::string &Attr, - const std::string &Label, unsigned NumEdgeSources = 0) { + const std::string &Label, unsigned NumEdgeSources = 0, + const std::vector<std::string> *EdgeSourceLabels = 0) { O << "\tNode" << ID << "[ "; if (!Attr.empty()) O << Attr << ","; @@ -149,6 +151,7 @@ public: for (unsigned i = 0; i != NumEdgeSources; ++i) { if (i) O << "|"; O << "<g" << i << ">"; + if (EdgeSourceLabels) O << (*EdgeSourceLabels)[i]; } O << "}}"; } |