cpp

Coverage Report

Created: 2023-03-07 20:24

/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
template <class A, class B>
5
class Tuple2 {
6
  typedef Tuple2<A, B> this_type;
7
8
 public:
9
200
  Tuple2(A a, B b) : header_(obj_header()), a_(a), b_(b) {
10
200
  }
_ZN6Tuple2IP3StrS1_EC2ES1_S1_
Line
Count
Source
9
12
  Tuple2(A a, B b) : header_(obj_header()), a_(a), b_(b) {
10
12
  }
_ZN6Tuple2IiP3StrEC2EiS1_
Line
Count
Source
9
39
  Tuple2(A a, B b) : header_(obj_header()), a_(a), b_(b) {
10
39
  }
_ZN6Tuple2IP3StriEC2ES1_i
Line
Count
Source
9
63
  Tuple2(A a, B b) : header_(obj_header()), a_(a), b_(b) {
10
63
  }
_ZN6Tuple2IN9expr_asdl5tok_eEP3StrEC2ES1_S3_
Line
Count
Source
9
58
  Tuple2(A a, B b) : header_(obj_header()), a_(a), b_(b) {
10
58
  }
_ZN6Tuple2IiiEC2Eii
Line
Count
Source
9
26
  Tuple2(A a, B b) : header_(obj_header()), a_(a), b_(b) {
10
26
  }
_ZN6Tuple2IiPS_IiP3StrEEC2EiS3_
Line
Count
Source
9
2
  Tuple2(A a, B b) : header_(obj_header()), a_(a), b_(b) {
10
2
  }
Unexecuted instantiation: _ZN6Tuple2IPN4args11_AttributesEPNS0_6ReaderEEC2ES2_S4_
Unexecuted instantiation: _ZN6Tuple2IP4ListIP3StrEPS0_IiEEC2ES4_S6_
Unexecuted instantiation: _ZN6Tuple2IP3StrbEC2ES1_b
11
12
232
  A at0() {
13
232
    return a_;
14
232
  }
_ZN6Tuple2IP3StriE3at0Ev
Line
Count
Source
12
75
  A at0() {
13
75
    return a_;
14
75
  }
_ZN6Tuple2IiiE3at0Ev
Line
Count
Source
12
40
  A at0() {
13
40
    return a_;
14
40
  }
_ZN6Tuple2IiP3StrE3at0Ev
Line
Count
Source
12
47
  A at0() {
13
47
    return a_;
14
47
  }
_ZN6Tuple2IN9expr_asdl5tok_eEP3StrE3at0Ev
Line
Count
Source
12
58
  A at0() {
13
58
    return a_;
14
58
  }
_ZN6Tuple2IP3StrS1_E3at0Ev
Line
Count
Source
12
10
  A at0() {
13
10
    return a_;
14
10
  }
_ZN6Tuple2IiPS_IiP3StrEE3at0Ev
Line
Count
Source
12
2
  A at0() {
13
2
    return a_;
14
2
  }
15
200
  B at1() {
16
200
    return b_;
17
200
  }
_ZN6Tuple2IP3StriE3at1Ev
Line
Count
Source
15
61
  B at1() {
16
61
    return b_;
17
61
  }
_ZN6Tuple2IiiE3at1Ev
Line
Count
Source
15
29
  B at1() {
16
29
    return b_;
17
29
  }
_ZN6Tuple2IiP3StrE3at1Ev
Line
Count
Source
15
38
  B at1() {
16
38
    return b_;
17
38
  }
_ZN6Tuple2IN9expr_asdl5tok_eEP3StrE3at1Ev
Line
Count
Source
15
58
  B at1() {
16
58
    return b_;
17
58
  }
_ZN6Tuple2IP3StrS1_E3at1Ev
Line
Count
Source
15
10
  B at1() {
16
10
    return b_;
17
10
  }
_ZN6Tuple2IiPS_IiP3StrEE3at1Ev
Line
Count
Source
15
4
  B at1() {
16
4
    return b_;
17
4
  }
18
19
200
  static constexpr ObjHeader obj_header() {
20
200
    return ObjHeader::Tuple(field_mask(), sizeof(this_type));
21
200
  }
_ZN6Tuple2IP3StrS1_E10obj_headerEv
Line
Count
Source
19
12
  static constexpr ObjHeader obj_header() {
20
12
    return ObjHeader::Tuple(field_mask(), sizeof(this_type));
21
12
  }
_ZN6Tuple2IiP3StrE10obj_headerEv
Line
Count
Source
19
39
  static constexpr ObjHeader obj_header() {
20
39
    return ObjHeader::Tuple(field_mask(), sizeof(this_type));
21
39
  }
_ZN6Tuple2IP3StriE10obj_headerEv
Line
Count
Source
19
63
  static constexpr ObjHeader obj_header() {
20
63
    return ObjHeader::Tuple(field_mask(), sizeof(this_type));
21
63
  }
_ZN6Tuple2IN9expr_asdl5tok_eEP3StrE10obj_headerEv
Line
Count
Source
19
58
  static constexpr ObjHeader obj_header() {
20
58
    return ObjHeader::Tuple(field_mask(), sizeof(this_type));
21
58
  }
_ZN6Tuple2IiiE10obj_headerEv
Line
Count
Source
19
26
  static constexpr ObjHeader obj_header() {
20
26
    return ObjHeader::Tuple(field_mask(), sizeof(this_type));
21
26
  }
_ZN6Tuple2IiPS_IiP3StrEE10obj_headerEv
Line
Count
Source
19
2
  static constexpr ObjHeader obj_header() {
20
2
    return ObjHeader::Tuple(field_mask(), sizeof(this_type));
21
2
  }
Unexecuted instantiation: _ZN6Tuple2IPN4args11_AttributesEPNS0_6ReaderEE10obj_headerEv
Unexecuted instantiation: _ZN6Tuple2IP4ListIP3StrEPS0_IiEE10obj_headerEv
Unexecuted instantiation: _ZN6Tuple2IP3StrbE10obj_headerEv
22
23
200
  static constexpr uint16_t field_mask() {
24
200
    return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) |
25
200
           (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0);
26
200
  }
