/Users/buildslave/jenkins/sharedspace/clang-stage2-coverage-R@2/llvm/include/llvm/Support/GraphWriter.h
Line | Count | Source (jump to first uncovered line) |
1 | | //===- llvm/Support/GraphWriter.h - Write graph to a .dot file --*- C++ -*-===// |
2 | | // |
3 | | // The LLVM Compiler Infrastructure |
4 | | // |
5 | | // This file is distributed under the University of Illinois Open Source |
6 | | // License. See LICENSE.TXT for details. |
7 | | // |
8 | | //===----------------------------------------------------------------------===// |
9 | | // |
10 | | // This file defines a simple interface that can be used to print out generic |
11 | | // LLVM graphs to ".dot" files. "dot" is a tool that is part of the AT&T |
12 | | // graphviz package (http://www.research.att.com/sw/tools/graphviz/) which can |
13 | | // be used to turn the files output by this interface into a variety of |
14 | | // different graphics formats. |
15 | | // |
16 | | // Graphs do not need to implement any interface past what is already required |
17 | | // by the GraphTraits template, but they can choose to implement specializations |
18 | | // of the DOTGraphTraits template if they want to customize the graphs output in |
19 | | // any way. |
20 | | // |
21 | | //===----------------------------------------------------------------------===// |
22 | | |
23 | | #ifndef LLVM_SUPPORT_GRAPHWRITER_H |
24 | | #define LLVM_SUPPORT_GRAPHWRITER_H |
25 | | |
26 | | #include "llvm/ADT/GraphTraits.h" |
27 | | #include "llvm/ADT/StringRef.h" |
28 | | #include "llvm/ADT/Twine.h" |
29 | | #include "llvm/Support/DOTGraphTraits.h" |
30 | | #include "llvm/Support/raw_ostream.h" |
31 | | #include <algorithm> |
32 | | #include <cstddef> |
33 | | #include <iterator> |
34 | | #include <string> |
35 | | #include <type_traits> |
36 | | #include <vector> |
37 | | |
38 | | namespace llvm { |
39 | | |
40 | | namespace DOT { // Private functions... |
41 | | |
42 | | std::string EscapeString(const std::string &Label); |
43 | | |
44 | | /// \brief Get a color string for this node number. Simply round-robin selects |
45 | | /// from a reasonable number of colors. |
46 | | StringRef getColorString(unsigned NodeNumber); |
47 | | |
48 | | } // end namespace DOT |
49 | | |
50 | | namespace GraphProgram { |
51 | | |
52 | | enum Name { |
53 | | DOT, |
54 | | FDP, |
55 | | NEATO, |
56 | | TWOPI, |
57 | | CIRCO |
58 | | }; |
59 | | |
60 | | } // end namespace GraphProgram |
61 | | |
62 | | bool DisplayGraph(StringRef Filename, bool wait = true, |
63 | | GraphProgram::Name program = GraphProgram::DOT); |
64 | | |
65 | | template<typename GraphType> |
66 | | class GraphWriter { |
67 | | raw_ostream &O; |
68 | | const GraphType &G; |
69 | | |
70 | | using DOTTraits = DOTGraphTraits<GraphType>; |
71 | | using GTraits = GraphTraits<GraphType>; |
72 | | using NodeRef = typename GTraits::NodeRef; |
73 | | using node_iterator = typename GTraits::nodes_iterator; |
74 | | using child_iterator = typename GTraits::ChildIteratorType; |
75 | | DOTTraits DTraits; |
76 | | |
77 | | static_assert(std::is_pointer<NodeRef>::value, |
78 | | "FIXME: Currently GraphWriter requires the NodeRef type to be " |
79 | | "a pointer.\nThe pointer usage should be moved to " |
80 | | "DOTGraphTraits, and removed from GraphWriter itself."); |
81 | | |
82 | | // Writes the edge labels of the node to O and returns true if there are any |
83 | | // edge labels not equal to the empty string "". |
84 | 13 | bool getEdgeSourceLabels(raw_ostream &O, NodeRef Node) { |
85 | 13 | child_iterator EI = GTraits::child_begin(Node); |
86 | 13 | child_iterator EE = GTraits::child_end(Node); |
87 | 13 | bool hasEdgeSourceLabels = false; |
88 | 13 | |
89 | 25 | for (unsigned i = 0; EI != EE && 25 i != 6412 ; ++EI, ++i12 ) { |
90 | 12 | std::string label = DTraits.getEdgeSourceLabel(Node, EI); |
91 | 12 | |
92 | 12 | if (label.empty()) |
93 | 12 | continue; |
94 | 12 | |
95 | 0 | hasEdgeSourceLabels = true; |
96 | 0 |
|
97 | 0 | if (i) |
98 | 0 | O << "|"; |
99 | 12 | |
100 | 12 | O << "<s" << i << ">" << DOT::EscapeString(label); |
101 | 12 | } |
102 | 13 | |
103 | 13 | if (EI != EE && 13 hasEdgeSourceLabels0 ) |
104 | 0 | O << "|<s64>truncated..."; |
105 | 13 | |
106 | 13 | return hasEdgeSourceLabels; |
107 | 13 | } Unexecuted instantiation: llvm::GraphWriter<clang::CallGraph const*>::getEdgeSourceLabels(llvm::raw_ostream&, clang::CallGraphNode const*) llvm::GraphWriter<llvm::Function const*>::getEdgeSourceLabels(llvm::raw_ostream&, llvm::BasicBlock const*) Line | Count | Source | 84 | 4 | bool getEdgeSourceLabels(raw_ostream &O, NodeRef Node) { | 85 | 4 | child_iterator EI = GTraits::child_begin(Node); | 86 | 4 | child_iterator EE = GTraits::child_end(Node); | 87 | 4 | bool hasEdgeSourceLabels = false; | 88 | 4 | | 89 | 6 | for (unsigned i = 0; EI != EE && 6 i != 642 ; ++EI, ++i2 ) { | 90 | 2 | std::string label = DTraits.getEdgeSourceLabel(Node, EI); | 91 | 2 | | 92 | 2 | if (label.empty()) | 93 | 2 | continue; | 94 | 2 | | 95 | 0 | hasEdgeSourceLabels = true; | 96 | 0 |
| 97 | 0 | if (i) | 98 | 0 | O << "|"; | 99 | 2 | | 100 | 2 | O << "<s" << i << ">" << DOT::EscapeString(label); | 101 | 2 | } | 102 | 4 | | 103 | 4 | if (EI != EE && 4 hasEdgeSourceLabels0 ) | 104 | 0 | O << "|<s64>truncated..."; | 105 | 4 | | 106 | 4 | return hasEdgeSourceLabels; | 107 | 4 | } |
Unexecuted instantiation: llvm::GraphWriter<llvm::CallGraph*>::getEdgeSourceLabels(llvm::raw_ostream&, llvm::CallGraphNode*) Unexecuted instantiation: llvm::GraphWriter<llvm::DominatorTree*>::getEdgeSourceLabels(llvm::raw_ostream&, llvm::DomTreeNodeBase<llvm::BasicBlock>*) Unexecuted instantiation: llvm::GraphWriter<llvm::PostDominatorTree*>::getEdgeSourceLabels(llvm::raw_ostream&, llvm::DomTreeNodeBase<llvm::BasicBlock>*) Unexecuted instantiation: llvm::GraphWriter<llvm::RegionInfo*>::getEdgeSourceLabels(llvm::raw_ostream&, llvm::RegionNode*) Unexecuted instantiation: llvm::GraphWriter<llvm::MachineBlockFrequencyInfo*>::getEdgeSourceLabels(llvm::raw_ostream&, llvm::MachineBasicBlock const*) Unexecuted instantiation: PGOInstrumentation.cpp:llvm::GraphWriter<(anonymous namespace)::PGOUseFunc*>::getEdgeSourceLabels(llvm::raw_ostream&, llvm::BasicBlock const*) Unexecuted instantiation: llvm::GraphWriter<llvm::slpvectorizer::BoUpSLP*>::getEdgeSourceLabels(llvm::raw_ostream&, llvm::slpvectorizer::BoUpSLP::TreeEntry*) llvm::GraphWriter<polly::ScopDetectionWrapperPass*>::getEdgeSourceLabels(llvm::raw_ostream&, llvm::RegionNode*) Line | Count | Source | 84 | 9 | bool getEdgeSourceLabels(raw_ostream &O, NodeRef Node) { | 85 | 9 | child_iterator EI = GTraits::child_begin(Node); | 86 | 9 | child_iterator EE = GTraits::child_end(Node); | 87 | 9 | bool hasEdgeSourceLabels = false; | 88 | 9 | | 89 | 19 | for (unsigned i = 0; EI != EE && 19 i != 6410 ; ++EI, ++i10 ) { | 90 | 10 | std::string label = DTraits.getEdgeSourceLabel(Node, EI); | 91 | 10 | | 92 | 10 | if (label.empty()) | 93 | 10 | continue; | 94 | 10 | | 95 | 0 | hasEdgeSourceLabels = true; | 96 | 0 |
| 97 | 0 | if (i) | 98 | 0 | O << "|"; | 99 | 10 | | 100 | 10 | O << "<s" << i << ">" << DOT::EscapeString(label); | 101 | 10 | } | 102 | 9 | | 103 | 9 | if (EI != EE && 9 hasEdgeSourceLabels0 ) | 104 | 0 | O << "|<s64>truncated..."; | 105 | 9 | | 106 | 9 | return hasEdgeSourceLabels; | 107 | 9 | } |
Unexecuted instantiation: llvm::GraphWriter<llvm::BlockFrequencyInfo*>::getEdgeSourceLabels(llvm::raw_ostream&, llvm::BasicBlock const*) |
108 | | |
109 | | public: |
110 | 3 | GraphWriter(raw_ostream &o, const GraphType &g, bool SN) : O(o), G(g) { |
111 | 3 | DTraits = DOTTraits(SN); |
112 | 3 | } Unexecuted instantiation: llvm::GraphWriter<clang::CallGraph const*>::GraphWriter(llvm::raw_ostream&, clang::CallGraph const* const&, bool) llvm::GraphWriter<polly::ScopDetectionWrapperPass*>::GraphWriter(llvm::raw_ostream&, polly::ScopDetectionWrapperPass* const&, bool) Line | Count | Source | 110 | 1 | GraphWriter(raw_ostream &o, const GraphType &g, bool SN) : O(o), G(g) { | 111 | 1 | DTraits = DOTTraits(SN); | 112 | 1 | } |
Unexecuted instantiation: llvm::GraphWriter<llvm::slpvectorizer::BoUpSLP*>::GraphWriter(llvm::raw_ostream&, llvm::slpvectorizer::BoUpSLP* const&, bool) Unexecuted instantiation: PGOInstrumentation.cpp:llvm::GraphWriter<(anonymous namespace)::PGOUseFunc*>::GraphWriter(llvm::raw_ostream&, (anonymous namespace)::PGOUseFunc* const&, bool) Unexecuted instantiation: llvm::GraphWriter<llvm::MachineBlockFrequencyInfo*>::GraphWriter(llvm::raw_ostream&, llvm::MachineBlockFrequencyInfo* const&, bool) Unexecuted instantiation: llvm::GraphWriter<llvm::RegionInfo*>::GraphWriter(llvm::raw_ostream&, llvm::RegionInfo* const&, bool) Unexecuted instantiation: llvm::GraphWriter<llvm::PostDominatorTree*>::GraphWriter(llvm::raw_ostream&, llvm::PostDominatorTree* const&, bool) Unexecuted instantiation: llvm::GraphWriter<llvm::DominatorTree*>::GraphWriter(llvm::raw_ostream&, llvm::DominatorTree* const&, bool) Unexecuted instantiation: llvm::GraphWriter<llvm::CallGraph*>::GraphWriter(llvm::raw_ostream&, llvm::CallGraph* const&, bool) llvm::GraphWriter<llvm::Function const*>::GraphWriter(llvm::raw_ostream&, llvm::Function const* const&, bool) Line | Count | Source | 110 | 2 | GraphWriter(raw_ostream &o, const GraphType &g, bool SN) : O(o), G(g) { | 111 | 2 | DTraits = DOTTraits(SN); | 112 | 2 | } |
Unexecuted instantiation: llvm::GraphWriter<llvm::BlockFrequencyInfo*>::GraphWriter(llvm::raw_ostream&, llvm::BlockFrequencyInfo* const&, bool) |
113 | | |
114 | 3 | void writeGraph(const std::string &Title = "") { |
115 | 3 | // Output the header for the graph... |
116 | 3 | writeHeader(Title); |
117 | 3 | |
118 | 3 | // Emit all of the nodes in the graph... |
119 | 3 | writeNodes(); |
120 | 3 | |
121 | 3 | // Output any customizations on the graph |
122 | 3 | DOTGraphTraits<GraphType>::addCustomGraphFeatures(G, *this); |
123 | 3 | |
124 | 3 | // Output the end of the graph |
125 | 3 | writeFooter(); |
126 | 3 | } Unexecuted instantiation: llvm::GraphWriter<clang::CallGraph const*>::writeGraph(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) llvm::GraphWriter<polly::ScopDetectionWrapperPass*>::writeGraph(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 114 | 1 | void writeGraph(const std::string &Title = "") { | 115 | 1 | // Output the header for the graph... | 116 | 1 | writeHeader(Title); | 117 | 1 | | 118 | 1 | // Emit all of the nodes in the graph... | 119 | 1 | writeNodes(); | 120 | 1 | | 121 | 1 | // Output any customizations on the graph | 122 | 1 | DOTGraphTraits<GraphType>::addCustomGraphFeatures(G, *this); | 123 | 1 | | 124 | 1 | // Output the end of the graph | 125 | 1 | writeFooter(); | 126 | 1 | } |
Unexecuted instantiation: llvm::GraphWriter<llvm::slpvectorizer::BoUpSLP*>::writeGraph(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Unexecuted instantiation: PGOInstrumentation.cpp:llvm::GraphWriter<(anonymous namespace)::PGOUseFunc*>::writeGraph(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Unexecuted instantiation: llvm::GraphWriter<llvm::MachineBlockFrequencyInfo*>::writeGraph(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Unexecuted instantiation: llvm::GraphWriter<llvm::RegionInfo*>::writeGraph(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Unexecuted instantiation: llvm::GraphWriter<llvm::PostDominatorTree*>::writeGraph(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Unexecuted instantiation: llvm::GraphWriter<llvm::DominatorTree*>::writeGraph(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Unexecuted instantiation: llvm::GraphWriter<llvm::CallGraph*>::writeGraph(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) llvm::GraphWriter<llvm::Function const*>::writeGraph(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 114 | 2 | void writeGraph(const std::string &Title = "") { | 115 | 2 | // Output the header for the graph... | 116 | 2 | writeHeader(Title); | 117 | 2 | | 118 | 2 | // Emit all of the nodes in the graph... | 119 | 2 | writeNodes(); | 120 | 2 | | 121 | 2 | // Output any customizations on the graph | 122 | 2 | DOTGraphTraits<GraphType>::addCustomGraphFeatures(G, *this); | 123 | 2 | | 124 | 2 | // Output the end of the graph | 125 | 2 | writeFooter(); | 126 | 2 | } |
Unexecuted instantiation: llvm::GraphWriter<llvm::BlockFrequencyInfo*>::writeGraph(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) |
127 | | |
128 | 3 | void writeHeader(const std::string &Title) { |
129 | 3 | std::string GraphName = DTraits.getGraphName(G); |
130 | 3 | |
131 | 3 | if (!Title.empty()) |
132 | 1 | O << "digraph \"" << DOT::EscapeString(Title) << "\" {\n"; |
133 | 2 | else if (2 !GraphName.empty()2 ) |
134 | 2 | O << "digraph \"" << DOT::EscapeString(GraphName) << "\" {\n"; |
135 | 2 | else |
136 | 0 | O << "digraph unnamed {\n"; |
137 | 3 | |
138 | 3 | if (DTraits.renderGraphFromBottomUp()) |
139 | 0 | O << "\trankdir=\"BT\";\n"; |
140 | 3 | |
141 | 3 | if (!Title.empty()) |
142 | 1 | O << "\tlabel=\"" << DOT::EscapeString(Title) << "\";\n"; |
143 | 2 | else if (2 !GraphName.empty()2 ) |
144 | 2 | O << "\tlabel=\"" << DOT::EscapeString(GraphName) << "\";\n"; |
145 | 3 | O << DTraits.getGraphProperties(G); |
146 | 3 | O << "\n"; |
147 | 3 | } Unexecuted instantiation: llvm::GraphWriter<clang::CallGraph const*>::writeHeader(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) llvm::GraphWriter<polly::ScopDetectionWrapperPass*>::writeHeader(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 128 | 1 | void writeHeader(const std::string &Title) { | 129 | 1 | std::string GraphName = DTraits.getGraphName(G); | 130 | 1 | | 131 | 1 | if (!Title.empty()) | 132 | 1 | O << "digraph \"" << DOT::EscapeString(Title) << "\" {\n"; | 133 | 0 | else if (0 !GraphName.empty()0 ) | 134 | 0 | O << "digraph \"" << DOT::EscapeString(GraphName) << "\" {\n"; | 135 | 0 | else | 136 | 0 | O << "digraph unnamed {\n"; | 137 | 1 | | 138 | 1 | if (DTraits.renderGraphFromBottomUp()) | 139 | 0 | O << "\trankdir=\"BT\";\n"; | 140 | 1 | | 141 | 1 | if (!Title.empty()) | 142 | 1 | O << "\tlabel=\"" << DOT::EscapeString(Title) << "\";\n"; | 143 | 0 | else if (0 !GraphName.empty()0 ) | 144 | 0 | O << "\tlabel=\"" << DOT::EscapeString(GraphName) << "\";\n"; | 145 | 1 | O << DTraits.getGraphProperties(G); | 146 | 1 | O << "\n"; | 147 | 1 | } |
Unexecuted instantiation: llvm::GraphWriter<llvm::slpvectorizer::BoUpSLP*>::writeHeader(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Unexecuted instantiation: PGOInstrumentation.cpp:llvm::GraphWriter<(anonymous namespace)::PGOUseFunc*>::writeHeader(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Unexecuted instantiation: llvm::GraphWriter<llvm::MachineBlockFrequencyInfo*>::writeHeader(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Unexecuted instantiation: llvm::GraphWriter<llvm::RegionInfo*>::writeHeader(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Unexecuted instantiation: llvm::GraphWriter<llvm::PostDominatorTree*>::writeHeader(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Unexecuted instantiation: llvm::GraphWriter<llvm::DominatorTree*>::writeHeader(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Unexecuted instantiation: llvm::GraphWriter<llvm::CallGraph*>::writeHeader(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) llvm::GraphWriter<llvm::Function const*>::writeHeader(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 128 | 2 | void writeHeader(const std::string &Title) { | 129 | 2 | std::string GraphName = DTraits.getGraphName(G); | 130 | 2 | | 131 | 2 | if (!Title.empty()) | 132 | 0 | O << "digraph \"" << DOT::EscapeString(Title) << "\" {\n"; | 133 | 2 | else if (2 !GraphName.empty()2 ) | 134 | 2 | O << "digraph \"" << DOT::EscapeString(GraphName) << "\" {\n"; | 135 | 2 | else | 136 | 0 | O << "digraph unnamed {\n"; | 137 | 2 | | 138 | 2 | if (DTraits.renderGraphFromBottomUp()) | 139 | 0 | O << "\trankdir=\"BT\";\n"; | 140 | 2 | | 141 | 2 | if (!Title.empty()) | 142 | 0 | O << "\tlabel=\"" << DOT::EscapeString(Title) << "\";\n"; | 143 | 2 | else if (2 !GraphName.empty()2 ) | 144 | 2 | O << "\tlabel=\"" << DOT::EscapeString(GraphName) << "\";\n"; | 145 | 2 | O << DTraits.getGraphProperties(G); | 146 | 2 | O << "\n"; | 147 | 2 | } |
Unexecuted instantiation: llvm::GraphWriter<llvm::BlockFrequencyInfo*>::writeHeader(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) |
148 | | |
149 | 3 | void writeFooter() { |
150 | 3 | // Finish off the graph |
151 | 3 | O << "}\n"; |
152 | 3 | } Unexecuted instantiation: llvm::GraphWriter<llvm::PostDominatorTree*>::writeFooter() Unexecuted instantiation: llvm::GraphWriter<llvm::RegionInfo*>::writeFooter() Unexecuted instantiation: llvm::GraphWriter<llvm::MachineBlockFrequencyInfo*>::writeFooter() Unexecuted instantiation: llvm::GraphWriter<llvm::DominatorTree*>::writeFooter() Unexecuted instantiation: llvm::GraphWriter<llvm::CallGraph*>::writeFooter() llvm::GraphWriter<llvm::Function const*>::writeFooter() Line | Count | Source | 149 | 2 | void writeFooter() { | 150 | 2 | // Finish off the graph | 151 | 2 | O << "}\n"; | 152 | 2 | } |
Unexecuted instantiation: llvm::GraphWriter<llvm::BlockFrequencyInfo*>::writeFooter() Unexecuted instantiation: PGOInstrumentation.cpp:llvm::GraphWriter<(anonymous namespace)::PGOUseFunc*>::writeFooter() Unexecuted instantiation: llvm::GraphWriter<llvm::slpvectorizer::BoUpSLP*>::writeFooter() llvm::GraphWriter<polly::ScopDetectionWrapperPass*>::writeFooter() Line | Count | Source | 149 | 1 | void writeFooter() { | 150 | 1 | // Finish off the graph | 151 | 1 | O << "}\n"; | 152 | 1 | } |
Unexecuted instantiation: llvm::GraphWriter<clang::CallGraph const*>::writeFooter() |
153 | | |
154 | 3 | void writeNodes() { |
155 | 3 | // Loop over the graph, printing it out... |
156 | 3 | for (const auto Node : nodes<GraphType>(G)) |
157 | 13 | if (13 !isNodeHidden(Node)13 ) |
158 | 13 | writeNode(Node); |
159 | 3 | } Unexecuted instantiation: llvm::GraphWriter<llvm::BlockFrequencyInfo*>::writeNodes() llvm::GraphWriter<llvm::Function const*>::writeNodes() Line | Count | Source | 154 | 2 | void writeNodes() { | 155 | 2 | // Loop over the graph, printing it out... | 156 | 2 | for (const auto Node : nodes<GraphType>(G)) | 157 | 4 | if (4 !isNodeHidden(Node)4 ) | 158 | 4 | writeNode(Node); | 159 | 2 | } |
Unexecuted instantiation: llvm::GraphWriter<llvm::CallGraph*>::writeNodes() Unexecuted instantiation: llvm::GraphWriter<llvm::DominatorTree*>::writeNodes() Unexecuted instantiation: llvm::GraphWriter<llvm::PostDominatorTree*>::writeNodes() llvm::GraphWriter<polly::ScopDetectionWrapperPass*>::writeNodes() Line | Count | Source | 154 | 1 | void writeNodes() { | 155 | 1 | // Loop over the graph, printing it out... | 156 | 1 | for (const auto Node : nodes<GraphType>(G)) | 157 | 9 | if (9 !isNodeHidden(Node)9 ) | 158 | 9 | writeNode(Node); | 159 | 1 | } |
Unexecuted instantiation: llvm::GraphWriter<clang::CallGraph const*>::writeNodes() Unexecuted instantiation: llvm::GraphWriter<llvm::slpvectorizer::BoUpSLP*>::writeNodes() Unexecuted instantiation: PGOInstrumentation.cpp:llvm::GraphWriter<(anonymous namespace)::PGOUseFunc*>::writeNodes() Unexecuted instantiation: llvm::GraphWriter<llvm::MachineBlockFrequencyInfo*>::writeNodes() Unexecuted instantiation: llvm::GraphWriter<llvm::RegionInfo*>::writeNodes() |
160 | | |
161 | 13 | bool isNodeHidden(NodeRef Node) { |
162 | 13 | return DTraits.isNodeHidden(Node); |
163 | 13 | } Unexecuted instantiation: llvm::GraphWriter<llvm::MachineBlockFrequencyInfo*>::isNodeHidden(llvm::MachineBasicBlock const*) Unexecuted instantiation: PGOInstrumentation.cpp:llvm::GraphWriter<(anonymous namespace)::PGOUseFunc*>::isNodeHidden(llvm::BasicBlock const*) Unexecuted instantiation: llvm::GraphWriter<llvm::slpvectorizer::BoUpSLP*>::isNodeHidden(llvm::slpvectorizer::BoUpSLP::TreeEntry*) llvm::GraphWriter<polly::ScopDetectionWrapperPass*>::isNodeHidden(llvm::RegionNode*) Line | Count | Source | 161 | 9 | bool isNodeHidden(NodeRef Node) { | 162 | 9 | return DTraits.isNodeHidden(Node); | 163 | 9 | } |
Unexecuted instantiation: llvm::GraphWriter<clang::CallGraph const*>::isNodeHidden(clang::CallGraphNode const*) Unexecuted instantiation: llvm::GraphWriter<llvm::RegionInfo*>::isNodeHidden(llvm::RegionNode*) Unexecuted instantiation: llvm::GraphWriter<llvm::PostDominatorTree*>::isNodeHidden(llvm::DomTreeNodeBase<llvm::BasicBlock>*) Unexecuted instantiation: llvm::GraphWriter<llvm::DominatorTree*>::isNodeHidden(llvm::DomTreeNodeBase<llvm::BasicBlock>*) Unexecuted instantiation: llvm::GraphWriter<llvm::CallGraph*>::isNodeHidden(llvm::CallGraphNode*) Unexecuted instantiation: llvm::GraphWriter<llvm::BlockFrequencyInfo*>::isNodeHidden(llvm::BasicBlock const*) llvm::GraphWriter<llvm::Function const*>::isNodeHidden(llvm::BasicBlock const*) Line | Count | Source | 161 | 4 | bool isNodeHidden(NodeRef Node) { | 162 | 4 | return DTraits.isNodeHidden(Node); | 163 | 4 | } |
|
164 | | |
165 | 13 | void writeNode(NodeRef Node) { |
166 | 13 | std::string NodeAttributes = DTraits.getNodeAttributes(Node, G); |
167 | 13 | |
168 | 13 | O << "\tNode" << static_cast<const void*>(Node) << " [shape=record,"; |
169 | 13 | if (!NodeAttributes.empty()13 ) O << NodeAttributes << ","0 ; |
170 | 13 | O << "label=\"{"; |
171 | 13 | |
172 | 13 | if (!DTraits.renderGraphFromBottomUp()13 ) { |
173 | 13 | O << DOT::EscapeString(DTraits.getNodeLabel(Node, G)); |
174 | 13 | |
175 | 13 | // If we should include the address of the node in the label, do so now. |
176 | 13 | std::string Id = DTraits.getNodeIdentifierLabel(Node, G); |
177 | 13 | if (!Id.empty()) |
178 | 0 | O << "|" << DOT::EscapeString(Id); |
179 | 13 | |
180 | 13 | std::string NodeDesc = DTraits.getNodeDescription(Node, G); |
181 | 13 | if (!NodeDesc.empty()) |
182 | 0 | O << "|" << DOT::EscapeString(NodeDesc); |
183 | 13 | } |
184 | 13 | |
185 | 13 | std::string edgeSourceLabels; |
186 | 13 | raw_string_ostream EdgeSourceLabels(edgeSourceLabels); |
187 | 13 | bool hasEdgeSourceLabels = getEdgeSourceLabels(EdgeSourceLabels, Node); |
188 | 13 | |
189 | 13 | if (hasEdgeSourceLabels13 ) { |
190 | 0 | if (!DTraits.renderGraphFromBottomUp()0 ) O << "|"0 ; |
191 | 0 |
|
192 | 0 | O << "{" << EdgeSourceLabels.str() << "}"; |
193 | 0 |
|
194 | 0 | if (DTraits.renderGraphFromBottomUp()0 ) O << "|"0 ; |
195 | 0 | } |
196 | 13 | |
197 | 13 | if (DTraits.renderGraphFromBottomUp()13 ) { |
198 | 0 | O << DOT::EscapeString(DTraits.getNodeLabel(Node, G)); |
199 | 0 |
|
200 | 0 | // If we should include the address of the node in the label, do so now. |
201 | 0 | std::string Id = DTraits.getNodeIdentifierLabel(Node, G); |
202 | 0 | if (!Id.empty()) |
203 | 0 | O << "|" << DOT::EscapeString(Id); |
204 | 0 |
|
205 | 0 | std::string NodeDesc = DTraits.getNodeDescription(Node, G); |
206 | 0 | if (!NodeDesc.empty()) |
207 | 0 | O << "|" << DOT::EscapeString(NodeDesc); |
208 | 0 | } |
209 | 13 | |
210 | 13 | if (DTraits.hasEdgeDestLabels()13 ) { |
211 | 0 | O << "|{"; |
212 | 0 |
|
213 | 0 | unsigned i = 0, e = DTraits.numEdgeDestLabels(Node); |
214 | 0 | for (; i != e && 0 i != 640 ; ++i0 ) { |
215 | 0 | if (i0 ) O << "|"0 ; |
216 | 0 | O << "<d" << i << ">" |
217 | 0 | << DOT::EscapeString(DTraits.getEdgeDestLabel(Node, i)); |
218 | 0 | } |
219 | 0 |
|
220 | 0 | if (i != e) |
221 | 0 | O << "|<d64>truncated..."; |
222 | 0 | O << "}"; |
223 | 0 | } |
224 | 13 | |
225 | 13 | O << "}\"];\n"; // Finish printing the "node" line |
226 | 13 | |
227 | 13 | // Output all of the edges now |
228 | 13 | child_iterator EI = GTraits::child_begin(Node); |
229 | 13 | child_iterator EE = GTraits::child_end(Node); |
230 | 25 | for (unsigned i = 0; EI != EE && 25 i != 6412 ; ++EI, ++i12 ) |
231 | 12 | if (12 !DTraits.isNodeHidden(*EI)12 ) |
232 | 12 | writeEdge(Node, i, EI); |
233 | 13 | for (; EI != EE13 ; ++EI0 ) |
234 | 0 | if (0 !DTraits.isNodeHidden(*EI)0 ) |
235 | 0 | writeEdge(Node, 64, EI); |
236 | 13 | } Unexecuted instantiation: llvm::GraphWriter<llvm::MachineBlockFrequencyInfo*>::writeNode(llvm::MachineBasicBlock const*) Unexecuted instantiation: llvm::GraphWriter<llvm::BlockFrequencyInfo*>::writeNode(llvm::BasicBlock const*) Unexecuted instantiation: llvm::GraphWriter<llvm::slpvectorizer::BoUpSLP*>::writeNode(llvm::slpvectorizer::BoUpSLP::TreeEntry*) llvm::GraphWriter<polly::ScopDetectionWrapperPass*>::writeNode(llvm::RegionNode*) Line | Count | Source | 165 | 9 | void writeNode(NodeRef Node) { | 166 | 9 | std::string NodeAttributes = DTraits.getNodeAttributes(Node, G); | 167 | 9 | | 168 | 9 | O << "\tNode" << static_cast<const void*>(Node) << " [shape=record,"; | 169 | 9 | if (!NodeAttributes.empty()9 ) O << NodeAttributes << ","0 ; | 170 | 9 | O << "label=\"{"; | 171 | 9 | | 172 | 9 | if (!DTraits.renderGraphFromBottomUp()9 ) { | 173 | 9 | O << DOT::EscapeString(DTraits.getNodeLabel(Node, G)); | 174 | 9 | | 175 | 9 | // If we should include the address of the node in the label, do so now. | 176 | 9 | std::string Id = DTraits.getNodeIdentifierLabel(Node, G); | 177 | 9 | if (!Id.empty()) | 178 | 0 | O << "|" << DOT::EscapeString(Id); | 179 | 9 | | 180 | 9 | std::string NodeDesc = DTraits.getNodeDescription(Node, G); | 181 | 9 | if (!NodeDesc.empty()) | 182 | 0 | O << "|" << DOT::EscapeString(NodeDesc); | 183 | 9 | } | 184 | 9 | | 185 | 9 | std::string edgeSourceLabels; | 186 | 9 | raw_string_ostream EdgeSourceLabels(edgeSourceLabels); | 187 | 9 | bool hasEdgeSourceLabels = getEdgeSourceLabels(EdgeSourceLabels, Node); | 188 | 9 | | 189 | 9 | if (hasEdgeSourceLabels9 ) { | 190 | 0 | if (!DTraits.renderGraphFromBottomUp()0 ) O << "|"0 ; | 191 | 0 |
| 192 | 0 | O << "{" << EdgeSourceLabels.str() << "}"; | 193 | 0 |
| 194 | 0 | if (DTraits.renderGraphFromBottomUp()0 ) O << "|"0 ; | 195 | 0 | } | 196 | 9 | | 197 | 9 | if (DTraits.renderGraphFromBottomUp()9 ) { | 198 | 0 | O << DOT::EscapeString(DTraits.getNodeLabel(Node, G)); | 199 | 0 |
| 200 | 0 | // If we should include the address of the node in the label, do so now. | 201 | 0 | std::string Id = DTraits.getNodeIdentifierLabel(Node, G); | 202 | 0 | if (!Id.empty()) | 203 | 0 | O << "|" << DOT::EscapeString(Id); | 204 | 0 |
| 205 | 0 | std::string NodeDesc = DTraits.getNodeDescription(Node, G); | 206 | 0 | if (!NodeDesc.empty()) | 207 | 0 | O << "|" << DOT::EscapeString(NodeDesc); | 208 | 0 | } | 209 | 9 | | 210 | 9 | if (DTraits.hasEdgeDestLabels()9 ) { | 211 | 0 | O << "|{"; | 212 | 0 |
| 213 | 0 | unsigned i = 0, e = DTraits.numEdgeDestLabels(Node); | 214 | 0 | for (; i != e && 0 i != 640 ; ++i0 ) { | 215 | 0 | if (i0 ) O << "|"0 ; | 216 | 0 | O << "<d" << i << ">" | 217 | 0 | << DOT::EscapeString(DTraits.getEdgeDestLabel(Node, i)); | 218 | 0 | } | 219 | 0 |
| 220 | 0 | if (i != e) | 221 | 0 | O << "|<d64>truncated..."; | 222 | 0 | O << "}"; | 223 | 0 | } | 224 | 9 | | 225 | 9 | O << "}\"];\n"; // Finish printing the "node" line | 226 | 9 | | 227 | 9 | // Output all of the edges now | 228 | 9 | child_iterator EI = GTraits::child_begin(Node); | 229 | 9 | child_iterator EE = GTraits::child_end(Node); | 230 | 19 | for (unsigned i = 0; EI != EE && 19 i != 6410 ; ++EI, ++i10 ) | 231 | 10 | if (10 !DTraits.isNodeHidden(*EI)10 ) | 232 | 10 | writeEdge(Node, i, EI); | 233 | 9 | for (; EI != EE9 ; ++EI0 ) | 234 | 0 | if (0 !DTraits.isNodeHidden(*EI)0 ) | 235 | 0 | writeEdge(Node, 64, EI); | 236 | 9 | } |
Unexecuted instantiation: llvm::GraphWriter<clang::CallGraph const*>::writeNode(clang::CallGraphNode const*) llvm::GraphWriter<llvm::Function const*>::writeNode(llvm::BasicBlock const*) Line | Count | Source | 165 | 4 | void writeNode(NodeRef Node) { | 166 | 4 | std::string NodeAttributes = DTraits.getNodeAttributes(Node, G); | 167 | 4 | | 168 | 4 | O << "\tNode" << static_cast<const void*>(Node) << " [shape=record,"; | 169 | 4 | if (!NodeAttributes.empty()4 ) O << NodeAttributes << ","0 ; | 170 | 4 | O << "label=\"{"; | 171 | 4 | | 172 | 4 | if (!DTraits.renderGraphFromBottomUp()4 ) { | 173 | 4 | O << DOT::EscapeString(DTraits.getNodeLabel(Node, G)); | 174 | 4 | | 175 | 4 | // If we should include the address of the node in the label, do so now. | 176 | 4 | std::string Id = DTraits.getNodeIdentifierLabel(Node, G); | 177 | 4 | if (!Id.empty()) | 178 | 0 | O << "|" << DOT::EscapeString(Id); | 179 | 4 | | 180 | 4 | std::string NodeDesc = DTraits.getNodeDescription(Node, G); | 181 | 4 | if (!NodeDesc.empty()) | 182 | 0 | O << "|" << DOT::EscapeString(NodeDesc); | 183 | 4 | } | 184 | 4 | | 185 | 4 | std::string edgeSourceLabels; | 186 | 4 | raw_string_ostream EdgeSourceLabels(edgeSourceLabels); | 187 | 4 | bool hasEdgeSourceLabels = getEdgeSourceLabels(EdgeSourceLabels, Node); | 188 | 4 | | 189 | 4 | if (hasEdgeSourceLabels4 ) { | 190 | 0 | if (!DTraits.renderGraphFromBottomUp()0 ) O << "|"0 ; | 191 | 0 |
| 192 | 0 | O << "{" << EdgeSourceLabels.str() << "}"; | 193 | 0 |
| 194 | 0 | if (DTraits.renderGraphFromBottomUp()0 ) O << "|"0 ; | 195 | 0 | } | 196 | 4 | | 197 | 4 | if (DTraits.renderGraphFromBottomUp()4 ) { | 198 | 0 | O << DOT::EscapeString(DTraits.getNodeLabel(Node, G)); | 199 | 0 |
| 200 | 0 | // If we should include the address of the node in the label, do so now. | 201 | 0 | std::string Id = DTraits.getNodeIdentifierLabel(Node, G); | 202 | 0 | if (!Id.empty()) | 203 | 0 | O << "|" << DOT::EscapeString(Id); | 204 | 0 |
| 205 | 0 | std::string NodeDesc = DTraits.getNodeDescription(Node, G); | 206 | 0 | if (!NodeDesc.empty()) | 207 | 0 | O << "|" << DOT::EscapeString(NodeDesc); | 208 | 0 | } | 209 | 4 | | 210 | 4 | if (DTraits.hasEdgeDestLabels()4 ) { | 211 | 0 | O << "|{"; | 212 | 0 |
| 213 | 0 | unsigned i = 0, e = DTraits.numEdgeDestLabels(Node); | 214 | 0 | for (; i != e && 0 i != 640 ; ++i0 ) { | 215 | 0 | if (i0 ) O << "|"0 ; | 216 | 0 | O << "<d" << i << ">" | 217 | 0 | << DOT::EscapeString(DTraits.getEdgeDestLabel(Node, i)); | 218 | 0 | } | 219 | 0 |
| 220 | 0 | if (i != e) | 221 | 0 | O << "|<d64>truncated..."; | 222 | 0 | O << "}"; | 223 | 0 | } | 224 | 4 | | 225 | 4 | O << "}\"];\n"; // Finish printing the "node" line | 226 | 4 | | 227 | 4 | // Output all of the edges now | 228 | 4 | child_iterator EI = GTraits::child_begin(Node); | 229 | 4 | child_iterator EE = GTraits::child_end(Node); | 230 | 6 | for (unsigned i = 0; EI != EE && 6 i != 642 ; ++EI, ++i2 ) | 231 | 2 | if (2 !DTraits.isNodeHidden(*EI)2 ) | 232 | 2 | writeEdge(Node, i, EI); | 233 | 4 | for (; EI != EE4 ; ++EI0 ) | 234 | 0 | if (0 !DTraits.isNodeHidden(*EI)0 ) | 235 | 0 | writeEdge(Node, 64, EI); | 236 | 4 | } |
Unexecuted instantiation: llvm::GraphWriter<llvm::CallGraph*>::writeNode(llvm::CallGraphNode*) Unexecuted instantiation: llvm::GraphWriter<llvm::DominatorTree*>::writeNode(llvm::DomTreeNodeBase<llvm::BasicBlock>*) Unexecuted instantiation: llvm::GraphWriter<llvm::PostDominatorTree*>::writeNode(llvm::DomTreeNodeBase<llvm::BasicBlock>*) Unexecuted instantiation: llvm::GraphWriter<llvm::RegionInfo*>::writeNode(llvm::RegionNode*) Unexecuted instantiation: PGOInstrumentation.cpp:llvm::GraphWriter<(anonymous namespace)::PGOUseFunc*>::writeNode(llvm::BasicBlock const*) |
237 | | |
238 | 12 | void writeEdge(NodeRef Node, unsigned edgeidx, child_iterator EI) { |
239 | 12 | if (NodeRef TargetNode12 = *EI) { |
240 | 12 | int DestPort = -1; |
241 | 12 | if (DTraits.edgeTargetsEdgeSource(Node, EI)12 ) { |
242 | 0 | child_iterator TargetIt = DTraits.getEdgeTarget(Node, EI); |
243 | 0 |
|
244 | 0 | // Figure out which edge this targets... |
245 | 0 | unsigned Offset = |
246 | 0 | (unsigned)std::distance(GTraits::child_begin(TargetNode), TargetIt); |
247 | 0 | DestPort = static_cast<int>(Offset); |
248 | 0 | } |
249 | 12 | |
250 | 12 | if (DTraits.getEdgeSourceLabel(Node, EI).empty()) |
251 | 12 | edgeidx = -1; |
252 | 12 | |
253 | 12 | emitEdge(static_cast<const void*>(Node), edgeidx, |
254 | 12 | static_cast<const void*>(TargetNode), DestPort, |
255 | 12 | DTraits.getEdgeAttributes(Node, EI, G)); |
256 | 12 | } |
257 | 12 | } llvm::GraphWriter<polly::ScopDetectionWrapperPass*>::writeEdge(llvm::RegionNode*, unsigned int, llvm::RNSuccIterator<llvm::FlatIt<llvm::RegionNode*>, llvm::BasicBlock, llvm::Region>) Line | Count | Source | 238 | 10 | void writeEdge(NodeRef Node, unsigned edgeidx, child_iterator EI) { | 239 | 10 | if (NodeRef TargetNode10 = *EI) { | 240 | 10 | int DestPort = -1; | 241 | 10 | if (DTraits.edgeTargetsEdgeSource(Node, EI)10 ) { | 242 | 0 | child_iterator TargetIt = DTraits.getEdgeTarget(Node, EI); | 243 | 0 |
| 244 | 0 | // Figure out which edge this targets... | 245 | 0 | unsigned Offset = | 246 | 0 | (unsigned)std::distance(GTraits::child_begin(TargetNode), TargetIt); | 247 | 0 | DestPort = static_cast<int>(Offset); | 248 | 0 | } | 249 | 10 | | 250 | 10 | if (DTraits.getEdgeSourceLabel(Node, EI).empty()) | 251 | 10 | edgeidx = -1; | 252 | 10 | | 253 | 10 | emitEdge(static_cast<const void*>(Node), edgeidx, | 254 | 10 | static_cast<const void*>(TargetNode), DestPort, | 255 | 10 | DTraits.getEdgeAttributes(Node, EI, G)); | 256 | 10 | } | 257 | 10 | } |
Unexecuted instantiation: llvm::GraphWriter<llvm::RegionInfo*>::writeEdge(llvm::RegionNode*, unsigned int, llvm::RNSuccIterator<llvm::FlatIt<llvm::RegionNode*>, llvm::BasicBlock, llvm::Region>) Unexecuted instantiation: PGOInstrumentation.cpp:llvm::GraphWriter<(anonymous namespace)::PGOUseFunc*>::writeEdge(llvm::BasicBlock const*, unsigned int, llvm::TerminatorInst::SuccIterator<llvm::TerminatorInst const*, llvm::BasicBlock const>) Unexecuted instantiation: llvm::GraphWriter<llvm::MachineBlockFrequencyInfo*>::writeEdge(llvm::MachineBasicBlock const*, unsigned int, std::__1::__wrap_iter<llvm::MachineBasicBlock* const*>) Unexecuted instantiation: llvm::GraphWriter<clang::CallGraph const*>::writeEdge(clang::CallGraphNode const*, unsigned int, clang::CallGraphNode* const*) Unexecuted instantiation: llvm::GraphWriter<llvm::BlockFrequencyInfo*>::writeEdge(llvm::BasicBlock const*, unsigned int, llvm::TerminatorInst::SuccIterator<llvm::TerminatorInst const*, llvm::BasicBlock const>) llvm::GraphWriter<llvm::Function const*>::writeEdge(llvm::BasicBlock const*, unsigned int, llvm::TerminatorInst::SuccIterator<llvm::TerminatorInst const*, llvm::BasicBlock const>) Line | Count | Source | 238 | 2 | void writeEdge(NodeRef Node, unsigned edgeidx, child_iterator EI) { | 239 | 2 | if (NodeRef TargetNode2 = *EI) { | 240 | 2 | int DestPort = -1; | 241 | 2 | if (DTraits.edgeTargetsEdgeSource(Node, EI)2 ) { | 242 | 0 | child_iterator TargetIt = DTraits.getEdgeTarget(Node, EI); | 243 | 0 |
| 244 | 0 | // Figure out which edge this targets... | 245 | 0 | unsigned Offset = | 246 | 0 | (unsigned)std::distance(GTraits::child_begin(TargetNode), TargetIt); | 247 | 0 | DestPort = static_cast<int>(Offset); | 248 | 0 | } | 249 | 2 | | 250 | 2 | if (DTraits.getEdgeSourceLabel(Node, EI).empty()) | 251 | 2 | edgeidx = -1; | 252 | 2 | | 253 | 2 | emitEdge(static_cast<const void*>(Node), edgeidx, | 254 | 2 | static_cast<const void*>(TargetNode), DestPort, | 255 | 2 | DTraits.getEdgeAttributes(Node, EI, G)); | 256 | 2 | } | 257 | 2 | } |
Unexecuted instantiation: llvm::GraphWriter<llvm::CallGraph*>::writeEdge(llvm::CallGraphNode*, unsigned int, llvm::mapped_iterator<std::__1::__wrap_iter<std::__1::pair<llvm::WeakTrackingVH, llvm::CallGraphNode*>*>, llvm::CallGraphNode* (*)(std::__1::pair<llvm::WeakTrackingVH, llvm::CallGraphNode*>)>) Unexecuted instantiation: llvm::GraphWriter<llvm::DominatorTree*>::writeEdge(llvm::DomTreeNodeBase<llvm::BasicBlock>*, unsigned int, std::__1::__wrap_iter<llvm::DomTreeNodeBase<llvm::BasicBlock>**>) Unexecuted instantiation: llvm::GraphWriter<llvm::PostDominatorTree*>::writeEdge(llvm::DomTreeNodeBase<llvm::BasicBlock>*, unsigned int, std::__1::__wrap_iter<llvm::DomTreeNodeBase<llvm::BasicBlock>**>) Unexecuted instantiation: llvm::GraphWriter<llvm::slpvectorizer::BoUpSLP*>::writeEdge(llvm::slpvectorizer::BoUpSLP::TreeEntry*, unsigned int, llvm::GraphTraits<llvm::slpvectorizer::BoUpSLP*>::ChildIteratorType) |
258 | | |
259 | | /// emitSimpleNode - Outputs a simple (non-record) node |
260 | | void emitSimpleNode(const void *ID, const std::string &Attr, |
261 | | const std::string &Label, unsigned NumEdgeSources = 0, |
262 | 0 | const std::vector<std::string> *EdgeSourceLabels = nullptr) { |
263 | 0 | O << "\tNode" << ID << "[ "; |
264 | 0 | if (!Attr.empty()) |
265 | 0 | O << Attr << ","; |
266 | 0 | O << " label =\""; |
267 | 0 | if (NumEdgeSources0 ) O << "{"0 ; |
268 | 0 | O << DOT::EscapeString(Label); |
269 | 0 | if (NumEdgeSources0 ) { |
270 | 0 | O << "|{"; |
271 | 0 |
|
272 | 0 | for (unsigned i = 0; i != NumEdgeSources0 ; ++i0 ) { |
273 | 0 | if (i0 ) O << "|"0 ; |
274 | 0 | O << "<s" << i << ">"; |
275 | 0 | if (EdgeSourceLabels0 ) O << DOT::EscapeString((*EdgeSourceLabels)[i])0 ; |
276 | 0 | } |
277 | 0 | O << "}}"; |
278 | 0 | } |
279 | 0 | O << "\"];\n"; |
280 | 0 | } Unexecuted instantiation: llvm::GraphWriter<llvm::SelectionDAG*>::emitSimpleNode(void const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned int, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const*) Unexecuted instantiation: llvm::GraphWriter<llvm::ScheduleDAG*>::emitSimpleNode(void const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned int, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const*) |
281 | | |
282 | | /// emitEdge - Output an edge from a simple node into the graph... |
283 | | void emitEdge(const void *SrcNodeID, int SrcNodePort, |
284 | | const void *DestNodeID, int DestNodePort, |
285 | 12 | const std::string &Attrs) { |
286 | 12 | if (SrcNodePort > 6412 ) return0 ; // Eminating from truncated part? |
287 | 12 | if (12 DestNodePort > 6412 ) DestNodePort = 640 ; // Targeting the truncated part? |
288 | 12 | |
289 | 12 | O << "\tNode" << SrcNodeID; |
290 | 12 | if (SrcNodePort >= 0) |
291 | 0 | O << ":s" << SrcNodePort; |
292 | 12 | O << " -> Node" << DestNodeID; |
293 | 12 | if (DestNodePort >= 0 && 12 DTraits.hasEdgeDestLabels()0 ) |
294 | 0 | O << ":d" << DestNodePort; |
295 | 12 | |
296 | 12 | if (!Attrs.empty()) |
297 | 2 | O << "[" << Attrs << "]"; |
298 | 12 | O << ";\n"; |
299 | 12 | } Unexecuted instantiation: llvm::GraphWriter<llvm::ScheduleDAG*>::emitEdge(void const*, int, void const*, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Unexecuted instantiation: llvm::GraphWriter<llvm::RegionInfo*>::emitEdge(void const*, int, void const*, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Unexecuted instantiation: llvm::GraphWriter<llvm::SelectionDAG*>::emitEdge(void const*, int, void const*, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Unexecuted instantiation: llvm::GraphWriter<llvm::slpvectorizer::BoUpSLP*>::emitEdge(void const*, int, void const*, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Unexecuted instantiation: PGOInstrumentation.cpp:llvm::GraphWriter<(anonymous namespace)::PGOUseFunc*>::emitEdge(void const*, int, void const*, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Unexecuted instantiation: llvm::GraphWriter<llvm::MachineBlockFrequencyInfo*>::emitEdge(void const*, int, void const*, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Unexecuted instantiation: llvm::GraphWriter<clang::CallGraph const*>::emitEdge(void const*, int, void const*, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Unexecuted instantiation: llvm::GraphWriter<llvm::PostDominatorTree*>::emitEdge(void const*, int, void const*, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) llvm::GraphWriter<polly::ScopDetectionWrapperPass*>::emitEdge(void const*, int, void const*, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 285 | 10 | const std::string &Attrs) { | 286 | 10 | if (SrcNodePort > 6410 ) return0 ; // Eminating from truncated part? | 287 | 10 | if (10 DestNodePort > 6410 ) DestNodePort = 640 ; // Targeting the truncated part? | 288 | 10 | | 289 | 10 | O << "\tNode" << SrcNodeID; | 290 | 10 | if (SrcNodePort >= 0) | 291 | 0 | O << ":s" << SrcNodePort; | 292 | 10 | O << " -> Node" << DestNodeID; | 293 | 10 | if (DestNodePort >= 0 && 10 DTraits.hasEdgeDestLabels()0 ) | 294 | 0 | O << ":d" << DestNodePort; | 295 | 10 | | 296 | 10 | if (!Attrs.empty()) | 297 | 2 | O << "[" << Attrs << "]"; | 298 | 10 | O << ";\n"; | 299 | 10 | } |
Unexecuted instantiation: llvm::GraphWriter<llvm::BlockFrequencyInfo*>::emitEdge(void const*, int, void const*, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) llvm::GraphWriter<llvm::Function const*>::emitEdge(void const*, int, void const*, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 285 | 2 | const std::string &Attrs) { | 286 | 2 | if (SrcNodePort > 642 ) return0 ; // Eminating from truncated part? | 287 | 2 | if (2 DestNodePort > 642 ) DestNodePort = 640 ; // Targeting the truncated part? | 288 | 2 | | 289 | 2 | O << "\tNode" << SrcNodeID; | 290 | 2 | if (SrcNodePort >= 0) | 291 | 0 | O << ":s" << SrcNodePort; | 292 | 2 | O << " -> Node" << DestNodeID; | 293 | 2 | if (DestNodePort >= 0 && 2 DTraits.hasEdgeDestLabels()0 ) | 294 | 0 | O << ":d" << DestNodePort; | 295 | 2 | | 296 | 2 | if (!Attrs.empty()) | 297 | 0 | O << "[" << Attrs << "]"; | 298 | 2 | O << ";\n"; | 299 | 2 | } |
Unexecuted instantiation: llvm::GraphWriter<llvm::CallGraph*>::emitEdge(void const*, int, void const*, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Unexecuted instantiation: llvm::GraphWriter<llvm::DominatorTree*>::emitEdge(void const*, int, void const*, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) |
300 | | |
301 | | /// getOStream - Get the raw output stream into the graph file. Useful to |
302 | | /// write fancy things using addCustomGraphFeatures(). |
303 | 1 | raw_ostream &getOStream() { |
304 | 1 | return O; |
305 | 1 | } llvm::GraphWriter<polly::ScopDetectionWrapperPass*>::getOStream() Line | Count | Source | 303 | 1 | raw_ostream &getOStream() { | 304 | 1 | return O; | 305 | 1 | } |
Unexecuted instantiation: llvm::GraphWriter<llvm::RegionInfo*>::getOStream() |
306 | | }; |
307 | | |
308 | | template<typename GraphType> |
309 | | raw_ostream &WriteGraph(raw_ostream &O, const GraphType &G, |
310 | | bool ShortNames = false, |
311 | 3 | const Twine &Title = "") { |
312 | 3 | // Start the graph emission process... |
313 | 3 | GraphWriter<GraphType> W(O, G, ShortNames); |
314 | 3 | |
315 | 3 | // Emit the graph. |
316 | 3 | W.writeGraph(Title.str()); |
317 | 3 | |
318 | 3 | return O; |
319 | 3 | } Unexecuted instantiation: PGOInstrumentation.cpp:llvm::raw_ostream& llvm::WriteGraph<(anonymous namespace)::PGOUseFunc*>(llvm::raw_ostream&, (anonymous namespace)::PGOUseFunc* const&, bool, llvm::Twine const&) llvm::raw_ostream& llvm::WriteGraph<llvm::Function const*>(llvm::raw_ostream&, llvm::Function const* const&, bool, llvm::Twine const&) Line | Count | Source | 311 | 2 | const Twine &Title = "") { | 312 | 2 | // Start the graph emission process... | 313 | 2 | GraphWriter<GraphType> W(O, G, ShortNames); | 314 | 2 | | 315 | 2 | // Emit the graph. | 316 | 2 | W.writeGraph(Title.str()); | 317 | 2 | | 318 | 2 | return O; | 319 | 2 | } |
Unexecuted instantiation: llvm::raw_ostream& llvm::WriteGraph<llvm::CallGraph*>(llvm::raw_ostream&, llvm::CallGraph* const&, bool, llvm::Twine const&) Unexecuted instantiation: llvm::raw_ostream& llvm::WriteGraph<llvm::DominatorTree*>(llvm::raw_ostream&, llvm::DominatorTree* const&, bool, llvm::Twine const&) Unexecuted instantiation: llvm::raw_ostream& llvm::WriteGraph<llvm::PostDominatorTree*>(llvm::raw_ostream&, llvm::PostDominatorTree* const&, bool, llvm::Twine const&) Unexecuted instantiation: llvm::raw_ostream& llvm::WriteGraph<llvm::MachineBlockFrequencyInfo*>(llvm::raw_ostream&, llvm::MachineBlockFrequencyInfo* const&, bool, llvm::Twine const&) Unexecuted instantiation: llvm::raw_ostream& llvm::WriteGraph<llvm::RegionInfo*>(llvm::raw_ostream&, llvm::RegionInfo* const&, bool, llvm::Twine const&) Unexecuted instantiation: llvm::raw_ostream& llvm::WriteGraph<clang::CallGraph const*>(llvm::raw_ostream&, clang::CallGraph const* const&, bool, llvm::Twine const&) llvm::raw_ostream& llvm::WriteGraph<polly::ScopDetectionWrapperPass*>(llvm::raw_ostream&, polly::ScopDetectionWrapperPass* const&, bool, llvm::Twine const&) Line | Count | Source | 311 | 1 | const Twine &Title = "") { | 312 | 1 | // Start the graph emission process... | 313 | 1 | GraphWriter<GraphType> W(O, G, ShortNames); | 314 | 1 | | 315 | 1 | // Emit the graph. | 316 | 1 | W.writeGraph(Title.str()); | 317 | 1 | | 318 | 1 | return O; | 319 | 1 | } |
Unexecuted instantiation: llvm::raw_ostream& llvm::WriteGraph<llvm::slpvectorizer::BoUpSLP*>(llvm::raw_ostream&, llvm::slpvectorizer::BoUpSLP* const&, bool, llvm::Twine const&) Unexecuted instantiation: llvm::raw_ostream& llvm::WriteGraph<llvm::BlockFrequencyInfo*>(llvm::raw_ostream&, llvm::BlockFrequencyInfo* const&, bool, llvm::Twine const&) |
320 | | |
321 | | std::string createGraphFilename(const Twine &Name, int &FD); |
322 | | |
323 | | template <typename GraphType> |
324 | | std::string WriteGraph(const GraphType &G, const Twine &Name, |
325 | 0 | bool ShortNames = false, const Twine &Title = "") { |
326 | 0 | int FD; |
327 | 0 | // Windows can't always handle long paths, so limit the length of the name. |
328 | 0 | std::string N = Name.str(); |
329 | 0 | N = N.substr(0, std::min<std::size_t>(N.size(), 140)); |
330 | 0 | std::string Filename = createGraphFilename(N, FD); |
331 | 0 | raw_fd_ostream O(FD, /*shouldClose=*/ true); |
332 | 0 |
|
333 | 0 | if (FD == -10 ) { |
334 | 0 | errs() << "error opening file '" << Filename << "' for writing!\n"; |
335 | 0 | return ""; |
336 | 0 | } |
337 | 0 |
|
338 | 0 | llvm::WriteGraph(O, G, ShortNames, Title); |
339 | 0 | errs() << " done. \n"; |
340 | 0 |
|
341 | 0 | return Filename; |
342 | 0 | } Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > llvm::WriteGraph<llvm::BlockFrequencyInfo*>(llvm::BlockFrequencyInfo* const&, llvm::Twine const&, bool, llvm::Twine const&) Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > llvm::WriteGraph<llvm::Function const*>(llvm::Function const* const&, llvm::Twine const&, bool, llvm::Twine const&) Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > llvm::WriteGraph<llvm::CallGraph*>(llvm::CallGraph* const&, llvm::Twine const&, bool, llvm::Twine const&) Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > llvm::WriteGraph<llvm::DominatorTree*>(llvm::DominatorTree* const&, llvm::Twine const&, bool, llvm::Twine const&) Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > llvm::WriteGraph<llvm::PostDominatorTree*>(llvm::PostDominatorTree* const&, llvm::Twine const&, bool, llvm::Twine const&) Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > llvm::WriteGraph<llvm::RegionInfo*>(llvm::RegionInfo* const&, llvm::Twine const&, bool, llvm::Twine const&) Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > llvm::WriteGraph<llvm::EdgeBundles>(llvm::EdgeBundles const&, llvm::Twine const&, bool, llvm::Twine const&) Unexecuted instantiation: PGOInstrumentation.cpp:std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > llvm::WriteGraph<(anonymous namespace)::PGOUseFunc*>((anonymous namespace)::PGOUseFunc* const&, llvm::Twine const&, bool, llvm::Twine const&) Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > llvm::WriteGraph<llvm::MachineBlockFrequencyInfo*>(llvm::MachineBlockFrequencyInfo* const&, llvm::Twine const&, bool, llvm::Twine const&) Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > llvm::WriteGraph<llvm::slpvectorizer::BoUpSLP*>(llvm::slpvectorizer::BoUpSLP* const&, llvm::Twine const&, bool, llvm::Twine const&) Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > llvm::WriteGraph<polly::ScopDetectionWrapperPass*>(polly::ScopDetectionWrapperPass* const&, llvm::Twine const&, bool, llvm::Twine const&) Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > llvm::WriteGraph<clang::CallGraph const*>(clang::CallGraph const* const&, llvm::Twine const&, bool, llvm::Twine const&) |
343 | | |
344 | | /// ViewGraph - Emit a dot graph, run 'dot', run gv on the postscript file, |
345 | | /// then cleanup. For use from the debugger. |
346 | | /// |
347 | | template<typename GraphType> |
348 | | void ViewGraph(const GraphType &G, const Twine &Name, |
349 | | bool ShortNames = false, const Twine &Title = "", |
350 | 0 | GraphProgram::Name Program = GraphProgram::DOT) { |
351 | 0 | std::string Filename = llvm::WriteGraph(G, Name, ShortNames, Title); |
352 | 0 |
|
353 | 0 | if (Filename.empty()) |
354 | 0 | return; |
355 | 0 |
|
356 | 0 | DisplayGraph(Filename, false, Program); |
357 | 0 | } Unexecuted instantiation: void llvm::ViewGraph<llvm::EdgeBundles>(llvm::EdgeBundles const&, llvm::Twine const&, bool, llvm::Twine const&, llvm::GraphProgram::Name) Unexecuted instantiation: void llvm::ViewGraph<llvm::MachineBlockFrequencyInfo*>(llvm::MachineBlockFrequencyInfo* const&, llvm::Twine const&, bool, llvm::Twine const&, llvm::GraphProgram::Name) Unexecuted instantiation: void llvm::ViewGraph<llvm::RegionInfo*>(llvm::RegionInfo* const&, llvm::Twine const&, bool, llvm::Twine const&, llvm::GraphProgram::Name) Unexecuted instantiation: void llvm::ViewGraph<llvm::PostDominatorTree*>(llvm::PostDominatorTree* const&, llvm::Twine const&, bool, llvm::Twine const&, llvm::GraphProgram::Name) Unexecuted instantiation: void llvm::ViewGraph<llvm::DominatorTree*>(llvm::DominatorTree* const&, llvm::Twine const&, bool, llvm::Twine const&, llvm::GraphProgram::Name) Unexecuted instantiation: void llvm::ViewGraph<llvm::CallGraph*>(llvm::CallGraph* const&, llvm::Twine const&, bool, llvm::Twine const&, llvm::GraphProgram::Name) Unexecuted instantiation: void llvm::ViewGraph<llvm::Function const*>(llvm::Function const* const&, llvm::Twine const&, bool, llvm::Twine const&, llvm::GraphProgram::Name) Unexecuted instantiation: void llvm::ViewGraph<llvm::BlockFrequencyInfo*>(llvm::BlockFrequencyInfo* const&, llvm::Twine const&, bool, llvm::Twine const&, llvm::GraphProgram::Name) Unexecuted instantiation: PGOInstrumentation.cpp:void llvm::ViewGraph<(anonymous namespace)::PGOUseFunc*>((anonymous namespace)::PGOUseFunc* const&, llvm::Twine const&, bool, llvm::Twine const&, llvm::GraphProgram::Name) Unexecuted instantiation: void llvm::ViewGraph<llvm::slpvectorizer::BoUpSLP*>(llvm::slpvectorizer::BoUpSLP* const&, llvm::Twine const&, bool, llvm::Twine const&, llvm::GraphProgram::Name) Unexecuted instantiation: void llvm::ViewGraph<clang::CallGraph const*>(clang::CallGraph const* const&, llvm::Twine const&, bool, llvm::Twine const&, llvm::GraphProgram::Name) Unexecuted instantiation: void llvm::ViewGraph<polly::ScopDetectionWrapperPass*>(polly::ScopDetectionWrapperPass* const&, llvm::Twine const&, bool, llvm::Twine const&, llvm::GraphProgram::Name) |
358 | | |
359 | | } // end namespace llvm |
360 | | |
361 | | #endif // LLVM_SUPPORT_GRAPHWRITER_H |