GCC Code Coverage Report


Directory: ../
File: src/typechecker/TypeCheckerTopLevelDefinitions.cpp
Date: 2025-08-26 18:26:32
Exec Total Coverage
Lines: 44 44 100.0%
Functions: 11 11 100.0%
Branches: 29 36 80.6%

Line Branch Exec Source
1 // Copyright (c) 2021-2025 ChilliBits. All rights reserved.
2
3 #include "TypeChecker.h"
4
5 namespace spice::compiler {
6
7 765 std::any TypeChecker::visitMainFctDef(MainFctDefNode *node) {
8
2/2
✓ Branch 0 (2→3) taken 362 times.
✓ Branch 1 (2→4) taken 403 times.
765 if (typeCheckerMode == TC_MODE_PRE)
9 362 return visitMainFctDefPrepare(node);
10 else
11 403 return visitMainFctDefCheck(node);
12 }
13
14 21597 std::any TypeChecker::visitFctDef(FctDefNode *node) {
15
2/2
✓ Branch 0 (2→3) taken 6980 times.
✓ Branch 1 (2→4) taken 14617 times.
21597 if (typeCheckerMode == TC_MODE_PRE)
16 6980 return visitFctDefPrepare(node);
17 else
18 14617 return visitFctDefCheck(node);
19 }
20
21 10653 std::any TypeChecker::visitProcDef(ProcDefNode *node) {
22
2/2
✓ Branch 0 (2→3) taken 3436 times.
✓ Branch 1 (2→4) taken 7217 times.
10653 if (typeCheckerMode == TC_MODE_PRE)
23 3436 return visitProcDefPrepare(node);
24 else
25 7217 return visitProcDefCheck(node);
26 }
27
28 1600 std::any TypeChecker::visitStructDef(StructDefNode *node) {
29
2/2
✓ Branch 0 (2→3) taken 610 times.
✓ Branch 1 (2→4) taken 990 times.
1600 if (typeCheckerMode == TC_MODE_PRE)
30 610 return visitStructDefPrepare(node);
31 else
32 990 return visitStructDefCheck(node);
33 }
34
35 172 std::any TypeChecker::visitInterfaceDef(InterfaceDefNode *node) {
36
2/2
✓ Branch 0 (2→3) taken 83 times.
✓ Branch 1 (2→4) taken 89 times.
172 if (typeCheckerMode == TC_MODE_PRE)
37 83 return visitInterfaceDefPrepare(node);
38
1/2
✓ Branch 0 (4→5) taken 89 times.
✗ Branch 1 (4→7) not taken.
89 return nullptr;
39 }
40
41 184 std::any TypeChecker::visitEnumDef(EnumDefNode *node) {
42
2/2
✓ Branch 0 (2→3) taken 63 times.
✓ Branch 1 (2→4) taken 121 times.
184 if (typeCheckerMode == TC_MODE_PRE)
43 63 return visitEnumDefPrepare(node);
44
1/2
✓ Branch 0 (4→5) taken 121 times.
✗ Branch 1 (4→7) not taken.
121 return nullptr;
45 }
46
47 2530 std::any TypeChecker::visitGenericTypeDef(GenericTypeDefNode *node) {
48
2/2
✓ Branch 0 (2→3) taken 813 times.
✓ Branch 1 (2→4) taken 1717 times.
2530 if (typeCheckerMode == TC_MODE_PRE)
49 813 return visitGenericTypeDefPrepare(node);
50
1/2
✓ Branch 0 (4→5) taken 1717 times.
✗ Branch 1 (4→7) not taken.
1717 return nullptr;
51 }
52
53 166 std::any TypeChecker::visitAliasDef(AliasDefNode *node) {
54
2/2
✓ Branch 0 (2→3) taken 65 times.
✓ Branch 1 (2→4) taken 101 times.
166 if (typeCheckerMode == TC_MODE_PRE)
55 65 return visitAliasDefPrepare(node);
56
1/2
✓ Branch 0 (4→5) taken 101 times.
✗ Branch 1 (4→7) not taken.
101 return nullptr;
57 }
58
59 2668 std::any TypeChecker::visitGlobalVarDef(GlobalVarDefNode *node) {
60
2/2
✓ Branch 0 (2→3) taken 1156 times.
✓ Branch 1 (2→4) taken 1512 times.
2668 if (typeCheckerMode == TC_MODE_PRE)
61 1156 return visitGlobalVarDefPrepare(node);
62
1/2
✓ Branch 0 (4→5) taken 1512 times.
✗ Branch 1 (4→7) not taken.
1512 return nullptr;
63 }
64
65 2708 std::any TypeChecker::visitExtDecl(ExtDeclNode *node) {
66
2/2
✓ Branch 0 (2→3) taken 920 times.
✓ Branch 1 (2→4) taken 1788 times.
2708 if (typeCheckerMode == TC_MODE_PRE)
67 920 return visitExtDeclPrepare(node);
68
1/2
✓ Branch 0 (4→5) taken 1788 times.
✗ Branch 1 (4→7) not taken.
1788 return nullptr;
69 }
70
71 1430 std::any TypeChecker::visitImportDef(ImportDefNode *node) {
72
2/2
✓ Branch 0 (2→3) taken 516 times.
✓ Branch 1 (2→4) taken 914 times.
1430 if (typeCheckerMode == TC_MODE_PRE)
73 516 return visitImportDefPrepare(node);
74
1/2
✓ Branch 0 (4→5) taken 914 times.
✗ Branch 1 (4→7) not taken.
914 return nullptr;
75 }
76
77 } // namespace spice::compiler
78