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

daisytuner / sdfglib / 17576881200

09 Sep 2025 08:38AM UTC coverage: 61.126% (+2.0%) from 59.145%
17576881200

Pull #219

github

web-flow
Merge 51d6d85aa into b8fdeb232
Pull Request #219: stdlib Library Nodes and ConstantNodes

424 of 1350 new or added lines in 74 files covered. (31.41%)

90 existing lines in 32 files now uncovered.

9307 of 15226 relevant lines covered (61.13%)

109.07 hits per line

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

0.0
/src/data_flow/library_nodes/stdlib/free.cpp
1
#include "sdfg/data_flow/library_nodes/stdlib/free.h"
2

3
namespace sdfg {
4
namespace stdlib {
5

NEW
6
FreeNode::FreeNode(
×
7
    size_t element_id, const DebugInfo& debug_info, const graph::Vertex vertex, data_flow::DataFlowGraph& parent
8
)
NEW
9
    : LibraryNode(
×
NEW
10
          element_id,
×
NEW
11
          debug_info,
×
NEW
12
          vertex,
×
NEW
13
          parent,
×
14
          LibraryNodeType_Free,
NEW
15
          {"_ptr"},
×
NEW
16
          {"_ptr"},
×
17
          true,
18
          data_flow::ImplementationType_NONE
NEW
19
      ) {}
×
20

21

NEW
22
void FreeNode::validate(const Function& function) const {}
×
23

NEW
24
symbolic::SymbolSet FreeNode::symbols() const { return {}; }
×
25

26
std::unique_ptr<data_flow::DataFlowNode> FreeNode::
NEW
27
    clone(size_t element_id, const graph::Vertex vertex, data_flow::DataFlowGraph& parent) const {
×
NEW
28
    return std::make_unique<FreeNode>(element_id, debug_info_, vertex, parent);
×
29
}
30

NEW
31
void FreeNode::replace(const symbolic::Expression& old_expression, const symbolic::Expression& new_expression) {
×
32
    // Do nothing
NEW
33
    return;
×
34
}
35

NEW
36
nlohmann::json FreeNodeSerializer::serialize(const data_flow::LibraryNode& library_node) {
×
NEW
37
    const FreeNode& node = static_cast<const FreeNode&>(library_node);
×
38

NEW
39
    nlohmann::json j;
×
NEW
40
    j["code"] = node.code().value();
×
41

NEW
42
    return j;
×
NEW
43
}
×
44

NEW
45
data_flow::LibraryNode& FreeNodeSerializer::deserialize(
×
46
    const nlohmann::json& j, builder::StructuredSDFGBuilder& builder, structured_control_flow::Block& parent
47
) {
NEW
48
    assert(j.contains("code"));
×
NEW
49
    assert(j.contains("debug_info"));
×
50

NEW
51
    auto code = j["code"].get<std::string>();
×
NEW
52
    if (code != LibraryNodeType_Free.value()) {
×
NEW
53
        throw InvalidSDFGException("Invalid library node code");
×
54
    }
55

NEW
56
    sdfg::serializer::JSONSerializer serializer;
×
NEW
57
    DebugInfo debug_info = serializer.json_to_debug_info(j["debug_info"]);
×
58

NEW
59
    return builder.add_library_node<FreeNode>(parent, debug_info);
×
NEW
60
}
×
61

NEW
62
FreeNodeDispatcher::FreeNodeDispatcher(
×
63
    codegen::LanguageExtension& language_extension,
64
    const Function& function,
65
    const data_flow::DataFlowGraph& data_flow_graph,
66
    const FreeNode& node
67
)
NEW
68
    : codegen::LibraryNodeDispatcher(language_extension, function, data_flow_graph, node) {}
×
69

NEW
70
void FreeNodeDispatcher::dispatch_code(
×
71
    codegen::PrettyPrinter& stream,
72
    codegen::PrettyPrinter& globals_stream,
73
    codegen::CodeSnippetFactory& library_snippet_factory
74
) {
NEW
75
    auto& free_node = static_cast<const FreeNode&>(node_);
×
76

NEW
77
    stream << "free(" << free_node.inputs().at(0) << ");" << std::endl;
×
NEW
78
}
×
79

80
} // namespace stdlib
81
} // 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