Coverage Report

Created: 2017-10-03 07:32

/Users/buildslave/jenkins/sharedspace/clang-stage2-coverage-R@2/llvm/include/llvm/Support/DOTGraphTraits.h
Line
Count
Source (jump to first uncovered line)
1
//===-- llvm/Support/DotGraphTraits.h - Customize .dot output ---*- 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 template class that can be used to customize dot output
11
// graphs generated by the GraphWriter.h file.  The default implementation of
12
// this file will produce a simple, but not very polished graph.  By
13
// specializing this template, lots of customization opportunities are possible.
14
//
15
//===----------------------------------------------------------------------===//
16
17
#ifndef LLVM_SUPPORT_DOTGRAPHTRAITS_H
18
#define LLVM_SUPPORT_DOTGRAPHTRAITS_H
19
20
#include <string>
21
22
namespace llvm {
23
24
/// DefaultDOTGraphTraits - This class provides the default implementations of
25
/// all of the DOTGraphTraits methods.  If a specialization does not need to
26
/// override all methods here it should inherit so that it can get the default
27
/// implementations.
28
///
29
struct DefaultDOTGraphTraits {
30
private:
31
  bool IsSimple;
32
33
protected:
34
13
  bool isSimple() {
35
13
    return IsSimple;
36
13
  }
37
38
public:
39
6
  explicit DefaultDOTGraphTraits(bool simple=false) : IsSimple (simple) {}
40
41
  /// getGraphName - Return the label for the graph as a whole.  Printed at the
42
  /// top of the graph.
43
  ///
44
  template<typename GraphType>
45
0
  static std::string getGraphName(const GraphType &) { return ""; }
46
47
  /// getGraphProperties - Return any custom properties that should be included
48
  /// in the top level graph structure for dot.
49
  ///
50
  template<typename GraphType>
51
0
  static std::string getGraphProperties(const GraphType &) {
52
0
    return "";
53
0
  }
Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > llvm::DefaultDOTGraphTraits::getGraphProperties<llvm::BlockFrequencyInfo*>(llvm::BlockFrequencyInfo* const&)
Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > llvm::DefaultDOTGraphTraits::getGraphProperties<llvm::MachineBlockFrequencyInfo*>(llvm::MachineBlockFrequencyInfo* const&)
Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > llvm::DefaultDOTGraphTraits::getGraphProperties<llvm::slpvectorizer::BoUpSLP*>(llvm::slpvectorizer::BoUpSLP* const&)
Unexecuted instantiation: PGOInstrumentation.cpp:std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > llvm::DefaultDOTGraphTraits::getGraphProperties<(anonymous namespace)::PGOUseFunc*>((anonymous namespace)::PGOUseFunc* const&)
54
55
  /// renderGraphFromBottomUp - If this function returns true, the graph is
56
  /// emitted bottom-up instead of top-down.  This requires graphviz 2.0 to work
57
  /// though.
58
29
  static bool renderGraphFromBottomUp() {
59
29
    return false;
60
29
  }
61
62
  /// isNodeHidden - If the function returns true, the given node is not
63
  /// displayed in the graph.
64
25
  static bool isNodeHidden(const void *) {
65
25
    return false;
66
25
  }
67
68
  /// getNodeLabel - Given a node and a pointer to the top level graph, return
69
  /// the label to print in the node.
70
  template<typename GraphType>
71
  std::string getNodeLabel(const void *, const GraphType &) {
72
    return "";
73
  }
74
75
  // getNodeIdentifierLabel - Returns a string representing the
76
  // address or other unique identifier of the node. (Only used if
77
  // non-empty.)
78
  template <typename GraphType>
79
0
  static std::string getNodeIdentifierLabel(const void *, const GraphType &) {
80
0
    return "";
81
0
  }
Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > llvm::DefaultDOTGraphTraits::getNodeIdentifierLabel<llvm::BlockFrequencyInfo*>(void const*, llvm::BlockFrequencyInfo* const&)
Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > llvm::DefaultDOTGraphTraits::getNodeIdentifierLabel<llvm::MachineBlockFrequencyInfo*>(void const*, llvm::MachineBlockFrequencyInfo* const&)
Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > llvm::DefaultDOTGraphTraits::getNodeIdentifierLabel<llvm::slpvectorizer::BoUpSLP*>(void const*, llvm::slpvectorizer::BoUpSLP* const&)
Unexecuted instantiation: PGOInstrumentation.cpp:std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > llvm::DefaultDOTGraphTraits::getNodeIdentifierLabel<(anonymous namespace)::PGOUseFunc*>(void const*, (anonymous namespace)::PGOUseFunc* const&)
82
83
  template<typename GraphType>
84
0
  static std::string getNodeDescription(const void *, const GraphType &) {
85
0
    return "";
86
0
  }
Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > llvm::DefaultDOTGraphTraits::getNodeDescription<llvm::BlockFrequencyInfo*>(void const*, llvm::BlockFrequencyInfo* const&)
Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > llvm::DefaultDOTGraphTraits::getNodeDescription<llvm::MachineBlockFrequencyInfo*>(void const*, llvm::MachineBlockFrequencyInfo* const&)
Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > llvm::DefaultDOTGraphTraits::getNodeDescription<llvm::slpvectorizer::BoUpSLP*>(void const*, llvm::slpvectorizer::BoUpSLP* const&)
Unexecuted instantiation: PGOInstrumentation.cpp:std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > llvm::DefaultDOTGraphTraits::getNodeDescription<(anonymous namespace)::PGOUseFunc*>(void const*, (anonymous namespace)::PGOUseFunc* const&)
87
88
  /// If you want to specify custom node attributes, this is the place to do so
89
  ///
90
  template<typename GraphType>
91
  static std::string getNodeAttributes(const void *,
92
0
                                       const GraphType &) {
93
0
    return "";
94
0
  }
95
96
  /// If you want to override the dot attributes printed for a particular edge,
97
  /// override this method.
98
  template<typename EdgeIter, typename GraphType>
99
  static std::string getEdgeAttributes(const void *, EdgeIter,
100
0
                                       const GraphType &) {
101
0
    return "";
102
0
  }
Unexecuted instantiation: PGOInstrumentation.cpp:std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > llvm::DefaultDOTGraphTraits::getEdgeAttributes<llvm::TerminatorInst::SuccIterator<llvm::TerminatorInst const*, llvm::BasicBlock const>, (anonymous namespace)::PGOUseFunc*>(void const*, llvm::TerminatorInst::SuccIterator<llvm::TerminatorInst const*, llvm::BasicBlock const>, (anonymous namespace)::PGOUseFunc* const&)
Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > llvm::DefaultDOTGraphTraits::getEdgeAttributes<llvm::GraphTraits<llvm::slpvectorizer::BoUpSLP*>::ChildIteratorType, llvm::slpvectorizer::BoUpSLP*>(void const*, llvm::GraphTraits<llvm::slpvectorizer::BoUpSLP*>::ChildIteratorType, llvm::slpvectorizer::BoUpSLP* const&)
103
104
  /// getEdgeSourceLabel - If you want to label the edge source itself,
105
  /// implement this method.
106
  template<typename EdgeIter>
107
0
  static std::string getEdgeSourceLabel(const void *, EdgeIter) {
108
0
    return "";
109
0
  }
Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > llvm::DefaultDOTGraphTraits::getEdgeSourceLabel<llvm::TerminatorInst::SuccIterator<llvm::TerminatorInst const*, llvm::BasicBlock const> >(void const*, llvm::TerminatorInst::SuccIterator<llvm::TerminatorInst const*, llvm::BasicBlock const>)
Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > llvm::DefaultDOTGraphTraits::getEdgeSourceLabel<std::__1::__wrap_iter<llvm::MachineBasicBlock* const*> >(void const*, std::__1::__wrap_iter<llvm::MachineBasicBlock* const*>)
Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > llvm::DefaultDOTGraphTraits::getEdgeSourceLabel<llvm::GraphTraits<llvm::slpvectorizer::BoUpSLP*>::ChildIteratorType>(void const*, llvm::GraphTraits<llvm::slpvectorizer::BoUpSLP*>::ChildIteratorType)
110
111
  /// edgeTargetsEdgeSource - This method returns true if this outgoing edge
112
  /// should actually target another edge source, not a node.  If this method is
113
  /// implemented, getEdgeTarget should be implemented.
114
  template<typename EdgeIter>
115
2
  static bool edgeTargetsEdgeSource(const void *, EdgeIter) {
116
2
    return false;
117
2
  }
Unexecuted instantiation: bool llvm::DefaultDOTGraphTraits::edgeTargetsEdgeSource<llvm::GraphTraits<llvm::slpvectorizer::BoUpSLP*>::ChildIteratorType>(void const*, llvm::GraphTraits<llvm::slpvectorizer::BoUpSLP*>::ChildIteratorType)
Unexecuted instantiation: bool llvm::DefaultDOTGraphTraits::edgeTargetsEdgeSource<std::__1::__wrap_iter<llvm::MachineBasicBlock* const*> >(void const*, std::__1::__wrap_iter<llvm::MachineBasicBlock* const*>)
bool llvm::DefaultDOTGraphTraits::edgeTargetsEdgeSource<llvm::TerminatorInst::SuccIterator<llvm::TerminatorInst const*, llvm::BasicBlock const> >(void const*, llvm::TerminatorInst::SuccIterator<llvm::TerminatorInst const*, llvm::BasicBlock const>)
Line
Count
Source
115
2
  static bool edgeTargetsEdgeSource(const void *, EdgeIter) {
116
2
    return false;
117
2
  }
118
119
  /// getEdgeTarget - If edgeTargetsEdgeSource returns true, this method is
120
  /// called to determine which outgoing edge of Node is the target of this
121
  /// edge.
122
  template<typename EdgeIter>
123
0
  static EdgeIter getEdgeTarget(const void *, EdgeIter I) {
124
0
    return I;
125
0
  }
Unexecuted instantiation: llvm::TerminatorInst::SuccIterator<llvm::TerminatorInst const*, llvm::BasicBlock const> llvm::DefaultDOTGraphTraits::getEdgeTarget<llvm::TerminatorInst::SuccIterator<llvm::TerminatorInst const*, llvm::BasicBlock const> >(void const*, llvm::TerminatorInst::SuccIterator<llvm::TerminatorInst const*, llvm::BasicBlock const>)
Unexecuted instantiation: std::__1::__wrap_iter<llvm::MachineBasicBlock* const*> llvm::DefaultDOTGraphTraits::getEdgeTarget<std::__1::__wrap_iter<llvm::MachineBasicBlock* const*> >(void const*, std::__1::__wrap_iter<llvm::MachineBasicBlock* const*>)
Unexecuted instantiation: llvm::GraphTraits<llvm::slpvectorizer::BoUpSLP*>::ChildIteratorType llvm::DefaultDOTGraphTraits::getEdgeTarget<llvm::GraphTraits<llvm::slpvectorizer::BoUpSLP*>::ChildIteratorType>(void const*, llvm::GraphTraits<llvm::slpvectorizer::BoUpSLP*>::ChildIteratorType)
126
127
  /// hasEdgeDestLabels - If this function returns true, the graph is able
128
  /// to provide labels for edge destinations.
129
13
  static bool hasEdgeDestLabels() {
130
13
    return false;
131
13
  }
132
133
  /// numEdgeDestLabels - If hasEdgeDestLabels, this function returns the
134
  /// number of incoming edge labels the given node has.
135
0
  static unsigned numEdgeDestLabels(const void *) {
136
0
    return 0;
137
0
  }
138
139
  /// getEdgeDestLabel - If hasEdgeDestLabels, this function returns the
140
  /// incoming edge label with the given index in the given node.
141
0
  static std::string getEdgeDestLabel(const void *, unsigned) {
142
0
    return "";
143
0
  }
144
145
  /// addCustomGraphFeatures - If a graph is made up of more than just
146
  /// straight-forward nodes and edges, this is the place to put all of the
147
  /// custom stuff necessary.  The GraphWriter object, instantiated with your
148
  /// GraphType is passed in as an argument.  You may call arbitrary methods on
149
  /// it to add things to the output graph.
150
  ///
151
  template<typename GraphType, typename GraphWriter>
152
0
  static void addCustomGraphFeatures(const GraphType &, GraphWriter &) {}
Unexecuted instantiation: void llvm::DefaultDOTGraphTraits::addCustomGraphFeatures<llvm::BlockFrequencyInfo*, llvm::GraphWriter<llvm::BlockFrequencyInfo*> >(llvm::BlockFrequencyInfo* const&, llvm::GraphWriter<llvm::BlockFrequencyInfo*>&)
Unexecuted instantiation: void llvm::DefaultDOTGraphTraits::addCustomGraphFeatures<llvm::MachineBlockFrequencyInfo*, llvm::GraphWriter<llvm::MachineBlockFrequencyInfo*> >(llvm::MachineBlockFrequencyInfo* const&, llvm::GraphWriter<llvm::MachineBlockFrequencyInfo*>&)
Unexecuted instantiation: void llvm::DefaultDOTGraphTraits::addCustomGraphFeatures<llvm::slpvectorizer::BoUpSLP*, llvm::GraphWriter<llvm::slpvectorizer::BoUpSLP*> >(llvm::slpvectorizer::BoUpSLP* const&, llvm::GraphWriter<llvm::slpvectorizer::BoUpSLP*>&)
Unexecuted instantiation: PGOInstrumentation.cpp:void llvm::DefaultDOTGraphTraits::addCustomGraphFeatures<(anonymous namespace)::PGOUseFunc*, llvm::GraphWriter<(anonymous namespace)::PGOUseFunc*> >((anonymous namespace)::PGOUseFunc* const&, llvm::GraphWriter<(anonymous namespace)::PGOUseFunc*>&)
153
};
154
155
156
/// DOTGraphTraits - Template class that can be specialized to customize how
157
/// graphs are converted to 'dot' graphs.  When specializing, you may inherit
158
/// from DefaultDOTGraphTraits if you don't need to override everything.
159
///
160
template <typename Ty>
161
struct DOTGraphTraits : public DefaultDOTGraphTraits {
162
  DOTGraphTraits (bool simple=false) : DefaultDOTGraphTraits (simple) {}
163
};
164
165
} // End llvm namespace
166
167
#endif