_ZN6Tuple2IP3StrS1_E10field_maskEv
Line
Count
Source
23
12
  static constexpr uint16_t field_mask() {
24
12
    return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) |
25
12
           (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0);
26
12
  }
_ZN6Tuple2IiP3StrE10field_maskEv
Line
Count
Source
23
39
  static constexpr uint16_t field_mask() {
24
39
    return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) |
25
39
           (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0);
26
39
  }
_ZN6Tuple2IP3StriE10field_maskEv
Line
Count
Source
23
63
  static constexpr uint16_t field_mask() {
24
63
    return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) |
25
63
           (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0);
26
63
  }
_ZN6Tuple2IN9expr_asdl5tok_eEP3StrE10field_maskEv
Line
Count
Source
23
58
  static constexpr uint16_t field_mask() {
24
58
    return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) |
25
58
           (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0);
26
58
  }
_ZN6Tuple2IiiE10field_maskEv
Line
Count
Source
23
26
  static constexpr uint16_t field_mask() {
24
26
    return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) |
25
26
           (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0);
26
26
  }
_ZN6Tuple2IiPS_IiP3StrEE10field_maskEv
Line
Count
Source
23
2
  static constexpr uint16_t field_mask() {
24
2
    return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) |
25
2
           (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0);
26
2
  }
Unexecuted instantiation: _ZN6Tuple2IPN4args11_AttributesEPNS0_6ReaderEE10field_maskEv
Unexecuted instantiation: _ZN6Tuple2IP4ListIP3StrEPS0_IiEE10field_maskEv
Unexecuted instantiation: _ZN6Tuple2IP3StrbE10field_maskEv
27
28
  GC_OBJ(header_);
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
7
  Tuple3(A a, B b, C c) : header_(obj_header()), a_(a), b_(b), c_(c) {
41
7
  }
_ZN6Tuple3IP3StrS1_S1_EC2ES1_S1_S1_
Line
Count
Source
40
2
  Tuple3(A a, B b, C c) : header_(obj_header()), a_(a), b_(b), c_(c) {
41
2
  }
_ZN6Tuple3IiP3StrS1_EC2EiS1_S1_
Line
Count
Source
40
4
  Tuple3(A a, B b, C c) : header_(obj_header()), a_(a), b_(b), c_(c) {
41
4
  }
_ZN6Tuple3IdddEC2Eddd
Line
Count
Source
40
1
  Tuple3(A a, B b, C c) : header_(obj_header()), a_(a), b_(b), c_(c) {
41
1
  }
42
3
  A at0() {
43
3
    return a_;
44
3
  }
_ZN6Tuple3IiP3StrS1_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
  }
_ZN6Tuple3IiP3StrS1_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
  }
_ZN6Tuple3IiP3StrS1_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
7
  static constexpr ObjHeader obj_header() {
53
7
    return ObjHeader::Tuple(field_mask(), sizeof(this_type));
54
7
  }
_ZN6Tuple3IP3StrS1_S1_E10obj_headerEv
Line
Count
Source
52
2
  static constexpr ObjHeader obj_header() {
53
2
    return ObjHeader::Tuple(field_mask(), sizeof(this_type));
54
2
  }
_ZN6Tuple3IiP3StrS1_E10obj_headerEv
Line
Count
Source
52
4
  static constexpr ObjHeader obj_header() {
53
4
    return ObjHeader::Tuple(field_mask(), sizeof(this_type));
54
4
  }
