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

daisytuner / sdfglib / 17697650771

13 Sep 2025 02:09PM UTC coverage: 60.533% (+1.2%) from 59.335%
17697650771

Pull #219

github

web-flow
Merge 0edf508a7 into 6c1992b40
Pull Request #219: stdlib Library Nodes and ConstantNodes

563 of 1790 new or added lines in 102 files covered. (31.45%)

102 existing lines in 38 files now uncovered.

9442 of 15598 relevant lines covered (60.53%)

107.06 hits per line

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

77.42
/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(
444✔
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) {
222✔
15
    this->root_ = std::unique_ptr<Sequence>(new Sequence(++element_id, debug_info));
222✔
16
}
222✔
17

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

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

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

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

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

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

46
Sequence& StructuredLoop::root() const { return *this->root_; };
3,018✔
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