• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

daisytuner / sdfglib / 18651924023

20 Oct 2025 12:26PM UTC coverage: 60.977% (-0.6%) from 61.539%
18651924023

push

github

web-flow
Merge pull request #286 from daisytuner/reserved-names

removes restricted globals filtering in codegen

8 of 20 new or added lines in 2 files covered. (40.0%)

342 existing lines in 17 files now uncovered.

9174 of 15045 relevant lines covered (60.98%)

92.1 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

72.83
/src/visitor/structured_sdfg_visitor.cpp
1
#include "sdfg/visitor/structured_sdfg_visitor.h"
2

3
namespace sdfg {
4
namespace visitor {
5

6
StructuredSDFGVisitor::
7
    StructuredSDFGVisitor(builder::StructuredSDFGBuilder& builder, analysis::AnalysisManager& analysis_manager)
30✔
8
    : builder_(builder), analysis_manager_(analysis_manager) {}
30✔
9

10
bool StructuredSDFGVisitor::visit() { return this->visit_internal(builder_.subject().root()); }
30✔
11

12
bool StructuredSDFGVisitor::visit_internal(structured_control_flow::Sequence& parent) {
33✔
13
    if (this->accept(parent)) {
33✔
14
        return true;
4✔
15
    }
16

17
    for (size_t i = 0; i < parent.size(); i++) {
43✔
18
        auto& current = parent.at(i).first;
34✔
19

20
        if (auto block_stmt = dynamic_cast<structured_control_flow::Block*>(&current)) {
34✔
21
            if (this->accept(*block_stmt)) {
5✔
22
                return true;
1✔
23
            }
24
        } else if (auto sequence_stmt = dynamic_cast<structured_control_flow::Sequence*>(&current)) {
33✔
25
            if (this->visit_internal(*sequence_stmt)) {
2✔
26
                return true;
1✔
27
            }
28
        } else if (auto if_else_stmt = dynamic_cast<structured_control_flow::IfElse*>(&current)) {
28✔
29
            if (this->accept(*if_else_stmt)) {
3✔
30
                return true;
1✔
31
            }
32

33
            for (size_t i = 0; i < if_else_stmt->size(); i++) {
3✔
34
                if (this->visit_internal(if_else_stmt->at(i).first)) {
1✔
35
                    return true;
×
36
                }
37
            }
1✔
38
        } else if (auto for_stmt = dynamic_cast<structured_control_flow::For*>(&current)) {
26✔
39
            if (this->accept(*for_stmt)) {
12✔
40
                return true;
9✔
41
            }
42

43
            if (this->visit_internal(for_stmt->root())) {
3✔
44
                return true;
×
45
            }
46
        } else if (auto map_stmt = dynamic_cast<structured_control_flow::Map*>(&current)) {
15✔
47
            if (this->accept(*map_stmt)) {
2✔
48
                return true;
1✔
49
            }
50

51
            if (this->visit_internal(map_stmt->root())) {
1✔
52
                return true;
1✔
53
            }
54
        } else if (auto while_stmt = dynamic_cast<structured_control_flow::While*>(&current)) {
10✔
55
            if (this->accept(*while_stmt)) {
4✔
56
                return true;
1✔
57
            }
58

59
            if (this->visit_internal(while_stmt->root())) {
3✔
60
                return true;
2✔
61
            }
62
        } else if (auto continue_stmt = dynamic_cast<structured_control_flow::Continue*>(&current)) {
7✔
63
            if (this->accept(*continue_stmt)) {
2✔
64
                return true;
1✔
65
            }
66
        } else if (auto break_stmt = dynamic_cast<structured_control_flow::Break*>(&current)) {
5✔
67
            if (this->accept(*break_stmt)) {
2✔
68
                return true;
1✔
69
            }
70
        } else if (auto return_stmt = dynamic_cast<structured_control_flow::Return*>(&current)) {
3✔
71
            if (this->accept(*return_stmt)) {
2✔
72
                return true;
1✔
73
            }
74
        }
1✔
75
    }
14✔
76

77
    return false;
9✔
78
};
33✔
79

80
bool StructuredSDFGVisitor::accept(structured_control_flow::Block& node) { return false; };
15✔
81

82
bool StructuredSDFGVisitor::accept(structured_control_flow::Sequence& node) { return false; };
15✔
83

84
bool StructuredSDFGVisitor::accept(structured_control_flow::Return& node) { return false; };
1✔
85

86
bool StructuredSDFGVisitor::accept(structured_control_flow::IfElse& node) { return false; };
2✔
87

88
bool StructuredSDFGVisitor::accept(structured_control_flow::While& node) { return false; };
1✔
89

90
bool StructuredSDFGVisitor::accept(structured_control_flow::Continue& node) { return false; };
1✔
91

92
bool StructuredSDFGVisitor::accept(structured_control_flow::Break& node) { return false; };
1✔
93

94
bool StructuredSDFGVisitor::accept(structured_control_flow::For& node) { return false; };
2✔
95

96
bool StructuredSDFGVisitor::accept(structured_control_flow::Map& node) { return false; };
1✔
97

98
NonStoppingStructuredSDFGVisitor::NonStoppingStructuredSDFGVisitor(
7✔
99
    builder::StructuredSDFGBuilder& builder, analysis::AnalysisManager& analysis_manager
100
)
101
    : StructuredSDFGVisitor(builder, analysis_manager), applied_(false) {}
7✔
102

103
bool NonStoppingStructuredSDFGVisitor::visit_internal(structured_control_flow::Sequence& parent) {
7✔
104
    applied_ |= this->accept(parent);
7✔
105

106
    for (size_t i = 0; i < parent.size(); i++) {
18✔
107
        auto& current = parent.at(i).first;
11✔
108

109
        if (auto block_stmt = dynamic_cast<structured_control_flow::Block*>(&current)) {
11✔
110
            applied_ |= this->accept(*block_stmt);
11✔
111
        } else if (auto sequence_stmt = dynamic_cast<structured_control_flow::Sequence*>(&current)) {
11✔
UNCOV
112
            this->visit_internal(*sequence_stmt);
×
UNCOV
113
        } else if (auto if_else_stmt = dynamic_cast<structured_control_flow::IfElse*>(&current)) {
×
UNCOV
114
            applied_ |= this->accept(*if_else_stmt);
×
115

UNCOV
116
            for (size_t i = 0; i < if_else_stmt->size(); i++) {
×
UNCOV
117
                this->visit_internal(if_else_stmt->at(i).first);
×
UNCOV
118
            }
×
UNCOV
119
        } else if (auto for_stmt = dynamic_cast<structured_control_flow::For*>(&current)) {
×
UNCOV
120
            applied_ |= this->accept(*for_stmt);
×
UNCOV
121
            this->visit_internal(for_stmt->root());
×
UNCOV
122
        } else if (auto map_stmt = dynamic_cast<structured_control_flow::Map*>(&current)) {
×
UNCOV
123
            applied_ |= this->accept(*map_stmt);
×
UNCOV
124
            this->visit_internal(map_stmt->root());
×
UNCOV
125
        } else if (auto while_stmt = dynamic_cast<structured_control_flow::While*>(&current)) {
×
UNCOV
126
            applied_ |= this->accept(*while_stmt);
×
UNCOV
127
            this->visit_internal(while_stmt->root());
×
UNCOV
128
        } else if (auto continue_stmt = dynamic_cast<structured_control_flow::Continue*>(&current)) {
×
UNCOV
129
            applied_ |= this->accept(*continue_stmt);
×
UNCOV
130
        } else if (auto break_stmt = dynamic_cast<structured_control_flow::Break*>(&current)) {
×
UNCOV
131
            applied_ |= this->accept(*break_stmt);
×
UNCOV
132
        } else if (auto return_stmt = dynamic_cast<structured_control_flow::Return*>(&current)) {
×
UNCOV
133
            applied_ |= this->accept(*return_stmt);
×
UNCOV
134
        }
×
135
    }
11✔
136

137
    return false;
7✔
UNCOV
138
};
×
139

140
} // namespace visitor
141
} // namespace sdfg
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc