diff options
| author | Dan Gohman <gohman@apple.com> | 2008-07-08 23:33:46 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2008-07-08 23:33:46 +0000 |
| commit | cb2ec30ef632257aa93b1254a4d986a252d3c0f9 (patch) | |
| tree | f2c05accc662f5ad1d1786207250d3be4a61a957 /llvm | |
| parent | 6357f05e19de53920682da23944ee4d482ea522f (diff) | |
| download | bcm5719-llvm-cb2ec30ef632257aa93b1254a4d986a252d3c0f9.tar.gz bcm5719-llvm-cb2ec30ef632257aa93b1254a4d986a252d3c0f9.zip | |
The graph name really does matter for configurations that use gv.
llvm-svn: 53259
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/include/llvm/Support/GraphWriter.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/llvm/include/llvm/Support/GraphWriter.h b/llvm/include/llvm/Support/GraphWriter.h index 833f4a8e089..14a70cb1892 100644 --- a/llvm/include/llvm/Support/GraphWriter.h +++ b/llvm/include/llvm/Support/GraphWriter.h @@ -82,15 +82,18 @@ public: GraphWriter(std::ostream &o, const GraphType &g) : O(o), G(g) {} void writeHeader(const std::string &Name) { - if (Name.empty()) - O << "digraph foo {\n"; // Graph name doesn't matter - else + std::string GraphName = DOTTraits::getGraphName(G); + + if (!Name.empty()) O << "digraph " << Name << " {\n"; + else if (!GraphName.empty()) + O << "digraph " << GraphName << " {\n"; + else + O << "digraph unnamed {\n"; if (DOTTraits::renderGraphFromBottomUp()) O << "\trankdir=\"BT\";\n"; - std::string GraphName = DOTTraits::getGraphName(G); if (!GraphName.empty()) O << "\tlabel=\"" << DOT::EscapeString(GraphName) << "\";\n"; O << DOTTraits::getGraphProperties(G); |

