Coverage Report

Created: 2020-06-26 05:44

/home/arjun/llvm-project/build/tools/mlir/include/mlir/Interfaces/ControlFlowInterfaces.h.inc
Line
Count
Source (jump to first uncovered line)
1
/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2
|*                                                                            *|
3
|* Operation Interface Declarations                                           *|
4
|*                                                                            *|
5
|* Automatically generated file, do not edit!                                 *|
6
|*                                                                            *|
7
\*===----------------------------------------------------------------------===*/
8
9
namespace detail {
10
struct BranchOpInterfaceInterfaceTraits {
11
  class Concept {
12
  public:
13
0
    virtual ~Concept() = default;
14
    virtual Optional<MutableOperandRange> getMutableSuccessorOperands(Operation *tablegen_opaque_op, unsigned index) = 0;
15
    virtual Optional<OperandRange> getSuccessorOperands(Operation *tablegen_opaque_op, unsigned index) = 0;
16
    virtual Optional<BlockArgument> getSuccessorBlockArgument(Operation *tablegen_opaque_op, unsigned operandIndex) = 0;
17
    virtual Block * getSuccessorForOperands(Operation *tablegen_opaque_op, ArrayRef<Attribute> operands) = 0;
18
  };
19
  template<typename ConcreteOp>
20
  class Model : public Concept {
21
public:
22
0
    Optional<MutableOperandRange> getMutableSuccessorOperands(Operation *tablegen_opaque_op, unsigned index) final {
23
0
      auto op = llvm::cast<ConcreteOp>(tablegen_opaque_op);
24
0
      (void)op;
25
0
      return op.getMutableSuccessorOperands(index);
26
0
    }
Unexecuted instantiation: _ZN4mlir6detail32BranchOpInterfaceInterfaceTraits5ModelINS_8BranchOpEE27getMutableSuccessorOperandsEPNS_9OperationEj
Unexecuted instantiation: _ZN4mlir6detail32BranchOpInterfaceInterfaceTraits5ModelINS_12CondBranchOpEE27getMutableSuccessorOperandsEPNS_9OperationEj
27
0
    Optional<OperandRange> getSuccessorOperands(Operation *tablegen_opaque_op, unsigned index) final {
28
0
      auto op = llvm::cast<ConcreteOp>(tablegen_opaque_op);
29
0
      (void)op;
30
0
      return op.getSuccessorOperands(index);
31
0
    }
Unexecuted instantiation: _ZN4mlir6detail32BranchOpInterfaceInterfaceTraits5ModelINS_8BranchOpEE20getSuccessorOperandsEPNS_9OperationEj
Unexecuted instantiation: _ZN4mlir6detail32BranchOpInterfaceInterfaceTraits5ModelINS_12CondBranchOpEE20getSuccessorOperandsEPNS_9OperationEj
32
0
    Optional<BlockArgument> getSuccessorBlockArgument(Operation *tablegen_opaque_op, unsigned operandIndex) final {
33
0
      auto op = llvm::cast<ConcreteOp>(tablegen_opaque_op);
34
0
      (void)op;
35
0
36
0
        Operation *opaqueOp = op;
37
0
        for (unsigned i = 0, e = opaqueOp->getNumSuccessors(); i != e; ++i) {
38
0
          if (Optional<BlockArgument> arg = detail::getBranchSuccessorArgument(
39
0
                op.getSuccessorOperands(i), operandIndex,
40
0
                opaqueOp->getSuccessor(i)))
41
0
            return arg;
42
0
        }
43
0
        return llvm::None;
44
0
      
45
0
    }
Unexecuted instantiation: _ZN4mlir6detail32BranchOpInterfaceInterfaceTraits5ModelINS_8BranchOpEE25getSuccessorBlockArgumentEPNS_9OperationEj
Unexecuted instantiation: _ZN4mlir6detail32BranchOpInterfaceInterfaceTraits5ModelINS_12CondBranchOpEE25getSuccessorBlockArgumentEPNS_9OperationEj
46
0
    Block * getSuccessorForOperands(Operation *tablegen_opaque_op, ArrayRef<Attribute> operands) final {
47
0
      auto op = llvm::cast<ConcreteOp>(tablegen_opaque_op);
48
0
      (void)op;
49
0
      return op.getSuccessorForOperands(operands);
50
0
    }
Unexecuted instantiation: _ZN4mlir6detail32BranchOpInterfaceInterfaceTraits5ModelINS_8BranchOpEE23getSuccessorForOperandsEPNS_9OperationEN4llvm8ArrayRefINS_9AttributeEEE
Unexecuted instantiation: _ZN4mlir6detail32BranchOpInterfaceInterfaceTraits5ModelINS_12CondBranchOpEE23getSuccessorForOperandsEPNS_9OperationEN4llvm8ArrayRefINS_9AttributeEEE
51
  };
52
};
53
} // end namespace detail
54
class BranchOpInterface : public OpInterface<BranchOpInterface, detail::BranchOpInterfaceInterfaceTraits> {
55
public:
56
  using OpInterface<BranchOpInterface, detail::BranchOpInterfaceInterfaceTraits>::OpInterface;
57
  template <typename ConcreteOp>
58
  struct BranchOpInterfaceTrait : public OpInterface<BranchOpInterface, detail::BranchOpInterfaceInterfaceTraits>::Trait<ConcreteOp> {
59
0
  Optional<OperandRange> getSuccessorOperands(unsigned index) {
60
0
61
0
        ConcreteOp *op = static_cast<ConcreteOp *>(this);
62
0
        auto operands = op->getMutableSuccessorOperands(index);
63
0
        return operands ? Optional<OperandRange>(*operands) : llvm::None;
64
0
        }
Unexecuted instantiation: _ZN4mlir17BranchOpInterface22BranchOpInterfaceTraitINS_8BranchOpEE20getSuccessorOperandsEj
Unexecuted instantiation: _ZN4mlir17BranchOpInterface22BranchOpInterfaceTraitINS_12CondBranchOpEE20getSuccessorOperandsEj
65
  Block * getSuccessorForOperands(ArrayRef<Attribute> operands) {
66
 return nullptr;   }
67
0
    static LogicalResult verifyTrait(Operation* op) {
68
0
69
0
    auto concreteOp = cast<ConcreteOpType>(op);
70
0
    for (unsigned i = 0, e = op->getNumSuccessors(); i != e; ++i) {
71
0
      Optional<OperandRange> operands = concreteOp.getSuccessorOperands(i);
72
0
      if (failed(detail::verifyBranchSuccessorOperands(op, i, operands)))
73
0
        return failure();
74
0
    }
75
0
    return success();
76
0
  
77
0
  }
Unexecuted instantiation: _ZN4mlir17BranchOpInterface22BranchOpInterfaceTraitINS_8BranchOpEE11verifyTraitEPNS_9OperationE
Unexecuted instantiation: _ZN4mlir17BranchOpInterface22BranchOpInterfaceTraitINS_12CondBranchOpEE11verifyTraitEPNS_9OperationE
78
  };
79
    template <typename ConcreteOp>
80
    struct Trait : public BranchOpInterfaceTrait<ConcreteOp> {};
81
  Optional<MutableOperandRange> getMutableSuccessorOperands(unsigned index);
82
  Optional<OperandRange> getSuccessorOperands(unsigned index);
83
  Optional<BlockArgument> getSuccessorBlockArgument(unsigned operandIndex);
84
  Block * getSuccessorForOperands(ArrayRef<Attribute> operands);
85
};
86
namespace detail {
87
struct RegionBranchOpInterfaceInterfaceTraits {
88
  class Concept {
89
  public:
90
    virtual ~Concept() = default;
91
    virtual OperandRange getSuccessorEntryOperands(Operation *tablegen_opaque_op, unsigned index) = 0;
92
    virtual void getSuccessorRegions(Operation *tablegen_opaque_op, Optional<unsigned> index, ArrayRef<Attribute> operands, SmallVectorImpl<RegionSuccessor> & regions) = 0;
93
  };
94
  template<typename ConcreteOp>
95
  class Model : public Concept {
96
public:
97
    OperandRange getSuccessorEntryOperands(Operation *tablegen_opaque_op, unsigned index) final {
98
      auto op = llvm::cast<ConcreteOp>(tablegen_opaque_op);
99
      (void)op;
100
      return op.getSuccessorEntryOperands(index);
101
    }
102
    void getSuccessorRegions(Operation *tablegen_opaque_op, Optional<unsigned> index, ArrayRef<Attribute> operands, SmallVectorImpl<RegionSuccessor> & regions) final {
103
      auto op = llvm::cast<ConcreteOp>(tablegen_opaque_op);
104
      (void)op;
105
      return op.getSuccessorRegions(index, operands, regions);
106
    }
107
  };
108
};
109
} // end namespace detail
110
class RegionBranchOpInterface : public OpInterface<RegionBranchOpInterface, detail::RegionBranchOpInterfaceInterfaceTraits> {
111
public:
112
  using OpInterface<RegionBranchOpInterface, detail::RegionBranchOpInterfaceInterfaceTraits>::OpInterface;
113
  template <typename ConcreteOp>
114
  struct RegionBranchOpInterfaceTrait : public OpInterface<RegionBranchOpInterface, detail::RegionBranchOpInterfaceInterfaceTraits>::Trait<ConcreteOp> {
115
  OperandRange getSuccessorEntryOperands(unsigned index) {
116
117
        auto operandEnd = this->getOperation()->operand_end();
118
        return OperandRange(operandEnd, operandEnd);
119
        }
120
  };
121
    template <typename ConcreteOp>
122
    struct Trait : public RegionBranchOpInterfaceTrait<ConcreteOp> {};
123
  OperandRange getSuccessorEntryOperands(unsigned index);
124
  void getSuccessorRegions(Optional<unsigned> index, ArrayRef<Attribute> operands, SmallVectorImpl<RegionSuccessor> & regions);
125
};