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

daisytuner / sdfglib / 15238327410

25 May 2025 01:21PM UTC coverage: 60.381% (+0.04%) from 60.342%
15238327410

Pull #32

github

web-flow
Merge 979e5bb69 into 337a208bc
Pull Request #32: Test formatting

297 of 456 new or added lines in 52 files covered. (65.13%)

19 existing lines in 15 files now uncovered.

8268 of 13693 relevant lines covered (60.38%)

99.82 hits per line

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

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

3
namespace sdfg {
4
namespace visitor {
5

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

10
bool StructuredSDFGVisitor::visit() {
14✔
11
    if (this->accept(builder_.subject().root(), builder_.subject().root())) {
14✔
12
        return true;
2✔
13
    }
14
    return this->visit(builder_.subject().root());
12✔
15
}
14✔
16

17
bool StructuredSDFGVisitor::visit(structured_control_flow::Sequence& parent) {
18✔
18
    std::list<structured_control_flow::ControlFlowNode*> queue;
18✔
19
    for (size_t i = 0; i < parent.size(); i++) {
40✔
20
        queue.push_back(&parent.at(i).first);
22✔
21
    }
22✔
22
    while (!queue.empty()) {
29✔
23
        auto current = queue.front();
22✔
24
        queue.pop_front();
22✔
25

26
        if (auto block_stmt = dynamic_cast<structured_control_flow::Block*>(current)) {
22✔
27
            if (this->accept(parent, *block_stmt)) {
4✔
28
                return true;
1✔
29
            }
30
        } else if (auto sequence_stmt = dynamic_cast<structured_control_flow::Sequence*>(current)) {
21✔
31
            if (this->accept(parent, *sequence_stmt)) {
1✔
32
                return true;
×
33
            }
34

35
            if (this->visit(*sequence_stmt)) {
1✔
36
                return true;
×
37
            }
38
        } else if (auto return_stmt = dynamic_cast<structured_control_flow::Return*>(current)) {
18✔
39
            if (this->accept(parent, *return_stmt)) {
2✔
40
                return true;
1✔
41
            }
42
        } else if (auto if_else_stmt = dynamic_cast<structured_control_flow::IfElse*>(current)) {
16✔
43
            if (this->accept(parent, *if_else_stmt)) {
2✔
44
                return true;
1✔
45
            }
46

47
            for (size_t i = 0; i < if_else_stmt->size(); i++) {
1✔
48
                if (this->visit(if_else_stmt->at(i).first)) {
×
49
                    return true;
×
50
                }
51
            }
×
52
        } else if (auto for_stmt = dynamic_cast<structured_control_flow::For*>(current)) {
14✔
53
            if (this->accept(parent, *for_stmt)) {
2✔
54
                return true;
1✔
55
            }
56

57
            if (this->visit(for_stmt->root())) {
1✔
58
                return true;
×
59
            }
60
        } else if (auto while_stmt = dynamic_cast<structured_control_flow::While*>(current)) {
12✔
61
            if (this->accept(parent, *while_stmt)) {
4✔
62
                return true;
1✔
63
            }
64

65
            if (this->visit(while_stmt->root())) {
3✔
66
                return true;
2✔
67
            }
68
        } else if (auto continue_stmt = dynamic_cast<structured_control_flow::Continue*>(current)) {
8✔
69
            if (this->accept(parent, *continue_stmt)) {
2✔
70
                return true;
1✔
71
            }
72
        } else if (auto break_stmt = dynamic_cast<structured_control_flow::Break*>(current)) {
6✔
73
            if (this->accept(parent, *break_stmt)) {
2✔
74
                return true;
1✔
75
            }
76
        } else if (auto kern_stmt = dynamic_cast<structured_control_flow::Kernel*>(current)) {
4✔
77
            if (this->accept(parent, *kern_stmt)) {
2✔
78
                return true;
1✔
79
            }
80

81
            if (this->visit(kern_stmt->root())) {
1✔
82
                return true;
×
83
            }
84
        } else if (auto map_stmt = dynamic_cast<structured_control_flow::Map*>(current)) {
2✔
85
            if (this->accept(parent, *map_stmt)) {
1✔
86
                return true;
1✔
87
            }
88

NEW
89
            if (this->visit(map_stmt->root())) {
×
NEW
90
                return true;
×
91
            }
UNCOV
92
        }
×
93
    }
94

95
    return false;
7✔
96
};
18✔
97

98
bool StructuredSDFGVisitor::accept(structured_control_flow::Sequence& parent,
3✔
99
                                   structured_control_flow::Block& node) {
100
    return false;
3✔
101
};
102

103
bool StructuredSDFGVisitor::accept(structured_control_flow::Sequence& parent,
2✔
104
                                   structured_control_flow::Sequence& node) {
105
    return false;
2✔
106
};
107

108
bool StructuredSDFGVisitor::accept(structured_control_flow::Sequence& parent,
1✔
109
                                   structured_control_flow::Return& node) {
110
    return false;
1✔
111
};
112

113
bool StructuredSDFGVisitor::accept(structured_control_flow::Sequence& parent,
1✔
114
                                   structured_control_flow::IfElse& node) {
115
    return false;
1✔
116
};
117

118
bool StructuredSDFGVisitor::accept(structured_control_flow::Sequence& parent,
1✔
119
                                   structured_control_flow::While& node) {
120
    return false;
1✔
121
};
122

123
bool StructuredSDFGVisitor::accept(structured_control_flow::Sequence& parent,
1✔
124
                                   structured_control_flow::Continue& node) {
125
    return false;
1✔
126
};
127

128
bool StructuredSDFGVisitor::accept(structured_control_flow::Sequence& parent,
1✔
129
                                   structured_control_flow::Break& node) {
130
    return false;
1✔
131
};
132

133
bool StructuredSDFGVisitor::accept(structured_control_flow::Sequence& parent,
1✔
134
                                   structured_control_flow::For& node) {
135
    return false;
1✔
136
};
137

138
bool StructuredSDFGVisitor::accept(structured_control_flow::Sequence& parent,
1✔
139
                                   structured_control_flow::Kernel& node) {
140
    return false;
1✔
141
};
142

NEW
143
bool StructuredSDFGVisitor::accept(structured_control_flow::Sequence& parent,
×
144
                                   structured_control_flow::Map& node) {
NEW
145
    return false;
×
146
};
147

148
}  // namespace visitor
149
}  // 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