Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/include/llvm/CodeGen/MachinePostDominators.h
Line
Count
Source (jump to first uncovered line)
1
//===- llvm/CodeGen/MachinePostDominators.h ----------------------*- 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 exposes interfaces to post dominance information for
10
// target-specific code.
11
//
12
//===----------------------------------------------------------------------===//
13
14
#ifndef LLVM_CODEGEN_MACHINEPOSTDOMINATORS_H
15
#define LLVM_CODEGEN_MACHINEPOSTDOMINATORS_H
16
17
#include "llvm/CodeGen/MachineDominators.h"
18
#include "llvm/CodeGen/MachineFunctionPass.h"
19
20
namespace llvm {
21
22
///
23
/// PostDominatorTree Class - Concrete subclass of DominatorTree that is used
24
/// to compute the post-dominator tree.
25
///
26
struct MachinePostDominatorTree : public MachineFunctionPass {
27
private:
28
 PostDomTreeBase<MachineBasicBlock> *DT;
29
30
public:
31
  static char ID;
32
33
  MachinePostDominatorTree();
34
35
  ~MachinePostDominatorTree() override;
36
37
  FunctionPass *createMachinePostDominatorTreePass();
38
39
0
  const SmallVectorImpl<MachineBasicBlock *> &getRoots() const {
40
0
    return DT->getRoots();
41
0
  }
42
43
0
  MachineDomTreeNode *getRootNode() const {
44
0
    return DT->getRootNode();
45
0
  }
46
47
0
  MachineDomTreeNode *operator[](MachineBasicBlock *BB) const {
48
0
    return DT->getNode(BB);
49
0
  }
50
51
55.4k
  MachineDomTreeNode *getNode(MachineBasicBlock *BB) const {
52
55.4k
    return DT->getNode(BB);
53
55.4k
  }
54
55
  bool dominates(const MachineDomTreeNode *A,
56
0
                 const MachineDomTreeNode *B) const {
57
0
    return DT->dominates(A, B);
58
0
  }
59
60
7.09M
  bool dominates(const MachineBasicBlock *A, const MachineBasicBlock *B) const {
61
7.09M
    return DT->dominates(A, B);
62
7.09M
  }
63
64
  bool properlyDominates(const MachineDomTreeNode *A,
65
0
                         const MachineDomTreeNode *B) const {
66
0
    return DT->properlyDominates(A, B);
67
0
  }
68
69
  bool properlyDominates(const MachineBasicBlock *A,
70
0
                         const MachineBasicBlock *B) const {
71
0
    return DT->properlyDominates(A, B);
72
0
  }
73
74
  MachineBasicBlock *findNearestCommonDominator(MachineBasicBlock *A,
75
123k
                                                MachineBasicBlock *B) {
76
123k
    return DT->findNearestCommonDominator(A, B);
77
123k
  }
78
79
  bool runOnMachineFunction(MachineFunction &MF) override;
80
  void getAnalysisUsage(AnalysisUsage &AU) const override;
81
  void print(llvm::raw_ostream &OS, const Module *M = nullptr) const override;
82
};
83
} //end of namespace llvm
84
85
#endif