Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/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
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
//
9
// This file defines a simple interface that can be used to print out generic
10
// LLVM graphs to ".dot" files.  "dot" is a tool that is part of the AT&T
11
// graphviz package (http://www.research.att.com/sw/tools/graphviz/) which can
12
// be used to turn the files output by this interface into a variety of
13
// different graphics formats.
14
//
15
// Graphs do not need to implement any interface past what is already required
16
// by the GraphTraits template, but they can choose to implement specializations
17
// of the DOTGraphTraits template if they want to customize the graphs output in
18
// any way.
19
//
20
//===----------------------------------------------------------------------===//
21
22
#ifndef LLVM_SUPPORT_GRAPHWRITER_H
23
#define LLVM_SUPPORT_GRAPHWRITER_H
24
25
#include "llvm/ADT/GraphTraits.h"
26
#include "llvm/ADT/StringRef.h"
27
#include "llvm/ADT/Twine.h"
28
#include "llvm/Support/DOTGraphTraits.h"
29
#include "llvm/Support/FileSystem.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
/// 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
16
  bool getEdgeSourceLabels(raw_ostream &O, NodeRef Node) {
85
16
    child_iterator EI = GTraits::child_begin(Node);
86
16
    child_iterator EE = GTraits::child_end(Node);
87
16
    bool hasEdgeSourceLabels = false;
88
16
89
31
    for (unsigned i = 0; EI != EE && 
i != 6415
;
++EI, ++i15
) {
90
15
      std::string label = DTraits.getEdgeSourceLabel(Node, EI);
91
15
92
15
      if (label.empty())
93
13
        continue;
94
2
95
2
      hasEdgeSourceLabels = true;
96
2
97
2
      if (i)
98
1
        O << "|";
99
2
100
2
      O << "<s" << i << ">" << DOT::EscapeString(label);
101
2
    }
102
16
103
16
    if (EI != EE && 
hasEdgeSourceLabels0
)
104
0
      O << "|<s64>truncated...";
105
16
106
16
    return hasEdgeSourceLabels;
107
16
  }
Unexecuted instantiation: llvm::GraphWriter<llvm::BlockFrequencyInfo*>::getEdgeSourceLabels(llvm::raw_ostream&, llvm::BasicBlock const*)
llvm::GraphWriter<llvm::Function const*>::getEdgeSourceLabels(llvm::raw_ostream&, llvm::BasicBlock const*)
Line
Count
Source
84
7
  bool getEdgeSourceLabels(raw_ostream &O, NodeRef Node) {
85
7
    child_iterator EI = GTraits::child_begin(Node);
86
7
    child_iterator EE = GTraits::child_end(Node);
87
7
    bool hasEdgeSourceLabels = false;
88
7
89
12
    for (unsigned i = 0; EI != EE && 
i != 645
;
++EI, ++i5
) {
90
5
      std::string label = DTraits.getEdgeSourceLabel(Node, EI);
91
5
92
5
      if (label.empty())
93
3
        continue;
94
2
95
2
      hasEdgeSourceLabels = true;
96
2
97
2
      if (i)
98
1
        O << "|";
99
2
100
2
      O << "<s" << i << ">" << DOT::EscapeString(label);
101
2
    }
102
7
103
7
    if (EI != EE && 
hasEdgeSourceLabels0
)
104
0
      O << "|<s64>truncated...";
105
7
106
7
    return hasEdgeSourceLabels;
107
7
  }
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 && 
i != 6410
;
++EI, ++i10
) {
90
10
      std::string label = DTraits.getEdgeSourceLabel(Node, EI);
91
10
92
10
      if (label.empty())
93
10
        continue;
94
0
95
0
      hasEdgeSourceLabels = true;
96
0
97
0
      if (i)
98
0
        O << "|";
99
0
100
0
      O << "<s" << i << ">" << DOT::EscapeString(label);
101
0
    }
102
9
103
9
    if (EI != EE && 
hasEdgeSourceLabels0
)
104
0
      O << "|<s64>truncated...";
105
9
106
9
    return hasEdgeSourceLabels;
107
9
  }
Unexecuted instantiation: llvm::GraphWriter<clang::CallGraph const*>::getEdgeSourceLabels(llvm::raw_ostream&, clang::CallGraphNode const*)
108
109
public:
110
4
  GraphWriter(raw_ostream &o, const GraphType &g, bool SN) : O(o), G(g) {
111
4
    DTraits = DOTTraits(SN);
112
4
  }
