cpp

Coverage Report

Created: 2024-03-13 14:13

/home/andy/git/oilshell/oil/mycpp/gc_tuple.h
Line
Count
Source (jump to first uncovered line)
1
#ifndef MYCPP_GC_TUPLE_H
2
#define MYCPP_GC_TUPLE_H
3
4
#include <type_traits>
5
6
template <class A, class B>
7
class Tuple2 {
8
  typedef Tuple2<A, B> this_type;
9
10
 public:
11
194
  Tuple2(A a, B b) : a_(a), b_(b) {
12
194
  }
_ZN6Tuple2IP6BigStrS1_EC2ES1_S1_
Line
Count
Source
11
10
  Tuple2(A a, B b) : a_(a), b_(b) {
12
10
  }
_ZN6Tuple2IiP6BigStrEC2EiS1_
Line
Count
Source
11
37
  Tuple2(A a, B b) : a_(a), b_(b) {
12
37
  }
_ZN6Tuple2IP6BigStriEC2ES1_i
Line
Count
Source
11
61
  Tuple2(A a, B b) : a_(a), b_(b) {
12
61
  }
_ZN6Tuple2IN9expr_asdl5tok_eEP6BigStrEC2ES1_S3_
Line
Count
Source
11
58
  Tuple2(A a, B b) : a_(a), b_(b) {
12
58
  }
_ZN6Tuple2IiiEC2Eii
Line
Count
Source
11
26
  Tuple2(A a, B b) : a_(a), b_(b) {
12
26
  }
_ZN6Tuple2IiPS_IiP6BigStrEEC2EiS3_
Line
Count
Source
11
2
  Tuple2(A a, B b) : a_(a), b_(b) {
12
2
  }
Unexecuted instantiation: _ZN6Tuple2IiPvEC2EiS0_
Unexecuted instantiation: _ZN6Tuple2IP4ListIPS0_IPS_IiiEEEP4DictIiiEEC2ES6_S9_
Unexecuted instantiation: _ZN6Tuple2IP6BigStrPN11syntax_asdl5loc_tEEC2ES1_S4_
Unexecuted instantiation: _ZN6Tuple2IP4ListIP6BigStrEPS0_IPN11syntax_asdl12CompoundWordEEEC2ES4_S9_
Unexecuted instantiation: _ZN6Tuple2IP6BigStrbEC2ES1_b
13
14
240
  A at0() {
15
240
    return a_;
16
240
  }
_ZN6Tuple2IP6BigStriE3at0Ev
Line
Count
Source
14
79
  A at0() {
15
79
    return a_;
16
79
  }
_ZN6Tuple2IiiE3at0Ev
Line
Count
Source
14
44
  A at0() {
15
44
    return a_;
16
44
  }
_ZN6Tuple2IiP6BigStrE3at0Ev
Line
Count
Source
14
47
  A at0() {
15
47
    return a_;
16
47
  }
_ZN6Tuple2IN9expr_asdl5tok_eEP6BigStrE3at0Ev
Line
Count
Source
14
58
  A at0() {
15
58
    return a_;
16
58
  }
_ZN6Tuple2IP6BigStrS1_E3at0Ev
Line
Count
Source
14
10
  A at0() {
15
10
    return a_;
16
10
  }
_ZN6Tuple2IiPS_IiP6BigStrEE3at0Ev
Line
Count
Source
14
2
  A at0() {
15
2
    return a_;
16
2
  }
17
224
  B at1() {
18
224
    return b_;
19
224
  }
_ZN6Tuple2IP6BigStriE3at1Ev
Line
Count
Source
17
73
  B at1() {
18
73
    return b_;
19
73
  }
_ZN6Tuple2IiiE3at1Ev
Line
Count
Source
17
41
  B at1() {
18
41
    return b_;
19
41
  }
_ZN6Tuple2IiP6BigStrE3at1Ev
Line
Count
Source
17
38
  B at1() {
18
38
    return b_;
19
38
  }
_ZN6Tuple2IN9expr_asdl5tok_eEP6BigStrE3at1Ev
Line
Count
Source
17
58
  B at1() {
18
58
    return b_;
19
58
  }
_ZN6Tuple2IP6BigStrS1_E3at1Ev
Line
Count
Source
17
10
  B at1() {
18
10
    return b_;
19
10
  }
_ZN6Tuple2IiPS_IiP6BigStrEE3at1Ev
Line
Count
Source
17
4
  B at1() {
18
4
    return b_;
19
4
  }
20
21
85
  static constexpr ObjHeader obj_header() {
22
85
    return ObjHeader::Tuple(field_mask(), sizeof(this_type));
23
85
  }
_ZN6Tuple2IiP6BigStrE10obj_headerEv
Line
Count
Source
21
27
  static constexpr ObjHeader obj_header() {
22
27
    return ObjHeader::Tuple(field_mask(), sizeof(this_type));
23
27
  }
_ZN6Tuple2IP6BigStriE10obj_headerEv
Line
Count
Source
21
37
  static constexpr ObjHeader obj_header() {
22
37
    return ObjHeader::Tuple(field_mask(), sizeof(this_type));
23
37
  }
_ZN6Tuple2IiiE10obj_headerEv
Line
Count
Source
21
19
  static constexpr ObjHeader obj_header() {
22
19
    return ObjHeader::Tuple(field_mask(), sizeof(this_type));
23
19
  }
_ZN6Tuple2IiPS_IiP6BigStrEE10obj_headerEv
Line
Count
Source
21
2
  static constexpr ObjHeader obj_header() {
22
2
    return ObjHeader::Tuple(field_mask(), sizeof(this_type));
23
2
  }
Unexecuted instantiation: _ZN6Tuple2IP6BigStrS1_E10obj_headerEv
Unexecuted instantiation: _ZN6Tuple2IP4ListIPS0_IPS_IiiEEEP4DictIiiEE10obj_headerEv
Unexecuted instantiation: _ZN6Tuple2IP6BigStrbE10obj_headerEv
24
25
85
  static constexpr uint32_t field_mask() {
26
85
    return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) |
27
85
           (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0);
28
85
  }
