• 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

34.38
/src/structured_control_flow/return.cpp
1
#include "sdfg/structured_control_flow/return.h"
2

3
#include "sdfg/function.h"
4
#include "sdfg/types/type.h"
5

6
namespace sdfg {
7
namespace structured_control_flow {
8

9
Return::Return(size_t element_id, const DebugInfo& debug_info, const std::string& data)
10
    : ControlFlowNode(element_id, debug_info), data_(data), type_(nullptr) {}
44✔
11

12
Return::Return(size_t element_id, const DebugInfo& debug_info, const std::string& data, const types::IType& type)
13
    : ControlFlowNode(element_id, debug_info), data_(data), type_(type.clone()) {}
×
14

15

16
const std::string& Return::data() const { return data_; }
14✔
17

18
const types::IType& Return::type() const { return *type_; }
2✔
19

20
bool Return::is_data() const { return type_ == nullptr; }
38✔
21

22
bool Return::is_constant() const { return type_ != nullptr; }
3✔
23

24
void Return::validate(const Function& function) const {
27✔
25
    if (is_data()) {
27✔
26
        if (data_ != "" && !function.exists(data_)) {
27✔
27
            throw InvalidSDFGException("Return node with data '" + data_ + "' does not correspond to any container");
×
28
        }
×
29
        if (type_ != nullptr) {
27✔
30
            throw InvalidSDFGException("Return node with data cannot have a type");
×
31
        }
×
32
    } else if (is_constant()) {
27✔
33
        if (function.exists(data_)) {
×
34
            throw InvalidSDFGException(
×
35
                "Return node with constant data '" + data_ + "' cannot correspond to any container"
×
36
            );
×
37
        }
×
38
        if (type_ == nullptr) {
×
39
            throw InvalidSDFGException("Return node with constant data must have a type");
×
40
        }
×
41
    } else {
×
42
        throw InvalidSDFGException("Return node must be either data or constant");
×
43
    }
×
44
};
27✔
45

46
void Return::replace(const symbolic::Expression old_expression, const symbolic::Expression new_expression) {
×
47
    if (is_data() && data_ == old_expression->__str__()) {
×
48
        data_ = new_expression->__str__();
×
49
    }
×
50
};
×
51

52
} // namespace structured_control_flow
53
} // 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