Unexecuted instantiation: llvm::GraphWriter<llvm::BlockFrequencyInfo*>::GraphWriter(llvm::raw_ostream&, llvm::BlockFrequencyInfo* const&, bool)
llvm::GraphWriter<llvm::Function const*>::GraphWriter(llvm::raw_ostream&, llvm::Function const* const&, bool)
Line
Count
Source
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<llvm::CallGraph*>::GraphWriter(llvm::raw_ostream&, llvm::CallGraph* const&, bool)
Unexecuted instantiation: llvm::GraphWriter<llvm::DominatorTree*>::GraphWriter(llvm::raw_ostream&, llvm::DominatorTree* const&, bool)
Unexecuted instantiation: llvm::GraphWriter<llvm::PostDominatorTree*>::GraphWriter(llvm::raw_ostream&, llvm::PostDominatorTree* const&, bool)
Unexecuted instantiation: llvm::GraphWriter<llvm::RegionInfo*>::GraphWriter(llvm::raw_ostream&, llvm::RegionInfo* const&, bool)
Unexecuted instantiation: llvm::GraphWriter<llvm::MachineBlockFrequencyInfo*>::GraphWriter(llvm::raw_ostream&, llvm::MachineBlockFrequencyInfo* 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::slpvectorizer::BoUpSLP*>::GraphWriter(llvm::raw_ostream&, llvm::slpvectorizer::BoUpSLP* 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<clang::CallGraph const*>::GraphWriter(llvm::raw_ostream&, clang::CallGraph const* const&, bool)
113
114
4
  void writeGraph(const std::string &Title = "") {
115
4
    // Output the header for the graph...
116
4
    writeHeader(Title);
117
4
118
4
    // Emit all of the nodes in the graph...
119
4
    writeNodes();
120
4
121
4
    // Output any customizations on the graph
122
4
    DOTGraphTraits<GraphType>::addCustomGraphFeatures(G, *this);
123
4
124
4
    // Output the end of the graph
125
4
    writeFooter();
126
4
  }
Unexecuted instantiation: llvm::GraphWriter<llvm::BlockFrequencyInfo*>::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
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<llvm::CallGraph*>::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::PostDominatorTree*>::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::MachineBlockFrequencyInfo*>::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::slpvectorizer::BoUpSLP*>::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<clang::CallGraph const*>::writeGraph(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
127
128
4
  void writeHeader(const std::string &Title) {
129
4
    std::string GraphName = DTraits.getGraphName(G);
130
4
131
4
    if (!Title.empty())
132
1
      O << "digraph \"" << DOT::EscapeString(Title) << "\" {\n";
133
3
    else if (!GraphName.empty())
134
3
      O << "digraph \"" << DOT::EscapeString(GraphName) << "\" {\n";
135
0
    else
136
0
      O << "digraph unnamed {\n";
137
4
138
4
    if (DTraits.renderGraphFromBottomUp())
139
0
      O << "\trankdir=\"BT\";\n";
140
4
141
4
    if (!Title.empty())
142
1
      O << "\tlabel=\"" << DOT::EscapeString(Title) << "\";\n";
143
3
    else if (!GraphName.empty())
144
3
      O << "\tlabel=\"" << DOT::EscapeString(GraphName) << "\";\n";
145
4
    O << DTraits.getGraphProperties(G);
146
4
    O << "\n";
147
4
  }
Unexecuted instantiation: llvm::GraphWriter<llvm::BlockFrequencyInfo*>::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
3
  void writeHeader(const std::string &Title) {
129
3
    std::string GraphName = DTraits.getGraphName(G);
130
3
131
3
    if (!Title.empty())
132
0
      O << "digraph \"" << DOT::EscapeString(Title) << "\" {\n";
133
3
    else if (!GraphName.empty())
134
3
      O << "digraph \"" << DOT::EscapeString(GraphName) << "\" {\n";
135
0
    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
0
      O << "\tlabel=\"" << DOT::EscapeString(Title) << "\";\n";
143
3
    else if (!GraphName.empty())
144
3
      O << "\tlabel=\"" << DOT::EscapeString(GraphName) << "\";\n";
145
3
    O << DTraits.getGraphProperties(G);
146
3
    O << "\n";
147
3
  }
Unexecuted instantiation: llvm::GraphWriter<llvm::CallGraph*>::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::PostDominatorTree*>::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::MachineBlockFrequencyInfo*>::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::slpvectorizer::BoUpSLP*>::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 (!GraphName.empty())
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 (!GraphName.empty())
144
0
      O << "\tlabel=\"" << DOT::EscapeString(GraphName) << "\";\n";
145
1
    O << DTraits.getGraphProperties(G);
146
1
    O << "\n";
147
1
  }
Unexecuted instantiation: llvm::GraphWriter<clang::CallGraph const*>::writeHeader(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
148
149
4
  void writeFooter() {
150
4
    // Finish off the graph
151
4
    O << "}\n";
152
4
  }
Unexecuted instantiation: llvm::GraphWriter<llvm::BlockFrequencyInfo*>::writeFooter()
llvm::GraphWriter<llvm::Function const*>::writeFooter()
Line
Count
Source
149
3
  void writeFooter() {
150
3
    // Finish off the graph
151
3
    O << "}\n";
152
3
  }
Unexecuted instantiation: llvm::GraphWriter<llvm::CallGraph*>::writeFooter()
Unexecuted instantiation: llvm::GraphWriter<llvm::DominatorTree*>::writeFooter()
Unexecuted instantiation: llvm::GraphWriter<llvm::PostDominatorTree*>::writeFooter()
Unexecuted instantiation: llvm::GraphWriter<llvm::RegionInfo*>::writeFooter()
Unexecuted instantiation: llvm::GraphWriter<llvm::MachineBlockFrequencyInfo*>::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
4
  void writeNodes() {
155
4
    // Loop over the graph, printing it out...
156
4
    for (const auto Node : nodes<GraphType>(G))
157
16
      if (!isNodeHidden(Node))
158
16
        writeNode(Node);
159
4
  }
Unexecuted instantiation: llvm::GraphWriter<llvm::BlockFrequencyInfo*>::writeNodes()
llvm::GraphWriter<llvm::Function const*>::writeNodes()
Line
Count
Source
154
3
  void writeNodes() {
155
3
    // Loop over the graph, printing it out...
156
3
    for (const auto Node : nodes<GraphType>(G))
157
7
      if (!isNodeHidden(Node))
158
7
        writeNode(Node);
159
3
  }
Unexecuted instantiation: llvm::GraphWriter<llvm::CallGraph*>::writeNodes()
Unexecuted instantiation: llvm::GraphWriter<llvm::DominatorTree*>::writeNodes()
Unexecuted instantiation: llvm::GraphWriter<llvm::PostDominatorTree*>::writeNodes()
Unexecuted instantiation: llvm::GraphWriter<llvm::RegionInfo*>::writeNodes()
Unexecuted instantiation: llvm::GraphWriter<llvm::MachineBlockFrequencyInfo*>::writeNodes()
Unexecuted instantiation: PGOInstrumentation.cpp:llvm::GraphWriter<(anonymous namespace)::PGOUseFunc*>::writeNodes()
Unexecuted instantiation: llvm::GraphWriter<llvm::slpvectorizer::BoUpSLP*>::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 (!isNodeHidden(Node))
158
9
        writeNode(Node);
159
1
  }
Unexecuted instantiation: llvm::GraphWriter<clang::CallGraph const*>::writeNodes()
160
161
16
  bool isNodeHidden(NodeRef Node) {
162
16
    return DTraits.isNodeHidden(Node);
163
16
  }
Unexecuted instantiation: llvm::GraphWriter<llvm::BlockFrequencyInfo*>::isNodeHidden(llvm::BasicBlock const*)
llvm::GraphWriter<llvm::Function const*>::isNodeHidden(llvm::BasicBlock const*)
Line
Count
Source
161
7
  bool isNodeHidden(NodeRef Node) {
162
7
    return DTraits.isNodeHidden(Node);
163
7
  }
Unexecuted instantiation: llvm::GraphWriter<llvm::CallGraph*>::isNodeHidden(llvm::CallGraphNode*)
Unexecuted instantiation: llvm::GraphWriter<llvm::DominatorTree*>::isNodeHidden(llvm::DomTreeNodeBase<llvm::BasicBlock>*)
Unexecuted instantiation: llvm::GraphWriter<llvm::PostDominatorTree*>::isNodeHidden(llvm::DomTreeNodeBase<llvm::BasicBlock>*)
Unexecuted instantiation: llvm::GraphWriter<llvm::RegionInfo*>::isNodeHidden(llvm::RegionNode*)
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*)
164
165
16
  void writeNode(NodeRef Node) {
166
16
    std::string NodeAttributes = DTraits.getNodeAttributes(Node, G);
167
16
168
16
    O << "\tNode" << static_cast<const void*>(Node) << " [shape=record,";
169
16
    if (!NodeAttributes.empty()) 
O << NodeAttributes << ","0
;
170
16
    O << "label=\"{";
171
16
172
16
    if (!DTraits.renderGraphFromBottomUp()) {
173
16
      O << DOT::EscapeString(DTraits.getNodeLabel(Node, G));
174
16
175
16
      // If we should include the address of the node in the label, do so now.
176
16
      std::string Id = DTraits.getNodeIdentifierLabel(Node, G);
177
16
      if (!Id.empty())
178
0
        O << "|" << DOT::EscapeString(Id);
179
16
180
16
      std::string NodeDesc = DTraits.getNodeDescription(Node, G);
181
16
      if (!NodeDesc.empty())
182
0
        O << "|" << DOT::EscapeString(NodeDesc);
183
16
    }
184
16
185
16
    std::string edgeSourceLabels;
186
16
    raw_string_ostream EdgeSourceLabels(edgeSourceLabels);
187
16
    bool hasEdgeSourceLabels = getEdgeSourceLabels(EdgeSourceLabels, Node);
188
16
189
16
    if (hasEdgeSourceLabels) {
190
1
      if (!DTraits.renderGraphFromBottomUp()) O << "|";
191
1
192
1
      O << "{" << EdgeSourceLabels.str() << "}";
193
1
194
1
      if (DTraits.renderGraphFromBottomUp()) 
O << "|"0
;
195
1
    }
196
16
197
16
    if (DTraits.renderGraphFromBottomUp()) {
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
16
210
16
    if (DTraits.hasEdgeDestLabels()) {
211
0
      O << "|{";
212
0
213
0
      unsigned i = 0, e = DTraits.numEdgeDestLabels(Node);
214
0
      for (; i != e && i != 64; ++i) {
215
0
        if (i) O << "|";
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
16
225
16
    O << "}\"];\n";   // Finish printing the "node" line
226
16
227
16
    // Output all of the edges now
228
16
    child_iterator EI = GTraits::child_begin(Node);
229
16
    child_iterator EE = GTraits::child_end(Node);
230
31
    for (unsigned i = 0; EI != EE && 
i != 6415
;
++EI, ++i15
)
231
15
      if (!DTraits.isNodeHidden(*EI))
232
15
        writeEdge(Node, i, EI);
233
16
    for (; EI != EE; 
++EI0
)
234
0
      if (!DTraits.isNodeHidden(*EI))
235
0
        writeEdge(Node, 64, EI);
236
16
  }
Unexecuted instantiation: llvm::GraphWriter<llvm::BlockFrequencyInfo*>::writeNode(llvm::BasicBlock const*)
llvm::GraphWriter<llvm::Function const*>::writeNode(llvm::BasicBlock const*)
Line
Count
Source
165
7
  void writeNode(NodeRef Node) {
166
7
    std::string NodeAttributes = DTraits.getNodeAttributes(Node, G);
167
7
168
7
    O << "\tNode" << static_cast<const void*>(Node) << " [shape=record,";
169
7
    if (!NodeAttributes.empty()) 
O << NodeAttributes << ","0
;
170
7
    O << "label=\"{";
171
7
172
7
    if (!DTraits.renderGraphFromBottomUp()) {
173
7
      O << DOT::EscapeString(DTraits.getNodeLabel(Node, G));
174
7
175
7
      // If we should include the address of the node in the label, do so now.
176
7
      std::string Id = DTraits.getNodeIdentifierLabel(Node, G);
177
7
      if (!Id.empty())
178
0
        O << "|" << DOT::EscapeString(Id);
179
7
180
7
      std::string NodeDesc = DTraits.getNodeDescription(Node, G);
181
7
      if (!NodeDesc.empty())
182
0
        O << "|" << DOT::EscapeString(NodeDesc);
183
7
    }
184
7
185
7
    std::string edgeSourceLabels;
186
7
    raw_string_ostream EdgeSourceLabels(edgeSourceLabels);
187
7
    bool hasEdgeSourceLabels = getEdgeSourceLabels(EdgeSourceLabels, Node);
188
7
189
7
    if (hasEdgeSourceLabels) {
190
1
      if (!DTraits.renderGraphFromBottomUp()) O << "|";
191
1
192
1
      O << "{" << EdgeSourceLabels.str() << "}";
193
1
194
1
      if (DTraits.renderGraphFromBottomUp()) 
O << "|"0
;
195
1
    }
196
7
197
7
    if (DTraits.renderGraphFromBottomUp()) {
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
7
210
7
    if (DTraits.hasEdgeDestLabels()) {
211
0
      O << "|{";
212
0
213
0
      unsigned i = 0, e = DTraits.numEdgeDestLabels(Node);
214
0
      for (; i != e && i != 64; ++i) {
215
0
        if (i) O << "|";
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
7
225
7
    O << "}\"];\n";   // Finish printing the "node" line
226
7
227
7
    // Output all of the edges now
228
7
    child_iterator EI = GTraits::child_begin(Node);
229
7
    child_iterator EE = GTraits::child_end(Node);
230
12
    for (unsigned i = 0; EI != EE && 
i != 645
;
++EI, ++i5
)
231
5
      if (!DTraits.isNodeHidden(*EI))
232
5
        writeEdge(Node, i, EI);
233
7
    for (; EI != EE; 
++EI0
)
234
0
      if (!DTraits.isNodeHidden(*EI))
235
0
        writeEdge(Node, 64, EI);
236
7
  }
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: llvm::GraphWriter<llvm::MachineBlockFrequencyInfo*>::writeNode(llvm::MachineBasicBlock const*)
Unexecuted instantiation: PGOInstrumentation.cpp:llvm::GraphWriter<(anonymous namespace)::PGOUseFunc*>::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()) 
O << NodeAttributes << ","0
;
170
9
    O << "label=\"{";
171
9
172
9
    if (!DTraits.renderGraphFromBottomUp()) {
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 (hasEdgeSourceLabels) {
190
0
      if (!DTraits.renderGraphFromBottomUp()) O << "|";
191
0
192
0
      O << "{" << EdgeSourceLabels.str() << "}";
193
0
194
0
      if (DTraits.renderGraphFromBottomUp()) O << "|";
195
0
    }
196
9
197
9
    if (DTraits.renderGraphFromBottomUp()) {
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()) {
211
0
      O << "|{";
212
0
213
0
      unsigned i = 0, e = DTraits.numEdgeDestLabels(Node);
214
0
      for (; i != e && i != 64; ++i) {
215
0
        if (i) O << "|";
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 && 
i != 6410
;
++EI, ++i10
)
231
10
      if (!DTraits.isNodeHidden(*EI))
232
10
        writeEdge(Node, i, EI);
233
9
    for (; EI != EE; 
++EI0
)
234
0
      if (!DTraits.isNodeHidden(*EI))
235
0
        writeEdge(Node, 64, EI);
236
9
  }
Unexecuted instantiation: llvm::GraphWriter<clang::CallGraph const*>::writeNode(clang::CallGraphNode const*)
237
238
15
  void writeEdge(NodeRef Node, unsigned edgeidx, child_iterator EI) {
239
15
    if (NodeRef TargetNode = *EI) {
240
15
      int DestPort = -1;
241
15
      if (DTraits.edgeTargetsEdgeSource(Node, EI)) {
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
15
250
15
      if (DTraits.getEdgeSourceLabel(Node, EI).empty())
251
13
        edgeidx = -1;
252
15
253
15
      emitEdge(static_cast<const void*>(Node), edgeidx,
254
15
               static_cast<const void*>(TargetNode), DestPort,
255
15
               DTraits.getEdgeAttributes(Node, EI, G));
256
15
    }
257
15
  }
Unexecuted instantiation: llvm::GraphWriter<llvm::BlockFrequencyInfo*>::writeEdge(llvm::BasicBlock const*, unsigned int, llvm::SuccIterator<llvm::Instruction const, llvm::BasicBlock const>)
llvm::GraphWriter<llvm::Function const*>::writeEdge(llvm::BasicBlock const*, unsigned int, llvm::SuccIterator<llvm::Instruction const, llvm::BasicBlock const>)
Line
Count
Source
238
5
  void writeEdge(NodeRef Node, unsigned edgeidx, child_iterator EI) {
239
5
    if (NodeRef TargetNode = *EI) {
240
5
      int DestPort = -1;
241
5
      if (DTraits.edgeTargetsEdgeSource(Node, EI)) {
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
5
250
5
      if (DTraits.getEdgeSourceLabel(Node, EI).empty())
251
3
        edgeidx = -1;
252
5
253
5
      emitEdge(static_cast<const void*>(Node), edgeidx,
254
5
               static_cast<const void*>(TargetNode), DestPort,
255
5
               DTraits.getEdgeAttributes(Node, EI, G));
256
5
    }
257
5
  }
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*>), 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::RegionInfo*>::writeEdge(llvm::RegionNode*, unsigned int, llvm::RNSuccIterator<llvm::FlatIt<llvm::RegionNode*>, llvm::BasicBlock, llvm::Region>)
Unexecuted instantiation: llvm::GraphWriter<llvm::MachineBlockFrequencyInfo*>::writeEdge(llvm::MachineBasicBlock const*, unsigned int, std::__1::__wrap_iter<llvm::MachineBasicBlock* const*>)
Unexecuted instantiation: PGOInstrumentation.cpp:llvm::GraphWriter<(anonymous namespace)::PGOUseFunc*>::writeEdge(llvm::BasicBlock const*, unsigned int, llvm::SuccIterator<llvm::Instruction const, llvm::BasicBlock const>)
Unexecuted instantiation: llvm::GraphWriter<llvm::slpvectorizer::BoUpSLP*>::writeEdge(llvm::slpvectorizer::BoUpSLP::TreeEntry*, unsigned int, llvm::GraphTraits<llvm::slpvectorizer::BoUpSLP*>::ChildIteratorType)
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 TargetNode = *EI) {
240
10
      int DestPort = -1;
241
10
      if (DTraits.edgeTargetsEdgeSource(Node, EI)) {
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<clang::CallGraph const*>::writeEdge(clang::CallGraphNode const*, unsigned int, clang::CallGraphNode* const*)
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 (NumEdgeSources) O << "{";
268
0
    O << DOT::EscapeString(Label);
269
0
    if (NumEdgeSources) {
270
0
      O << "|{";
271
0
272
0
      for (unsigned i = 0; i != NumEdgeSources; ++i) {
273
0
        if (i) O << "|";
274
0
        O << "<s" << i << ">";
275
0
        if (EdgeSourceLabels) O << DOT::EscapeString((*EdgeSourceLabels)[i]);
276
0
      }
277
0
      O << "}}";
278
0
    }
279
0
    O << "\"];\n";
280
0
  }
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*)
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*)
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
15
                const std::string &Attrs) {
286
15
    if (SrcNodePort  > 64) 
return0
; // Eminating from truncated part?
287
15
    if (DestNodePort > 64) 
DestNodePort = 640
; // Targeting the truncated part?
288
15
289
15
    O << "\tNode" << SrcNodeID;
290
15
    if (SrcNodePort >= 0)
291
2
      O << ":s" << SrcNodePort;
292
15
    O << " -> Node" << DestNodeID;
293
15
    if (DestNodePort >= 0 && 
DTraits.hasEdgeDestLabels()0
)
294
0
      O << ":d" << DestNodePort;
295
15
296
15
    if (!Attrs.empty())
297
4
      O << "[" << Attrs << "]";
298
15
    O << ";\n";
299
15
  }
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
5
                const std::string &Attrs) {
286
5
    if (SrcNodePort  > 64) 
return0
; // Eminating from truncated part?
287
5
    if (DestNodePort > 64) 
DestNodePort = 640
; // Targeting the truncated part?
288
5
289
5
    O << "\tNode" << SrcNodeID;
290
5
    if (SrcNodePort >= 0)
291
2
      O << ":s" << SrcNodePort;
292
5
    O << " -> Node" << DestNodeID;
293
5
    if (DestNodePort >= 0 && 
DTraits.hasEdgeDestLabels()0
)
294
0
      O << ":d" << DestNodePort;
295
5
296
5
    if (!Attrs.empty())
297
2
      O << "[" << Attrs << "]";
298
5
    O << ";\n";
299
5
  }
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&)
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&)
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::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: 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::slpvectorizer::BoUpSLP*>::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  > 64) 
return0
; // Eminating from truncated part?
287
10
    if (DestNodePort > 64) 
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 && 
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::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::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<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&)
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
  }
