GCC Code Coverage Report


Directory: src/
File: src/mir/type-member.cpp
Date: 2025-10-24 11:14:59
Exec Total Coverage
Lines: 21 23 91.3%
Functions: 6 7 85.7%
Branches: 0 0 -%

Line Branch Exec Source
1 /* Copyright 2025 Jonathan S. Arney
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * https://github.com/jarney/gyoji/blob/master/LICENSE
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15 #include <gyoji-mir/types.hpp>
16 #include <variant>
17 #include <stdio.h>
18
19 using namespace Gyoji::context;
20 using namespace Gyoji::mir;
21
22 54 TypeMember::TypeMember(
23 std::string _member_name,
24 size_t _index,
25 const Type *_member_type,
26 const SourceReference & _source_ref
27 54 )
28 54 : member_name(_member_name)
29 54 , index(_index)
30 54 , member_type(_member_type)
31 54 , source_ref(&_source_ref)
32 54 {}
33 194 TypeMember::TypeMember(const TypeMember & other)
34 194 : member_name(other.member_name)
35 194 , index(other.index)
36 194 , member_type(other.member_type)
37 194 , source_ref(other.source_ref)
38 194 {}
39
40 248 TypeMember::~TypeMember()
41 248 {}
42
43 const std::string &
44 124 TypeMember::get_name() const
45 124 { return member_name; }
46 const Type *
47 96 TypeMember::get_type() const
48 96 { return member_type; }
49 const Gyoji::context::SourceReference &
50 TypeMember::get_source_ref() const
51 { return *source_ref; }
52 size_t
53 14 TypeMember::get_index() const
54 14 { return index; }
55