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

daisytuner / sdfglib / 20770413849

06 Jan 2026 10:50PM UTC coverage: 62.168% (+21.4%) from 40.764%
20770413849

push

github

web-flow
Merge pull request #433 from daisytuner/clang-coverage

updates clang coverage flags

14988 of 24109 relevant lines covered (62.17%)

88.57 hits per line

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

65.71
/src/structured_control_flow/structured_loop.cpp
1
#include "sdfg/structured_control_flow/structured_loop.h"
2

3
namespace sdfg {
4
namespace structured_control_flow {
5

6
StructuredLoop::StructuredLoop(
7
    size_t element_id,
8
    const DebugInfo& debug_info,
9
    symbolic::Symbol indvar,
10
    symbolic::Expression init,
11
    symbolic::Expression update,
12
    symbolic::Condition condition
13
)
14
    : ControlFlowNode(element_id, debug_info), indvar_(indvar), init_(init), update_(update), condition_(condition) {
536✔
15
    this->root_ = std::unique_ptr<Sequence>(new Sequence(++element_id, debug_info));
536✔
16
}
536✔
17

18
void StructuredLoop::validate(const Function& function) const {
140✔
19
    if (this->indvar_.is_null()) {
140✔
20
        throw InvalidSDFGException("StructuredLoop: Induction variable cannot be null");
×
21
    }
×
22
    if (this->init_.is_null()) {
140✔
23
        throw InvalidSDFGException("StructuredLoop: Initialization expression cannot be null");
×
24
    }
×
25
    if (this->update_.is_null()) {
140✔
26
        throw InvalidSDFGException("StructuredLoop: Update expression cannot be null");
×
27
    }
×
28
    if (this->condition_.is_null()) {
140✔
29
        throw InvalidSDFGException("StructuredLoop: Condition expression cannot be null");
×
30
    }
×
31
    if (!SymEngine::is_a_Boolean(*this->condition_)) {
140✔
32
        throw InvalidSDFGException("StructuredLoop: Condition expression must be a boolean expression");
×
33
    }
×
34

35
    this->root_->validate(function);
140✔
36
};
140✔
37

38
const symbolic::Symbol StructuredLoop::indvar() const { return this->indvar_; };
1,290✔
39

40
const symbolic::Expression StructuredLoop::init() const { return this->init_; };
444✔
41

42
const symbolic::Expression StructuredLoop::update() const { return this->update_; };
538✔
43

44
const symbolic::Condition StructuredLoop::condition() const { return this->condition_; };
566✔
45

46
Sequence& StructuredLoop::root() const { return *this->root_; };
1,768✔
47

48
void StructuredLoop::replace(const symbolic::Expression old_expression, const symbolic::Expression new_expression) {
2✔
49
    if (symbolic::eq(this->indvar_, old_expression) && SymEngine::is_a<SymEngine::Symbol>(*new_expression)) {
2✔
50
        this->indvar_ = SymEngine::rcp_static_cast<const SymEngine::Symbol>(new_expression);
×
51
    }
×
52
    this->init_ = symbolic::subs(this->init_, old_expression, new_expression);
2✔
53
    this->update_ = symbolic::subs(this->update_, old_expression, new_expression);
2✔
54
    this->condition_ = symbolic::subs(this->condition_, old_expression, new_expression);
2✔
55

56
    this->root_->replace(old_expression, new_expression);
2✔
57
};
2✔
58

59
} // namespace structured_control_flow
60
} // 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