_ZN6Tuple3IdddE10obj_headerEv
Line
Count
Source
52
1
  static constexpr ObjHeader obj_header() {
53
1
    return ObjHeader::Tuple(field_mask(), sizeof(this_type));
54
1
  }
55
56
7
  static constexpr uint16_t field_mask() {
57
7
    return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) |
58
7
           (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0) |
59
7
           (std::is_pointer<C>() ? maskbit(offsetof(this_type, c_)) : 0);
60
7
  }
_ZN6Tuple3IP3StrS1_S1_E10field_maskEv
Line
Count
Source
56
2
  static constexpr uint16_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
  }
_ZN6Tuple3IiP3StrS1_E10field_maskEv
Line
Count
Source
56
4
  static constexpr uint16_t field_mask() {
57
4
    return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) |
58
4
           (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0) |
59
4
           (std::is_pointer<C>() ? maskbit(offsetof(this_type, c_)) : 0);
60
4
  }
_ZN6Tuple3IdddE10field_maskEv
Line
Count
Source
56
1
  static constexpr uint16_t field_mask() {
57
1
    return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) |
58
1
           (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0) |
59
1
           (std::is_pointer<C>() ? maskbit(offsetof(this_type, c_)) : 0);
60
1
  }
61
62
  GC_OBJ(header_);
63
64
 private:
65
  A a_;
66
  B b_;
67
  C c_;
68
};
69
70
template <class A, class B, class C, class D>
71
class Tuple4 {
72
  typedef Tuple4<A, B, C, D> this_type;
73
74
 public:
75
  Tuple4(A a, B b, C c, D d)
76
4
      : header_(obj_header()), a_(a), b_(b), c_(c), d_(d) {
77
4
  }
_ZN6Tuple4IiiP3StrS1_EC2EiiS1_S1_
Line
Count
Source
76
2
      : header_(obj_header()), a_(a), b_(b), c_(c), d_(d) {
77
2
  }
_ZN6Tuple4IiP3StrS1_iEC2EiS1_S1_i
Line
Count
Source
76
2
      : header_(obj_header()), a_(a), b_(b), c_(c), d_(d) {
77
2
  }
78
2
  A at0() {
79
2
    return a_;
80
2
  }
81
2
  B at1() {
82
2
    return b_;
83
2
  }
84
2
  C at2() {
85
2
    return c_;
86
2
  }
87
2
  D at3() {
88
2
    return d_;
89
2
  }
90
91
4
  static constexpr ObjHeader obj_header() {
92
4
    return ObjHeader::Tuple(field_mask(), sizeof(this_type));
93
4
  }
_ZN6Tuple4IiiP3StrS1_E10obj_headerEv
Line
Count
Source
91
2
  static constexpr ObjHeader obj_header() {
92
2
    return ObjHeader::Tuple(field_mask(), sizeof(this_type));
93
2
  }
_ZN6Tuple4IiP3StrS1_iE10obj_headerEv
Line
Count
Source
91
2
  static constexpr ObjHeader obj_header() {
92
2
    return ObjHeader::Tuple(field_mask(), sizeof(this_type));
93
2
  }
94
95
4
  static constexpr uint16_t field_mask() {
96
4
    return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) |
97
4
           (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0) |
98
4
           (std::is_pointer<C>() ? maskbit(offsetof(this_type, c_)) : 0) |
99
4
           (std::is_pointer<D>() ? maskbit(offsetof(this_type, d_)) : 0);
100
4
  }
_ZN6Tuple4IiiP3StrS1_E10field_maskEv
Line
Count
Source
95
2
  static constexpr uint16_t field_mask() {
96
2
    return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) |
97
2
           (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0) |
98
2
           (std::is_pointer<C>() ? maskbit(offsetof(this_type, c_)) : 0) |
99
2
           (std::is_pointer<D>() ? maskbit(offsetof(this_type, d_)) : 0);
100
2
  }
_ZN6Tuple4IiP3StrS1_iE10field_maskEv
Line
Count
Source
95
2
  static constexpr uint16_t field_mask() {
96
2
    return (std::is_pointer<A>() ? maskbit(offsetof(this_type, a_)) : 0) |
97
2
           (std::is_pointer<B>() ? maskbit(offsetof(this_type, b_)) : 0) |
98
2
           (std::is_pointer<C>() ? maskbit(offsetof(this_type, c_)) : 0) |
99
2
           (std::is_pointer<D>() ? maskbit(offsetof(this_type, d_)) : 0);
100
2
  }
101
102
  GC_OBJ(header_);
103
104
 private:
105
  A a_;
106
  B b_;
107
  C c_;
108
  D d_;
109
};
110
111
#endif  // MYCPP_GC_TUPLE_H