Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
Line
Count
Source (jump to first uncovered line)
1
//===-- DOTGraphTraitsPass.h - Print/View dotty graphs-----------*- 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
// Templates to create dotty viewer and printer passes for GraphTraits graphs.
10
//
11
//===----------------------------------------------------------------------===//
12
13
#ifndef LLVM_ANALYSIS_DOTGRAPHTRAITSPASS_H
14
#define LLVM_ANALYSIS_DOTGRAPHTRAITSPASS_H
15
16
#include "llvm/Analysis/CFGPrinter.h"
17
#include "llvm/Pass.h"
18
#include "llvm/Support/FileSystem.h"
19
20
namespace llvm {
21
22
/// Default traits class for extracting a graph from an analysis pass.
23
///
24
/// This assumes that 'GraphT' is 'AnalysisT *' and so just passes it through.
25
template <typename AnalysisT, typename GraphT = AnalysisT *>
26
struct DefaultAnalysisGraphTraits {
27
1
  static GraphT getGraph(AnalysisT *A) { return A; }
28
};
29
30
template <
31
    typename AnalysisT, bool IsSimple, typename GraphT = AnalysisT *,
32
    typename AnalysisGraphTraitsT = DefaultAnalysisGraphTraits<AnalysisT, GraphT> >
33
class DOTGraphTraitsViewer : public FunctionPass {
34
public:
35
  DOTGraphTraitsViewer(StringRef GraphName, char &ID)
36
0
      : FunctionPass(ID), Name(GraphName) {}
Unexecuted instantiation: DomPrinter.cpp:llvm::DOTGraphTraitsViewer<llvm::DominatorTreeWrapperPass, false, llvm::DominatorTree*, (anonymous namespace)::DominatorTreeWrapperPassAnalysisGraphTraits>::DOTGraphTraitsViewer(llvm::StringRef, char&)
Unexecuted instantiation: DomPrinter.cpp:llvm::DOTGraphTraitsViewer<llvm::DominatorTreeWrapperPass, true, llvm::DominatorTree*, (anonymous namespace)::DominatorTreeWrapperPassAnalysisGraphTraits>::DOTGraphTraitsViewer(llvm::StringRef, char&)
Unexecuted instantiation: DomPrinter.cpp:llvm::DOTGraphTraitsViewer<llvm::PostDominatorTreeWrapperPass, false, llvm::PostDominatorTree*, (anonymous namespace)::PostDominatorTreeWrapperPassAnalysisGraphTraits>::DOTGraphTraitsViewer(llvm::StringRef, char&)
Unexecuted instantiation: DomPrinter.cpp:llvm::DOTGraphTraitsViewer<llvm::PostDominatorTreeWrapperPass, true, llvm::PostDominatorTree*, (anonymous namespace)::PostDominatorTreeWrapperPassAnalysisGraphTraits>::DOTGraphTraitsViewer(llvm::StringRef, char&)
Unexecuted instantiation: RegionPrinter.cpp:llvm::DOTGraphTraitsViewer<llvm::RegionInfoPass, false, llvm::RegionInfo*, (anonymous namespace)::RegionInfoPassGraphTraits>::DOTGraphTraitsViewer(llvm::StringRef, char&)
Unexecuted instantiation: RegionPrinter.cpp:llvm::DOTGraphTraitsViewer<llvm::RegionInfoPass, true, llvm::RegionInfo*, (anonymous namespace)::RegionInfoPassGraphTraits>::DOTGraphTraitsViewer(llvm::StringRef, char&)
Unexecuted instantiation: llvm::DOTGraphTraitsViewer<polly::ScopDetectionWrapperPass, false, polly::ScopDetectionWrapperPass*, llvm::DefaultAnalysisGraphTraits<polly::ScopDetectionWrapperPass, polly::ScopDetectionWrapperPass*> >::DOTGraphTraitsViewer(llvm::StringRef, char&)
Unexecuted instantiation: llvm::DOTGraphTraitsViewer<polly::ScopDetectionWrapperPass, true, polly::ScopDetectionWrapperPass*, llvm::DefaultAnalysisGraphTraits<polly::ScopDetectionWrapperPass, polly::ScopDetectionWrapperPass*> >::DOTGraphTraitsViewer(llvm::StringRef, char&)
37
38
  /// Return true if this function should be processed.
39
  ///
40
  /// An implementation of this class my override this function to indicate that
41
  /// only certain functions should be viewed.
42
  ///
43
  /// @param Analysis The current analysis result for this function.
44
0
  virtual bool processFunction(Function &F, AnalysisT &Analysis) {
45
0
    return true;
46
0
  }
Unexecuted instantiation: DomPrinter.cpp:llvm::DOTGraphTraitsViewer<llvm::DominatorTreeWrapperPass, false, llvm::DominatorTree*, (anonymous namespace)::DominatorTreeWrapperPassAnalysisGraphTraits>::processFunction(llvm::Function&, llvm::DominatorTreeWrapperPass&)
Unexecuted instantiation: DomPrinter.cpp:llvm::DOTGraphTraitsViewer<llvm::DominatorTreeWrapperPass, true, llvm::DominatorTree*, (anonymous namespace)::DominatorTreeWrapperPassAnalysisGraphTraits>::processFunction(llvm::Function&, llvm::DominatorTreeWrapperPass&)
Unexecuted instantiation: DomPrinter.cpp:llvm::DOTGraphTraitsViewer<llvm::PostDominatorTreeWrapperPass, false, llvm::PostDominatorTree*, (anonymous namespace)::PostDominatorTreeWrapperPassAnalysisGraphTraits>::processFunction(llvm::Function&, llvm::PostDominatorTreeWrapperPass&)
Unexecuted instantiation: DomPrinter.cpp:llvm::DOTGraphTraitsViewer<llvm::PostDominatorTreeWrapperPass, true, llvm::PostDominatorTree*, (anonymous namespace)::PostDominatorTreeWrapperPassAnalysisGraphTraits>::processFunction(llvm::Function&, llvm::PostDominatorTreeWrapperPass&)
Unexecuted instantiation: RegionPrinter.cpp:llvm::DOTGraphTraitsViewer<llvm::RegionInfoPass, false, llvm::RegionInfo*, (anonymous namespace)::RegionInfoPassGraphTraits>::processFunction(llvm::Function&, llvm::RegionInfoPass&)
Unexecuted instantiation: RegionPrinter.cpp:llvm::DOTGraphTraitsViewer<llvm::RegionInfoPass, true, llvm::RegionInfo*, (anonymous namespace)::RegionInfoPassGraphTraits>::processFunction(llvm::Function&, llvm::RegionInfoPass&)
Unexecuted instantiation: llvm::DOTGraphTraitsViewer<polly::ScopDetectionWrapperPass, false, polly::ScopDetectionWrapperPass*, llvm::DefaultAnalysisGraphTraits<polly::ScopDetectionWrapperPass, polly::ScopDetectionWrapperPass*> >::processFunction(llvm::Function&, polly::ScopDetectionWrapperPass&)
Unexecuted instantiation: llvm::DOTGraphTraitsViewer<polly::ScopDetectionWrapperPass, true, polly::ScopDetectionWrapperPass*, llvm::DefaultAnalysisGraphTraits<polly::ScopDetectionWrapperPass, polly::ScopDetectionWrapperPass*> >::processFunction(llvm::Function&, polly::ScopDetectionWrapperPass&)
47
48
0
  bool runOnFunction(Function &F) override {
49
0
    auto &Analysis = getAnalysis<AnalysisT>();
50
0
51
0
    if (!processFunction(F, Analysis))
52
0
      return false;
53
0
54
0
    GraphT Graph = AnalysisGraphTraitsT::getGraph(&Analysis);
55
0
    std::string GraphName = DOTGraphTraits<GraphT>::getGraphName(Graph);
56
0
    std::string Title = GraphName + " for '" + F.getName().str() + "' function";
57
0
58
0
    ViewGraph(Graph, Name, IsSimple, Title);
59
0
60
0
    return false;
61
0
  }
Unexecuted instantiation: DomPrinter.cpp:llvm::DOTGraphTraitsViewer<llvm::DominatorTreeWrapperPass, false, llvm::DominatorTree*, (anonymous namespace)::DominatorTreeWrapperPassAnalysisGraphTraits>::runOnFunction(llvm::Function&)
Unexecuted instantiation: DomPrinter.cpp:llvm::DOTGraphTraitsViewer<llvm::DominatorTreeWrapperPass, true, llvm::DominatorTree*, (anonymous namespace)::DominatorTreeWrapperPassAnalysisGraphTraits>::runOnFunction(llvm::Function&)
Unexecuted instantiation: DomPrinter.cpp:llvm::DOTGraphTraitsViewer<llvm::PostDominatorTreeWrapperPass, false, llvm::PostDominatorTree*, (anonymous namespace)::PostDominatorTreeWrapperPassAnalysisGraphTraits>::runOnFunction(llvm::Function&)
Unexecuted instantiation: DomPrinter.cpp:llvm::DOTGraphTraitsViewer<llvm::PostDominatorTreeWrapperPass, true, llvm::PostDominatorTree*, (anonymous namespace)::PostDominatorTreeWrapperPassAnalysisGraphTraits>::runOnFunction(llvm::Function&)
Unexecuted instantiation: RegionPrinter.cpp:llvm::DOTGraphTraitsViewer<llvm::RegionInfoPass, false, llvm::RegionInfo*, (anonymous namespace)::RegionInfoPassGraphTraits>::runOnFunction(llvm::Function&)
Unexecuted instantiation: RegionPrinter.cpp:llvm::DOTGraphTraitsViewer<llvm::RegionInfoPass, true, llvm::RegionInfo*, (anonymous namespace)::RegionInfoPassGraphTraits>::runOnFunction(llvm::Function&)
Unexecuted instantiation: llvm::DOTGraphTraitsViewer<polly::ScopDetectionWrapperPass, false, polly::ScopDetectionWrapperPass*, llvm::DefaultAnalysisGraphTraits<polly::ScopDetectionWrapperPass, polly::ScopDetectionWrapperPass*> >::runOnFunction(llvm::Function&)
Unexecuted instantiation: llvm::DOTGraphTraitsViewer<polly::ScopDetectionWrapperPass, true, polly::ScopDetectionWrapperPass*, llvm::DefaultAnalysisGraphTraits<polly::ScopDetectionWrapperPass, polly::ScopDetectionWrapperPass*> >::runOnFunction(llvm::Function&)
62
63
0
  void getAnalysisUsage(AnalysisUsage &AU) const override {
64
0
    AU.setPreservesAll();
65
0
    AU.addRequired<AnalysisT>();
66
0
  }
Unexecuted instantiation: DomPrinter.cpp:llvm::DOTGraphTraitsViewer<llvm::DominatorTreeWrapperPass, false, llvm::DominatorTree*, (anonymous namespace)::DominatorTreeWrapperPassAnalysisGraphTraits>::getAnalysisUsage(llvm::AnalysisUsage&) const
Unexecuted instantiation: DomPrinter.cpp:llvm::DOTGraphTraitsViewer<llvm::DominatorTreeWrapperPass, true, llvm::DominatorTree*, (anonymous namespace)::DominatorTreeWrapperPassAnalysisGraphTraits>::getAnalysisUsage(llvm::AnalysisUsage&) const
Unexecuted instantiation: DomPrinter.cpp:llvm::DOTGraphTraitsViewer<llvm::PostDominatorTreeWrapperPass, false, llvm::PostDominatorTree*, (anonymous namespace)::PostDominatorTreeWrapperPassAnalysisGraphTraits>::getAnalysisUsage(llvm::AnalysisUsage&) const
Unexecuted instantiation: DomPrinter.cpp:llvm::DOTGraphTraitsViewer<llvm::PostDominatorTreeWrapperPass, true, llvm::PostDominatorTree*, (anonymous namespace)::PostDominatorTreeWrapperPassAnalysisGraphTraits>::getAnalysisUsage(llvm::AnalysisUsage&) const
Unexecuted instantiation: RegionPrinter.cpp:llvm::DOTGraphTraitsViewer<llvm::RegionInfoPass, false, llvm::RegionInfo*, (anonymous namespace)::RegionInfoPassGraphTraits>::getAnalysisUsage(llvm::AnalysisUsage&) const
Unexecuted instantiation: RegionPrinter.cpp:llvm::DOTGraphTraitsViewer<llvm::RegionInfoPass, true, llvm::RegionInfo*, (anonymous namespace)::RegionInfoPassGraphTraits>::getAnalysisUsage(llvm::AnalysisUsage&) const
Unexecuted instantiation: llvm::DOTGraphTraitsViewer<polly::ScopDetectionWrapperPass, false, polly::ScopDetectionWrapperPass*, llvm::DefaultAnalysisGraphTraits<polly::ScopDetectionWrapperPass, polly::ScopDetectionWrapperPass*> >::getAnalysisUsage(llvm::AnalysisUsage&) const
Unexecuted instantiation: llvm::DOTGraphTraitsViewer<polly::ScopDetectionWrapperPass, true, polly::ScopDetectionWrapperPass*, llvm::DefaultAnalysisGraphTraits<polly::ScopDetectionWrapperPass, polly::ScopDetectionWrapperPass*> >::getAnalysisUsage(llvm::AnalysisUsage&) const
67
68
private:
69
  std::string Name;
70
};
71
72
template <
73
    typename AnalysisT, bool IsSimple, typename GraphT = AnalysisT *,
74
    typename AnalysisGraphTraitsT = DefaultAnalysisGraphTraits<AnalysisT, GraphT> >
75
class DOTGraphTraitsPrinter : public FunctionPass {
76
public:
77
  DOTGraphTraitsPrinter(StringRef GraphName, char &ID)
78
1
      : FunctionPass(ID), Name(GraphName) {}
Unexecuted instantiation: DomPrinter.cpp:llvm::DOTGraphTraitsPrinter<llvm::DominatorTreeWrapperPass, false, llvm::DominatorTree*, (anonymous namespace)::DominatorTreeWrapperPassAnalysisGraphTraits>::DOTGraphTraitsPrinter(llvm::StringRef, char&)
Unexecuted instantiation: DomPrinter.cpp:llvm::DOTGraphTraitsPrinter<llvm::DominatorTreeWrapperPass, true, llvm::DominatorTree*, (anonymous namespace)::DominatorTreeWrapperPassAnalysisGraphTraits>::DOTGraphTraitsPrinter(llvm::StringRef, char&)
Unexecuted instantiation: DomPrinter.cpp:llvm::DOTGraphTraitsPrinter<llvm::PostDominatorTreeWrapperPass, false, llvm::PostDominatorTree*, (anonymous namespace)::PostDominatorTreeWrapperPassAnalysisGraphTraits>::DOTGraphTraitsPrinter(llvm::StringRef, char&)
Unexecuted instantiation: DomPrinter.cpp:llvm::DOTGraphTraitsPrinter<llvm::PostDominatorTreeWrapperPass, true, llvm::PostDominatorTree*, (anonymous namespace)::PostDominatorTreeWrapperPassAnalysisGraphTraits>::DOTGraphTraitsPrinter(llvm::StringRef, char&)
Unexecuted instantiation: RegionPrinter.cpp:llvm::DOTGraphTraitsPrinter<llvm::RegionInfoPass, false, llvm::RegionInfo*, (anonymous namespace)::RegionInfoPassGraphTraits>::DOTGraphTraitsPrinter(llvm::StringRef, char&)
Unexecuted instantiation: RegionPrinter.cpp:llvm::DOTGraphTraitsPrinter<llvm::RegionInfoPass, true, llvm::RegionInfo*, (anonymous namespace)::RegionInfoPassGraphTraits>::DOTGraphTraitsPrinter(llvm::StringRef, char&)
llvm::DOTGraphTraitsPrinter<polly::ScopDetectionWrapperPass, false, polly::ScopDetectionWrapperPass*, llvm::DefaultAnalysisGraphTraits<polly::ScopDetectionWrapperPass, polly::ScopDetectionWrapperPass*> >::DOTGraphTraitsPrinter(llvm::StringRef, char&)
Line
Count
Source
78
1
      : FunctionPass(ID), Name(GraphName) {}
Unexecuted instantiation: llvm::DOTGraphTraitsPrinter<polly::ScopDetectionWrapperPass, true, polly::ScopDetectionWrapperPass*, llvm::DefaultAnalysisGraphTraits<polly::ScopDetectionWrapperPass, polly::ScopDetectionWrapperPass*> >::DOTGraphTraitsPrinter(llvm::StringRef, char&)
79
80
  /// Return true if this function should be processed.
81
  ///
82
  /// An implementation of this class my override this function to indicate that
83
  /// only certain functions should be printed.
84
  ///
85
  /// @param Analysis The current analysis result for this function.
86
1
  virtual bool processFunction(Function &F, AnalysisT &Analysis) {
87
1
    return true;
88
1
  }
Unexecuted instantiation: DomPrinter.cpp:llvm::DOTGraphTraitsPrinter<llvm::DominatorTreeWrapperPass, false, llvm::DominatorTree*, (anonymous namespace)::DominatorTreeWrapperPassAnalysisGraphTraits>::processFunction(llvm::Function&, llvm::DominatorTreeWrapperPass&)
Unexecuted instantiation: DomPrinter.cpp:llvm::DOTGraphTraitsPrinter<llvm::DominatorTreeWrapperPass, true, llvm::DominatorTree*, (anonymous namespace)::DominatorTreeWrapperPassAnalysisGraphTraits>::processFunction(llvm::Function&, llvm::DominatorTreeWrapperPass&)
Unexecuted instantiation: DomPrinter.cpp:llvm::DOTGraphTraitsPrinter<llvm::PostDominatorTreeWrapperPass, false, llvm::PostDominatorTree*, (anonymous namespace)::PostDominatorTreeWrapperPassAnalysisGraphTraits>::processFunction(llvm::Function&, llvm::PostDominatorTreeWrapperPass&)
Unexecuted instantiation: DomPrinter.cpp:llvm::DOTGraphTraitsPrinter<llvm::PostDominatorTreeWrapperPass, true, llvm::PostDominatorTree*, (anonymous namespace)::PostDominatorTreeWrapperPassAnalysisGraphTraits>::processFunction(llvm::Function&, llvm::PostDominatorTreeWrapperPass&)
Unexecuted instantiation: RegionPrinter.cpp:llvm::DOTGraphTraitsPrinter<llvm::RegionInfoPass, false, llvm::RegionInfo*, (anonymous namespace)::RegionInfoPassGraphTraits>::processFunction(llvm::Function&, llvm::RegionInfoPass&)
Unexecuted instantiation: RegionPrinter.cpp:llvm::DOTGraphTraitsPrinter<llvm::RegionInfoPass, true, llvm::RegionInfo*, (anonymous namespace)::RegionInfoPassGraphTraits>::processFunction(llvm::Function&, llvm::RegionInfoPass&)
llvm::DOTGraphTraitsPrinter<polly::ScopDetectionWrapperPass, false, polly::ScopDetectionWrapperPass*, llvm::DefaultAnalysisGraphTraits<polly::ScopDetectionWrapperPass, polly::ScopDetectionWrapperPass*> >::processFunction(llvm::Function&, polly::ScopDetectionWrapperPass&)
Line
Count
Source
86
1
  virtual bool processFunction(Function &F, AnalysisT &Analysis) {
87
1
    return true;
88
1
  }
Unexecuted instantiation: llvm::DOTGraphTraitsPrinter<polly::ScopDetectionWrapperPass, true, polly::ScopDetectionWrapperPass*, llvm::DefaultAnalysisGraphTraits<polly::ScopDetectionWrapperPass, polly::ScopDetectionWrapperPass*> >::processFunction(llvm::Function&, polly::ScopDetectionWrapperPass&)
89
90
1
  bool runOnFunction(Function &F) override {
91
1
    auto &Analysis = getAnalysis<AnalysisT>();
92
1
93
1
    if (!processFunction(F, Analysis))
94
0
      return false;
95
1
96
1
    GraphT Graph = AnalysisGraphTraitsT::getGraph(&Analysis);
97
1
    std::string Filename = Name + "." + F.getName().str() + ".dot";
98
1
    std::error_code EC;
99
1
100
1
    errs() << "Writing '" << Filename << "'...";
101
1
102
1
    raw_fd_ostream File(Filename, EC, sys::fs::F_Text);
103
1
    std::string GraphName = DOTGraphTraits<GraphT>::getGraphName(Graph);
104
1
    std::string Title = GraphName + " for '" + F.getName().str() + "' function";
105
1
106
1
    if (!EC)
107
1
      WriteGraph(File, Graph, IsSimple, Title);
108
0
    else
109
0
      errs() << "  error opening file for writing!";
110
1
    errs() << "\n";
111
1
112
1
    return false;
113
1
  }
Unexecuted instantiation: DomPrinter.cpp:llvm::DOTGraphTraitsPrinter<llvm::DominatorTreeWrapperPass, false, llvm::DominatorTree*, (anonymous namespace)::DominatorTreeWrapperPassAnalysisGraphTraits>::runOnFunction(llvm::Function&)
Unexecuted instantiation: DomPrinter.cpp:llvm::DOTGraphTraitsPrinter<llvm::DominatorTreeWrapperPass, true, llvm::DominatorTree*, (anonymous namespace)::DominatorTreeWrapperPassAnalysisGraphTraits>::runOnFunction(llvm::Function&)
Unexecuted instantiation: DomPrinter.cpp:llvm::DOTGraphTraitsPrinter<llvm::PostDominatorTreeWrapperPass, false, llvm::PostDominatorTree*, (anonymous namespace)::PostDominatorTreeWrapperPassAnalysisGraphTraits>::runOnFunction(llvm::Function&)
Unexecuted instantiation: DomPrinter.cpp:llvm::DOTGraphTraitsPrinter<llvm::PostDominatorTreeWrapperPass, true, llvm::PostDominatorTree*, (anonymous namespace)::PostDominatorTreeWrapperPassAnalysisGraphTraits>::runOnFunction(llvm::Function&)
Unexecuted instantiation: RegionPrinter.cpp:llvm::DOTGraphTraitsPrinter<llvm::RegionInfoPass, false, llvm::RegionInfo*, (anonymous namespace)::RegionInfoPassGraphTraits>::runOnFunction(llvm::Function&)
Unexecuted instantiation: RegionPrinter.cpp:llvm::DOTGraphTraitsPrinter<llvm::RegionInfoPass, true, llvm::RegionInfo*, (anonymous namespace)::RegionInfoPassGraphTraits>::runOnFunction(llvm::Function&)
llvm::DOTGraphTraitsPrinter<polly::ScopDetectionWrapperPass, false, polly::ScopDetectionWrapperPass*, llvm::DefaultAnalysisGraphTraits<polly::ScopDetectionWrapperPass, polly::ScopDetectionWrapperPass*> >::runOnFunction(llvm::Function&)
Line
Count
Source
90
1
  bool runOnFunction(Function &F) override {
91
1
    auto &Analysis = getAnalysis<AnalysisT>();
92
1
93
1
    if (!processFunction(F, Analysis))
94
0
      return false;
95
1
96
1
    GraphT Graph = AnalysisGraphTraitsT::getGraph(&Analysis);
97
1
    std::string Filename = Name + "." + F.getName().str() + ".dot";
98
1
    std::error_code EC;
99
1
100
1
    errs() << "Writing '" << Filename << "'...";
101
1
102
1
    raw_fd_ostream File(Filename, EC, sys::fs::F_Text);
103
1
    std::string GraphName = DOTGraphTraits<GraphT>::getGraphName(Graph);
104
1
    std::string Title = GraphName + " for '" + F.getName().str() + "' function";
105
1
106
1
    if (!EC)
107
1
      WriteGraph(File, Graph, IsSimple, Title);
108
0
    else
109
0
      errs() << "  error opening file for writing!";
110
1
    errs() << "\n";
111
1
112
1
    return false;
113
1
  }
Unexecuted instantiation: llvm::DOTGraphTraitsPrinter<polly::ScopDetectionWrapperPass, true, polly::ScopDetectionWrapperPass*, llvm::DefaultAnalysisGraphTraits<polly::ScopDetectionWrapperPass, polly::ScopDetectionWrapperPass*> >::runOnFunction(llvm::Function&)
114
115
1
  void getAnalysisUsage(AnalysisUsage &AU) const override {
116
1
    AU.setPreservesAll();
117
1
    AU.addRequired<AnalysisT>();
118
1
  }
Unexecuted instantiation: DomPrinter.cpp:llvm::DOTGraphTraitsPrinter<llvm::DominatorTreeWrapperPass, false, llvm::DominatorTree*, (anonymous namespace)::DominatorTreeWrapperPassAnalysisGraphTraits>::getAnalysisUsage(llvm::AnalysisUsage&) const
Unexecuted instantiation: DomPrinter.cpp:llvm::DOTGraphTraitsPrinter<llvm::DominatorTreeWrapperPass, true, llvm::DominatorTree*, (anonymous namespace)::DominatorTreeWrapperPassAnalysisGraphTraits>::getAnalysisUsage(llvm::AnalysisUsage&) const
Unexecuted instantiation: DomPrinter.cpp:llvm::DOTGraphTraitsPrinter<llvm::PostDominatorTreeWrapperPass, false, llvm::PostDominatorTree*, (anonymous namespace)::PostDominatorTreeWrapperPassAnalysisGraphTraits>::getAnalysisUsage(llvm::AnalysisUsage&) const
Unexecuted instantiation: DomPrinter.cpp:llvm::DOTGraphTraitsPrinter<llvm::PostDominatorTreeWrapperPass, true, llvm::PostDominatorTree*, (anonymous namespace)::PostDominatorTreeWrapperPassAnalysisGraphTraits>::getAnalysisUsage(llvm::AnalysisUsage&) const
Unexecuted instantiation: RegionPrinter.cpp:llvm::DOTGraphTraitsPrinter<llvm::RegionInfoPass, false, llvm::RegionInfo*, (anonymous namespace)::RegionInfoPassGraphTraits>::getAnalysisUsage(llvm::AnalysisUsage&) const
Unexecuted instantiation: RegionPrinter.cpp:llvm::DOTGraphTraitsPrinter<llvm::RegionInfoPass, true, llvm::RegionInfo*, (anonymous namespace)::RegionInfoPassGraphTraits>::getAnalysisUsage(llvm::AnalysisUsage&) const
llvm::DOTGraphTraitsPrinter<polly::ScopDetectionWrapperPass, false, polly::ScopDetectionWrapperPass*, llvm::DefaultAnalysisGraphTraits<polly::ScopDetectionWrapperPass, polly::ScopDetectionWrapperPass*> >::getAnalysisUsage(llvm::AnalysisUsage&) const
Line
Count
Source
115
1
  void getAnalysisUsage(AnalysisUsage &AU) const override {
116
1
    AU.setPreservesAll();
117
1
    AU.addRequired<AnalysisT>();
118
1
  }
Unexecuted instantiation: llvm::DOTGraphTraitsPrinter<polly::ScopDetectionWrapperPass, true, polly::ScopDetectionWrapperPass*, llvm::DefaultAnalysisGraphTraits<polly::ScopDetectionWrapperPass, polly::ScopDetectionWrapperPass*> >::getAnalysisUsage(llvm::AnalysisUsage&) const
119
120
private:
121
  std::string Name;
122
};
123
124
template <
125
    typename AnalysisT, bool IsSimple, typename GraphT = AnalysisT *,
126
    typename AnalysisGraphTraitsT = DefaultAnalysisGraphTraits<AnalysisT, GraphT> >
127
class DOTGraphTraitsModuleViewer : public ModulePass {
128
public:
129
  DOTGraphTraitsModuleViewer(StringRef GraphName, char &ID)
130
0
      : ModulePass(ID), Name(GraphName) {}
131
132
0
  bool runOnModule(Module &M) override {
133
0
    GraphT Graph = AnalysisGraphTraitsT::getGraph(&getAnalysis<AnalysisT>());
134
0
    std::string Title = DOTGraphTraits<GraphT>::getGraphName(Graph);
135
0
136
0
    ViewGraph(Graph, Name, IsSimple, Title);
137
0
138
0
    return false;
139
0
  }
140
141
0
  void getAnalysisUsage(AnalysisUsage &AU) const override {
142
0
    AU.setPreservesAll();
143
0
    AU.addRequired<AnalysisT>();
144
0
  }
145
146
private:
147
  std::string Name;
148
};
149
150
template <
151
    typename AnalysisT, bool IsSimple, typename GraphT = AnalysisT *,
152
    typename AnalysisGraphTraitsT = DefaultAnalysisGraphTraits<AnalysisT, GraphT> >
153
class DOTGraphTraitsModulePrinter : public ModulePass {
154
public:
155
  DOTGraphTraitsModulePrinter(StringRef GraphName, char &ID)
156
0
      : ModulePass(ID), Name(GraphName) {}
157
158
0
  bool runOnModule(Module &M) override {
159
0
    GraphT Graph = AnalysisGraphTraitsT::getGraph(&getAnalysis<AnalysisT>());
160
0
    std::string Filename = Name + ".dot";
161
0
    std::error_code EC;
162
0
163
0
    errs() << "Writing '" << Filename << "'...";
164
0
165
0
    raw_fd_ostream File(Filename, EC, sys::fs::F_Text);
166
0
    std::string Title = DOTGraphTraits<GraphT>::getGraphName(Graph);
167
0
168
0
    if (!EC)
169
0
      WriteGraph(File, Graph, IsSimple, Title);
170
0
    else
171
0
      errs() << "  error opening file for writing!";
172
0
    errs() << "\n";
173
0
174
0
    return false;
175
0
  }
176
177
0
  void getAnalysisUsage(AnalysisUsage &AU) const override {
178
0
    AU.setPreservesAll();
179
0
    AU.addRequired<AnalysisT>();
180
0
  }
181
182
private:
183
  std::string Name;
184
};
185
186
} // end namespace llvm
187
188
#endif