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

daisytuner / sdfglib / 18737129868

22 Oct 2025 07:37PM UTC coverage: 61.468% (-0.3%) from 61.746%
18737129868

push

github

web-flow
Merge pull request #296 from daisytuner/fix-external-prefix

Fixes for building OpenFOAM with DOCC

9 of 19 new or added lines in 6 files covered. (47.37%)

44 existing lines in 4 files now uncovered.

9704 of 15787 relevant lines covered (61.47%)

100.86 hits per line

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

20.0
/src/control_flow/state.cpp
1
#include "sdfg/control_flow/state.h"
2

3
#include "sdfg/sdfg.h"
4

5
namespace sdfg {
6
namespace control_flow {
7

8
State::State(size_t element_id, const DebugInfo& debug_info, const graph::Vertex vertex)
128✔
9
    : Element(element_id, debug_info), vertex_(vertex) {
64✔
10
    this->dataflow_ = std::make_unique<data_flow::DataFlowGraph>();
64✔
11
};
64✔
12

UNCOV
13
void State::validate(const Function& function) const { this->dataflow_->validate(function); };
×
14

15
graph::Vertex State::vertex() const { return this->vertex_; };
127✔
16

17
const data_flow::DataFlowGraph& State::dataflow() const { return *this->dataflow_; };
17✔
18

19
data_flow::DataFlowGraph& State::dataflow() { return *this->dataflow_; };
24✔
20

21
void State::replace(const symbolic::Expression old_expression, const symbolic::Expression new_expression) {
×
22
    this->dataflow_->replace(old_expression, new_expression);
×
23
};
×
24

25
ReturnState::ReturnState(size_t element_id, const DebugInfo& debug_info, const graph::Vertex vertex, const std::string& data)
4✔
26
    : State(element_id, debug_info, vertex), data_(data), unreachable_(false), type_(nullptr) {};
4✔
27

28
ReturnState::ReturnState(size_t element_id, const DebugInfo& debug_info, const graph::Vertex vertex)
×
29
    : State(element_id, debug_info, vertex), data_(""), unreachable_(true), type_(nullptr) {};
×
30

31
ReturnState::ReturnState(
×
32
    size_t element_id,
33
    const DebugInfo& debug_info,
34
    const graph::Vertex vertex,
35
    const std::string& data,
36
    const types::IType& type
37
)
38
    : State(element_id, debug_info, vertex), data_(data), unreachable_(false), type_(type.clone()) {};
×
39

40
const std::string& ReturnState::data() const { return this->data_; };
4✔
41

42
const types::IType& ReturnState::type() const { return *(this->type_); };
×
43

44
bool ReturnState::unreachable() const { return this->unreachable_; };
×
45

46
bool ReturnState::is_data() const { return !this->unreachable_ && type_ == nullptr; };
4✔
47

48
bool ReturnState::is_unreachable() const { return this->unreachable_; };
×
49

50
bool ReturnState::is_constant() const { return !this->unreachable_ && type_ != nullptr; };
×
51

UNCOV
52
void ReturnState::validate(const Function& function) const {
×
UNCOV
53
    State::validate(function);
×
54

UNCOV
55
    auto& sdfg = static_cast<const SDFG&>(function);
×
UNCOV
56
    if (sdfg.out_degree(*this) > 0) {
×
57
        throw InvalidSDFGException("ReturnState must not have outgoing transitions");
×
58
    }
59

UNCOV
60
    if (is_data()) {
×
UNCOV
61
        if (data_ != "" && !function.exists(data_)) {
×
62
            throw InvalidSDFGException("Return node with data '" + data_ + "' does not correspond to any container");
×
63
        }
UNCOV
64
        if (unreachable_) {
×
65
            throw InvalidSDFGException("Return node cannot be both data and unreachable");
×
66
        }
UNCOV
67
        if (type_ != nullptr) {
×
68
            throw InvalidSDFGException("Return node with data cannot have a type");
×
69
        }
UNCOV
70
    } else if (is_constant()) {
×
71
        if (function.exists(data_)) {
×
72
            throw InvalidSDFGException(
×
73
                "Return node with constant data '" + data_ + "' cannot correspond to any container"
×
74
            );
75
        }
76
        if (type_ == nullptr) {
×
77
            throw InvalidSDFGException("Return node with constant data must have a type");
×
78
        }
79
    } else if (is_unreachable()) {
×
80
        if (!data_.empty()) {
×
81
            throw InvalidSDFGException("Unreachable return node cannot have data");
×
82
        }
83
        if (type_ != nullptr) {
×
84
            throw InvalidSDFGException("Unreachable return node cannot have a type");
×
85
        }
86
    } else {
×
87
        throw InvalidSDFGException("Return node must be either data, constant, or unreachable");
×
88
    }
UNCOV
89
}
×
90

91
void ReturnState::replace(const symbolic::Expression old_expression, const symbolic::Expression new_expression) {
×
92
    State::replace(old_expression, new_expression);
×
93

94
    if (this->data_ == old_expression->__str__()) {
×
95
        this->data_ = new_expression->__str__();
×
96
    }
×
97
};
×
98

99
} // namespace control_flow
100
} // 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