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

daisytuner / sdfglib / 17656823807

11 Sep 2025 08:42PM UTC coverage: 60.447% (+1.1%) from 59.335%
17656823807

Pull #219

github

web-flow
Merge d5416236f into 6c1992b40
Pull Request #219: stdlib Library Nodes and ConstantNodes

460 of 1635 new or added lines in 81 files covered. (28.13%)

93 existing lines in 35 files now uncovered.

9385 of 15526 relevant lines covered (60.45%)

107.21 hits per line

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

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

3
namespace sdfg {
4
namespace stdlib {
5

NEW
6
FputcNode::FputcNode(
×
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_Fputc,
NEW
15
          {"_ret", "_stream"},
×
NEW
16
          {"_character", "_stream"},
×
17
          true,
18
          data_flow::ImplementationType_NONE
NEW
19
      ) {}
×
20

NEW
21
void FputcNode::validate(const Function& function) const {}
×
22

NEW
23
symbolic::SymbolSet FputcNode::symbols() const { return {}; }
×
24

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

NEW
30
void FputcNode::replace(const symbolic::Expression& old_expression, const symbolic::Expression& new_expression) {}
×
31

NEW
32
nlohmann::json FputcNodeSerializer::serialize(const data_flow::LibraryNode& library_node) {
×
NEW
33
    const FputcNode& node = static_cast<const FputcNode&>(library_node);
×
34

NEW
35
    nlohmann::json j;
×
NEW
36
    j["code"] = node.code().value();
×
37

NEW
38
    return j;
×
NEW
39
}
×
40

NEW
41
data_flow::LibraryNode& FputcNodeSerializer::deserialize(
×
42
    const nlohmann::json& j, builder::StructuredSDFGBuilder& builder, structured_control_flow::Block& parent
43
) {
NEW
44
    assert(j.contains("code"));
×
NEW
45
    assert(j.contains("debug_info"));
×
46

NEW
47
    auto code = j["code"].get<std::string>();
×
NEW
48
    if (code != LibraryNodeType_Fputc.value()) {
×
NEW
49
        throw InvalidSDFGException("Invalid library node code");
×
50
    }
51

NEW
52
    sdfg::serializer::JSONSerializer serializer;
×
NEW
53
    DebugInfo debug_info = serializer.json_to_debug_info(j["debug_info"]);
×
54

NEW
55
    return builder.add_library_node<FputcNode>(parent, debug_info);
×
NEW
56
}
×
57

NEW
58
FputcNodeDispatcher::FputcNodeDispatcher(
×
59
    codegen::LanguageExtension& language_extension,
60
    const Function& function,
61
    const data_flow::DataFlowGraph& data_flow_graph,
62
    const FputcNode& node
63
)
NEW
64
    : codegen::LibraryNodeDispatcher(language_extension, function, data_flow_graph, node) {}
×
65

NEW
66
void FputcNodeDispatcher::dispatch_code(
×
67
    codegen::PrettyPrinter& stream,
68
    codegen::PrettyPrinter& globals_stream,
69
    codegen::CodeSnippetFactory& library_snippet_factory
70
) {
NEW
71
    auto& fputc_node = static_cast<const FputcNode&>(node_);
×
72

NEW
73
    stream << fputc_node.outputs().at(0);
×
NEW
74
    stream << " = ";
×
NEW
75
    stream << "fputc(";
×
NEW
76
    stream << fputc_node.inputs().at(0) << ", ";
×
NEW
77
    stream << fputc_node.inputs().at(1) << ");";
×
NEW
78
    stream << std::endl;
×
NEW
79
}
×
80

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

© 2025 Coveralls, Inc