• 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.12
/src/data_flow/access_node.cpp
1
#include "sdfg/data_flow/access_node.h"
2

3
#include "sdfg/data_flow/data_flow_graph.h"
4
#include "sdfg/function.h"
5

6
namespace sdfg {
7
namespace data_flow {
8

9
AccessNode::AccessNode(
10
    size_t element_id,
11
    const DebugInfo& debug_info,
12
    const graph::Vertex vertex,
13
    DataFlowGraph& parent,
14
    const std::string& data
15
)
16
    : DataFlowNode(element_id, debug_info, vertex, parent), data_(data) {
1,938✔
17

18
      };
1,938✔
19

20
void AccessNode::validate(const Function& function) const {
783✔
21
    if (!function.exists(this->data_)) {
783✔
22
        throw InvalidSDFGException("Access node " + this->data_ + " uses non-existent variable");
×
23
    }
×
24

25
    auto& graph = this->get_parent();
783✔
26

27
    if (graph.out_degree(*this) > 1) {
783✔
28
        MemletType type = (*graph.out_edges(*this).begin()).type();
6✔
29
        for (auto& oedge : graph.out_edges(*this)) {
12✔
30
            if (oedge.type() != type) {
12✔
31
                throw InvalidSDFGException("Access node " + this->data() + " used with multiple memlet types");
×
32
            }
×
33
        }
12✔
34
    }
6✔
35

36
    if (graph.in_degree(*this) > 1) {
783✔
37
        MemletType type = (*graph.in_edges(*this).begin()).type();
×
38
        for (auto& iedge : graph.in_edges(*this)) {
×
39
            if (iedge.type() != type) {
×
40
                throw InvalidSDFGException("Access node " + this->data() + " used with multiple memlet types");
×
41
            }
×
42
        }
×
43
    }
×
44
}
783✔
45

46
const std::string& AccessNode::data() const { return this->data_; };
4,392✔
47

48
void AccessNode::data(const std::string data) { this->data_ = data; };
21✔
49

50
std::unique_ptr<DataFlowNode> AccessNode::clone(size_t element_id, const graph::Vertex vertex, DataFlowGraph& parent)
51
    const {
×
52
    return std::unique_ptr<AccessNode>(new AccessNode(element_id, this->debug_info_, vertex, parent, this->data_));
×
53
};
×
54

55
void AccessNode::replace(const symbolic::Expression old_expression, const symbolic::Expression new_expression) {
8✔
56
    if (SymEngine::is_a<SymEngine::Symbol>(*old_expression) && SymEngine::is_a<SymEngine::Symbol>(*new_expression)) {
8✔
57
        auto old_symbol = SymEngine::rcp_static_cast<const SymEngine::Symbol>(old_expression);
8✔
58
        if (this->data_ == old_symbol->get_name()) {
8✔
59
            auto new_symbol = SymEngine::rcp_static_cast<const SymEngine::Symbol>(new_expression);
6✔
60
            this->data_ = new_symbol->get_name();
6✔
61
        }
6✔
62
    }
8✔
63
};
8✔
64

65
ConstantNode::ConstantNode(
66
    size_t element_id,
67
    const DebugInfo& debug_info,
68
    const graph::Vertex vertex,
69
    DataFlowGraph& parent,
70
    const std::string& data,
71
    const types::IType& type
72
)
73
    : AccessNode(element_id, debug_info, vertex, parent, data), type_(type.clone()) {};
151✔
74

75
void ConstantNode::validate(const Function& function) const {
103✔
76
    if (function.exists(this->data_)) {
103✔
77
        throw InvalidSDFGException("ConstantNode " + this->data_ + " uses variable");
×
78
    }
×
79

80
    auto& graph = this->get_parent();
103✔
81
    if (graph.in_degree(*this) > 0) {
103✔
82
        throw InvalidSDFGException("ConstantNode " + this->data_ + " has incoming edges");
×
83
    }
×
84

85
    switch (this->type_->type_id()) {
103✔
86
        case types::TypeID::Scalar: {
101✔
87
            auto& scalar_type = static_cast<const types::Scalar&>(*this->type_);
101✔
88
            switch (scalar_type.primitive_type()) {
101✔
89
                case types::PrimitiveType::Bool:
×
90
                case types::PrimitiveType::Int8:
×
91
                case types::PrimitiveType::Int16:
×
92
                case types::PrimitiveType::Int32:
43✔
93
                case types::PrimitiveType::Int64:
46✔
94
                case types::PrimitiveType::UInt8:
46✔
95
                case types::PrimitiveType::UInt16:
46✔
96
                case types::PrimitiveType::UInt32:
60✔
97
                case types::PrimitiveType::UInt64: {
60✔
98
                    if (this->data() == "true") {
60✔
99
                        break;
×
100
                    } else if (this->data() == "false") {
60✔
101
                        break;
×
102
                    }
×
103

104
                    try {
60✔
105
                        helpers::parse_number_signed(this->data());
60✔
106
                    } catch (const std::exception& e) {
60✔
107
                        throw InvalidSDFGException("ConstantNode " + this->data() + " has non-integer scalar type");
×
108
                    }
×
109
                    break;
60✔
110
                }
60✔
111
                default:
41✔
112
                    break;
41✔
113
            }
101✔
114
            break;
101✔
115
        }
101✔
116
        default:
101✔
117
            break;
2✔
118
    }
103✔
119
}
103✔
120

121
const types::IType& ConstantNode::type() const { return *this->type_; };
118✔
122

123
std::unique_ptr<DataFlowNode> ConstantNode::clone(size_t element_id, const graph::Vertex vertex, DataFlowGraph& parent)
124
    const {
×
125
    return std::unique_ptr<
×
126
        ConstantNode>(new ConstantNode(element_id, this->debug_info_, vertex, parent, this->data(), *this->type_));
×
127
};
×
128

129
} // namespace data_flow
130
} // 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