Unexecuted instantiation: llvm::GraphWriter<llvm::RegionInfo*>::getOStream()
llvm::GraphWriter<polly::ScopDetectionWrapperPass*>::getOStream()
Line
Count
Source
303
1
  raw_ostream &getOStream() {
304
1
    return O;
305
1
  }
306
};
307
308
template<typename GraphType>
309
raw_ostream &WriteGraph(raw_ostream &O, const GraphType &G,
310
                        bool ShortNames = false,
311
4
                        const Twine &Title = "") {
312
4
  // Start the graph emission process...
313
4
  GraphWriter<GraphType> W(O, G, ShortNames);
314
4
315
4
  // Emit the graph.
316
4
  W.writeGraph(Title.str());
317
4
318
4
  return O;
319
4
}
Unexecuted instantiation: llvm::raw_ostream& llvm::WriteGraph<llvm::BlockFrequencyInfo*>(llvm::raw_ostream&, llvm::BlockFrequencyInfo* 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
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: 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::RegionInfo*>(llvm::raw_ostream&, llvm::RegionInfo* 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: PGOInstrumentation.cpp:llvm::raw_ostream& llvm::WriteGraph<(anonymous namespace)::PGOUseFunc*>(llvm::raw_ostream&, (anonymous namespace)::PGOUseFunc* const&, bool, llvm::Twine const&)
Unexecuted instantiation: llvm::raw_ostream& llvm::WriteGraph<llvm::slpvectorizer::BoUpSLP*>(llvm::raw_ostream&, llvm::slpvectorizer::BoUpSLP* 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<clang::CallGraph const*>(llvm::raw_ostream&, clang::CallGraph const* const&, bool, llvm::Twine const&)
320
321
std::string createGraphFilename(const Twine &Name, int &FD);
322
323
/// Writes graph into a provided {@code Filename}.
324
/// If {@code Filename} is empty, generates a random one.
325
/// \return The resulting filename, or an empty string if writing
326
/// failed.
327
template <typename GraphType>
328
std::string WriteGraph(const GraphType &G, const Twine &Name,
329
                       bool ShortNames = false,
330
                       const Twine &Title = "",
331
0
                       std::string Filename = "") {
332
0
  int FD;
333
0
  // Windows can't always handle long paths, so limit the length of the name.
334
0
  std::string N = Name.str();
335
0
  N = N.substr(0, std::min<std::size_t>(N.size(), 140));
336
0
  if (Filename.empty()) {
337
0
    Filename = createGraphFilename(N, FD);
338
0
  } else {
339
0
    std::error_code EC = sys::fs::openFileForWrite(Filename, FD);
340
0
341
0
    // Writing over an existing file is not considered an error.
342
0
    if (EC == std::errc::file_exists) {
343
0
      errs() << "file exists, overwriting" << "\n";
344
0
    } else if (EC) {
345
0
      errs() << "error writing into file" << "\n";
346
0
      return "";
347
0
    }
348
0
  }
349
0
  raw_fd_ostream O(FD, /*shouldClose=*/ true);
350
0
351
0
  if (FD == -1) {
352
0
    errs() << "error opening file '" << Filename << "' for writing!\n";
353
0
    return "";
354
0
  }
355
0
356
0
  llvm::WriteGraph(O, G, ShortNames, Title);
357
0
  errs() << " done. \n";
358
0
359
0
  return Filename;
360
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&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)
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&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)
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&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)
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&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)
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&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)
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&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)
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&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)
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&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)
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&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)
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&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)
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&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)
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&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)
361
362
/// ViewGraph - Emit a dot graph, run 'dot', run gv on the postscript file,
363
/// then cleanup.  For use from the debugger.
364
///
365
template<typename GraphType>
366
void ViewGraph(const GraphType &G, const Twine &Name,
367
               bool ShortNames = false, const Twine &Title = "",
368
0
               GraphProgram::Name Program = GraphProgram::DOT) {
369
0
  std::string Filename = llvm::WriteGraph(G, Name, ShortNames, Title);
370
0
371
0
  if (Filename.empty())
372
0
    return;
373
0
374
0
  DisplayGraph(Filename, false, Program);
375
0
}
Unexecuted instantiation: void llvm::ViewGraph<llvm::BlockFrequencyInfo*>(llvm::BlockFrequencyInfo* 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::CallGraph*>(llvm::CallGraph* 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::PostDominatorTree*>(llvm::PostDominatorTree* 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::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: 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<polly::ScopDetectionWrapperPass*>(polly::ScopDetectionWrapperPass* 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)
376
377
} // end namespace llvm
378
379
#endif // LLVM_SUPPORT_GRAPHWRITER_H