_ZN6Tuple2IiP6BigStrE10field_maskEv
Line
Count
Source
25
27
  static constexpr uint32_t field_mask() {
26
27
    return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) |
27
27
           (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0);
28
27
  }
_ZN6Tuple2IP6BigStriE10field_maskEv
Line
Count
Source
25
37
  static constexpr uint32_t field_mask() {
26
37
    return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) |
27
37
           (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0);
28
37
  }
_ZN6Tuple2IiiE10field_maskEv
Line
Count
Source
25
19
  static constexpr uint32_t field_mask() {
26
19
    return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) |
27
19
           (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0);
28
19
  }
_ZN6Tuple2IiPS_IiP6BigStrEE10field_maskEv
Line
Count
Source
25
2
  static constexpr uint32_t field_mask() {
26
2
    return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) |
27
2
           (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0);
28
2
  }
Unexecuted instantiation: _ZN6Tuple2IP6BigStrS1_E10field_maskEv
Unexecuted instantiation: _ZN6Tuple2IP4ListIPS0_IPS_IiiEEEP4DictIiiEE10field_maskEv
Unexecuted instantiation: _ZN6Tuple2IP6BigStrbE10field_maskEv
29
30
 private:
31
  A a_;
32
  B b_;
33
};
34
35
template <class A, class B, class C>
36
class Tuple3 {
37
  typedef Tuple3<A, B, C> this_type;
38
39
 public:
40
3
  Tuple3(A a, B b, C c) : a_(a), b_(b), c_(c) {
41
3
  }
_ZN6Tuple3IiP6BigStrS1_EC2EiS1_S1_
Line
Count
Source
40
2
  Tuple3(A a, B b, C c) : a_(a), b_(b), c_(c) {
41
2
  }
_ZN6Tuple3IdddEC2Eddd
Line
Count
Source
40
1
  Tuple3(A a, B b, C c) : a_(a), b_(b), c_(c) {
41
1
  }
42
3
  A at0() {
43
3
    return a_;
44
3
  }
_ZN6Tuple3IiP6BigStrS1_E3at0Ev
Line
Count
Source
42
2
  A at0() {
43
2
    return a_;
44
2
  }
_ZN6Tuple3IdddE3at0Ev
Line
Count
Source
42
1
  A at0() {
43
1
    return a_;
44
1
  }
45
3
  B at1() {
46
3
    return b_;
47
3
  }
_ZN6Tuple3IiP6BigStrS1_E3at1Ev
Line
Count
Source
45
2
  B at1() {
46
2
    return b_;
47
2
  }
_ZN6Tuple3IdddE3at1Ev
Line
Count
Source
45
1
  B at1() {
46
1
    return b_;
47
1
  }
48
3
  C at2() {
49
3
    return c_;
50
3
  }
_ZN6Tuple3IiP6BigStrS1_E3at2Ev
Line
Count
Source
48
2
  C at2() {
49
2
    return c_;
50
2
  }
_ZN6Tuple3IdddE3at2Ev
Line
Count
Source
48
1
  C at2() {
49
1
    return c_;
50
1
  }
51
52
2
  static constexpr ObjHeader obj_header() {
53
2
    return ObjHeader::Tuple(field_mask(), sizeof(this_type));
54
2
  }
_ZN6Tuple3IiP6BigStrS1_E10obj_headerEv
Line
Count
Source
52
2
  static constexpr ObjHeader obj_header() {
53
2
    return ObjHeader::Tuple(field_mask(), sizeof(this_type));
54
2
  }
Unexecuted instantiation: _ZN6Tuple3IP6BigStrS1_S1_E10obj_headerEv
55
56
2
  static constexpr uint32_t field_mask() {
57
2
    return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) |
58
2
           (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0) |
59
2
           (std::is_pointer<C>() ? maskbit(offsetof(this_type, c_)) : 0);
60
2
  }
