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

daisytuner / sdfglib / 17651658650

11 Sep 2025 04:58PM UTC coverage: 61.012% (+1.3%) from 59.755%
17651658650

Pull #219

github

web-flow
Merge 742a12367 into f744ac9f5
Pull Request #219: stdlib Library Nodes and ConstantNodes

499 of 1681 new or added lines in 81 files covered. (29.68%)

95 existing lines in 36 files now uncovered.

9718 of 15928 relevant lines covered (61.01%)

108.0 hits per line

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

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

3
namespace sdfg {
4
namespace stdlib {
5

NEW
6
FprintfNode::FprintfNode(
×
7
    size_t element_id,
8
    const DebugInfoRegion& debug_info,
9
    const graph::Vertex vertex,
10
    data_flow::DataFlowGraph& parent,
11
    const std::vector<std::string>& args
12
)
NEW
13
    : LibraryNode(
×
NEW
14
          element_id,
×
NEW
15
          debug_info,
×
NEW
16
          vertex,
×
NEW
17
          parent,
×
18
          LibraryNodeType_Fprintf,
NEW
19
          {"_ret", "_stream"},
×
NEW
20
          {"_stream", "_format"},
×
21
          true,
22
          data_flow::ImplementationType_NONE
23
      ),
NEW
24
      args_(args) {
×
NEW
25
    for (auto& arg : args) {
×
NEW
26
        inputs_.push_back(arg);
×
27
    }
NEW
28
}
×
29

NEW
30
void FprintfNode::validate(const Function& function) const {}
×
31

NEW
32
symbolic::SymbolSet FprintfNode::symbols() const { return {}; }
×
33

34
std::unique_ptr<data_flow::DataFlowNode> FprintfNode::
NEW
35
    clone(size_t element_id, const graph::Vertex vertex, data_flow::DataFlowGraph& parent) const {
×
NEW
36
    return std::make_unique<FprintfNode>(element_id, debug_info_, vertex, parent, this->args_);
×
37
}
38

NEW
39
void FprintfNode::replace(const symbolic::Expression& old_expression, const symbolic::Expression& new_expression) {}
×
40

NEW
41
nlohmann::json FprintfNodeSerializer::serialize(const data_flow::LibraryNode& library_node) {
×
NEW
42
    const FprintfNode& node = static_cast<const FprintfNode&>(library_node);
×
43

NEW
44
    nlohmann::json j;
×
NEW
45
    j["code"] = node.code().value();
×
NEW
46
    j["args"] = node.args();
×
47

NEW
48
    return j;
×
NEW
49
}
×
50

NEW
51
data_flow::LibraryNode& FprintfNodeSerializer::deserialize(
×
52
    const nlohmann::json& j, builder::StructuredSDFGBuilder& builder, structured_control_flow::Block& parent
53
) {
NEW
54
    assert(j.contains("code"));
×
NEW
55
    assert(j.contains("debug_info"));
×
NEW
56
    assert(j.contains("args"));
×
57

NEW
58
    auto code = j["code"].get<std::string>();
×
NEW
59
    if (code != LibraryNodeType_Fprintf.value()) {
×
NEW
60
        throw InvalidSDFGException("Invalid library node code");
×
61
    }
62

NEW
63
    sdfg::serializer::JSONSerializer serializer;
×
NEW
64
    DebugInfoRegion debug_info = serializer.json_to_debug_info_region(j["debug_info"], builder.debug_info());
×
65

NEW
66
    std::vector<std::string> args = j["args"].get<std::vector<std::string>>();
×
67

NEW
68
    return builder.add_library_node<FprintfNode>(parent, debug_info, args);
×
NEW
69
}
×
70

NEW
71
FprintfNodeDispatcher::FprintfNodeDispatcher(
×
72
    codegen::LanguageExtension& language_extension,
73
    const Function& function,
74
    const data_flow::DataFlowGraph& data_flow_graph,
75
    const FprintfNode& node
76
)
NEW
77
    : codegen::LibraryNodeDispatcher(language_extension, function, data_flow_graph, node) {}
×
78

NEW
79
void FprintfNodeDispatcher::dispatch_code(
×
80
    codegen::PrettyPrinter& stream,
81
    codegen::PrettyPrinter& globals_stream,
82
    codegen::CodeSnippetFactory& library_snippet_factory
83
) {
NEW
84
    auto& fprintf_node = static_cast<const FprintfNode&>(node_);
×
85

NEW
86
    stream << fprintf_node.outputs().at(0);
×
NEW
87
    stream << " = ";
×
NEW
88
    stream << "fprintf(";
×
NEW
89
    for (size_t i = 0; i < fprintf_node.inputs().size(); ++i) {
×
NEW
90
        stream << fprintf_node.inputs().at(i);
×
NEW
91
        if (i < fprintf_node.inputs().size() - 1) {
×
NEW
92
            stream << ", ";
×
NEW
93
        }
×
NEW
94
    }
×
NEW
95
    stream << ");";
×
NEW
96
    stream << std::endl;
×
NEW
97
}
×
98

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