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

daisytuner / sdfglib / 17653942017

11 Sep 2025 06:34PM UTC coverage: 59.145% (-0.6%) from 59.755%
17653942017

push

github

web-flow
Merge pull request #224 from daisytuner/revert-210-NewDebugInfo

Revert "New debug info"

313 of 466 new or added lines in 44 files covered. (67.17%)

21 existing lines in 4 files now uncovered.

9274 of 15680 relevant lines covered (59.15%)

115.92 hits per line

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

70.97
/src/structured_control_flow/sequence.cpp
1
#include "sdfg/structured_control_flow/sequence.h"
2

3
namespace sdfg {
4
namespace structured_control_flow {
5

NEW
6
Transition::Transition(size_t element_id, const DebugInfo& debug_info, Sequence& parent)
×
7
    : Element(element_id, debug_info), parent_(&parent) {
×
8

9
      };
×
10

11
Transition::Transition(
888✔
12
    size_t element_id, const DebugInfo& debug_info, Sequence& parent, const control_flow::Assignments& assignments
13
)
14
    : Element(element_id, debug_info), parent_(&parent), assignments_(assignments) {
888✔
15

16
      };
888✔
17

18
void Transition::validate(const Function& function) const {
852✔
19
    // TODO: Implement validation
20
};
852✔
21

22
const control_flow::Assignments& Transition::assignments() const { return this->assignments_; };
23✔
23

24
control_flow::Assignments& Transition::assignments() { return this->assignments_; };
1,380✔
25

26
Sequence& Transition::parent() { return *this->parent_; };
×
27

28
const Sequence& Transition::parent() const { return *this->parent_; };
×
29

30
bool Transition::empty() const { return this->assignments_.empty(); };
21✔
31

32
size_t Transition::size() const { return this->assignments_.size(); };
45✔
33

34
void Transition::replace(const symbolic::Expression& old_expression, const symbolic::Expression& new_expression) {
2✔
35
    if (SymEngine::is_a<SymEngine::Symbol>(*old_expression) && SymEngine::is_a<SymEngine::Symbol>(*new_expression)) {
2✔
36
        auto old_symbol = SymEngine::rcp_static_cast<const SymEngine::Symbol>(old_expression);
2✔
37
        auto new_symbol = SymEngine::rcp_static_cast<const SymEngine::Symbol>(new_expression);
2✔
38

39
        if (this->assignments().find(old_symbol) != this->assignments().end()) {
2✔
40
            this->assignments()[new_symbol] = this->assignments()[old_symbol];
×
41
            this->assignments().erase(old_symbol);
×
42
        }
×
43
    }
2✔
44

45
    for (auto& entry : this->assignments()) {
2✔
46
        entry.second = symbolic::subs(entry.second, old_expression, new_expression);
×
47
    }
48
};
2✔
49

50
Sequence::Sequence(size_t element_id, const DebugInfo& debug_info)
1,724✔
51
    : ControlFlowNode(element_id, debug_info) {
862✔
52

53
      };
862✔
54

55
void Sequence::validate(const Function& function) const {
732✔
56
    // children and transition have same length
57
    if (this->children_.size() != this->transitions_.size()) {
732✔
58
        throw InvalidSDFGException("Sequence must have the same number of children and transitions");
×
59
    }
60

61
    for (auto& child : this->children_) {
1,584✔
62
        child->validate(function);
852✔
63
    }
64
    for (auto& trans : this->transitions_) {
1,584✔
65
        trans->validate(function);
852✔
66
    }
67
};
732✔
68

69
size_t Sequence::size() const { return this->children_.size(); };
9,586✔
70

71
std::pair<const ControlFlowNode&, const Transition&> Sequence::at(size_t i) const {
255✔
72
    return {*this->children_.at(i), *this->transitions_.at(i)};
255✔
73
};
74

75
std::pair<ControlFlowNode&, Transition&> Sequence::at(size_t i) {
5,493✔
76
    return {*this->children_.at(i), *this->transitions_.at(i)};
5,493✔
77
};
78

79
int Sequence::index(const ControlFlowNode& child) const {
85✔
80
    for (size_t i = 0; i < this->children_.size(); i++) {
91✔
81
        if (this->children_.at(i).get() == &child) {
91✔
82
            return static_cast<int>(i);
85✔
83
        }
84
    }
6✔
85

86
    return -1;
×
87
};
85✔
88

89
int Sequence::index(const Transition& transition) const {
×
90
    for (size_t i = 0; i < this->transitions_.size(); i++) {
×
91
        if (this->transitions_.at(i).get() == &transition) {
×
92
            return static_cast<int>(i);
×
93
        }
94
    }
×
95

96
    return -1;
×
97
};
×
98

99
void Sequence::replace(const symbolic::Expression& old_expression, const symbolic::Expression& new_expression) {
2✔
100
    for (auto& child : this->children_) {
4✔
101
        child->replace(old_expression, new_expression);
2✔
102
    }
103

104
    for (auto& trans : this->transitions_) {
4✔
105
        trans->replace(old_expression, new_expression);
2✔
106
    }
107
};
2✔
108

109
} // namespace structured_control_flow
110
} // 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