_ZN6Tuple3IiP6BigStrS1_E10field_maskEv
Line
Count
Source
56
2
  static constexpr uint32_t field_mask() {
57
2
    return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) |
58
2
           (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0) |
59
2
           (std::is_pointer<C>() ? maskbit(offsetof(this_type, c_)) : 0);
60
2
  }
Unexecuted instantiation: _ZN6Tuple3IP6BigStrS1_S1_E10field_maskEv
61
62
 private:
63
  A a_;
64
  B b_;
65
  C c_;
66
};
67
68
template <class A, class B, class C, class D>
69
class Tuple4 {
70
  typedef Tuple4<A, B, C, D> this_type;
71
72
 public:
73
2
  Tuple4(A a, B b, C c, D d) : a_(a), b_(b), c_(c), d_(d) {
74
2
  }
75
2
  A at0() {
76
2
    return a_;
77
2
  }
78
2
  B at1() {
79
2
    return b_;
80
2
  }
81
2
  C at2() {
82
2
    return c_;
83
2
  }
84
2
  D at3() {
85
2
    return d_;
86
2
  }
87
88
2
  static constexpr ObjHeader obj_header() {
89
2
    return ObjHeader::Tuple(field_mask(), sizeof(this_type));
90
2
  }
_ZN6Tuple4IiP6BigStrS1_iE10obj_headerEv
Line
Count
Source
88
2
  static constexpr ObjHeader obj_header() {
89
2
    return ObjHeader::Tuple(field_mask(), sizeof(this_type));
90
2
  }
Unexecuted instantiation: _ZN6Tuple4IiiP6BigStrS1_E10obj_headerEv
91
92
2
  static constexpr uint32_t field_mask() {
93
2
    return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) |
94
2
           (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0) |
95
2
           (std::is_pointer<C>() ? maskbit(offsetof(this_type, c_)) : 0) |
96
2
           (std::is_pointer<D>() ? maskbit(offsetof(this_type, d_)) : 0);
97
2
  }
_ZN6Tuple4IiP6BigStrS1_iE10field_maskEv
Line
Count
Source
92
2
  static constexpr uint32_t field_mask() {
93
2
    return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) |
94
2
           (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0) |
95
2
           (std::is_pointer<C>() ? maskbit(offsetof(this_type, c_)) : 0) |
96
2
           (std::is_pointer<D>() ? maskbit(offsetof(this_type, d_)) : 0);
97
2
  }
Unexecuted instantiation: _ZN6Tuple4IiiP6BigStrS1_E10field_maskEv
98
99
 private:
100
  A a_;
101
  B b_;
102
  C c_;
103
  D d_;
104
};
105
106
template <class A, class B, class C, class D, class E>
107
class Tuple5 {
108
  typedef Tuple5<A, B, C, D, E> this_type;
109
110
 public:
111
  Tuple5(A a, B b, C c, D d, E e) : a_(a), b_(b), c_(c), d_(d), e_(e) {
112
  }
113
  A at0() {
114
    return a_;
115
  }
116
  B at1() {
117
    return b_;
118
  }
119
  C at2() {
120
    return c_;
121
  }
122
  D at3() {
123
    return d_;
124
  }
125
  E at4() {
126
    return e_;
127
  }
128
129
  static constexpr ObjHeader obj_header() {
130
    return ObjHeader::Tuple(field_mask(), sizeof(this_type));
131
  }
132
133
  static constexpr uint32_t field_mask() {
134
    return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) |
135
           (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0) |
136
           (std::is_pointer<C>() ? maskbit(offsetof(this_type, c_)) : 0) |
137
           (std::is_pointer<D>() ? maskbit(offsetof(this_type, d_)) : 0) |
138
           (std::is_pointer<E>() ? maskbit(offsetof(this_type, e_)) : 0);
139
  }
140
141
 private:
142
  A a_;
143
  B b_;
144
  C c_;
145
  D d_;
146
  E e_;
147
};
148
149
#endif  // MYCPP_GC_TUPLE_H