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

daisytuner / sdfglib / 15044057891

15 May 2025 11:42AM UTC coverage: 59.37% (+1.8%) from 57.525%
15044057891

push

github

web-flow
Merge pull request #14 from daisytuner/sanitizers

enables sanitizer on unit tests

63 of 67 new or added lines in 47 files covered. (94.03%)

570 existing lines in 62 files now uncovered.

7356 of 12390 relevant lines covered (59.37%)

505.93 hits per line

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

85.29
/src/codegen/dispatchers/node_dispatcher.cpp
1
#include "sdfg/codegen/dispatchers/node_dispatcher.h"
2

3
namespace sdfg {
4
namespace codegen {
5

6
NodeDispatcher::NodeDispatcher(LanguageExtension& language_extension, Schedule& schedule,
48✔
7
                               structured_control_flow::ControlFlowNode& node, bool instrumented)
8
    : language_extension_(language_extension),
48✔
9
      schedule_(schedule),
48✔
10
      node_(node),
48✔
11
      instrumented_(instrumented){};
96✔
12

13
bool NodeDispatcher::begin_node(PrettyPrinter& stream) {
27✔
14
    auto& sdfg = schedule_.sdfg();
27✔
15

16
    // Declare the transient variables
17
    bool applied = false;
27✔
18
    for (auto& container : sdfg.containers()) {
43✔
19
        if (!sdfg.is_transient(container)) {
16✔
20
            continue;
3✔
21
        }
22

23
        if (schedule_.allocation_lifetime(container) == &node_) {
13✔
24
            if (!applied) {
2✔
25
                applied = true;
2✔
26
                stream << "{" << std::endl;
2✔
27
                stream.setIndent(stream.indent() + 4);
2✔
28
            }
2✔
29
            if (schedule_.allocation_type(container) == AllocationType::DECLARE) {
2✔
30
                std::string val =
31
                    this->language_extension_.declaration(container, sdfg.type(container));
1✔
32
                if (!val.empty()) {
1✔
33
                    stream << val;
1✔
34
                    stream << ";" << std::endl;
1✔
35
                }
1✔
36
            } else {
1✔
37
                std::string val =
38
                    this->language_extension_.allocation(container, sdfg.type(container));
1✔
39
                if (!val.empty()) {
1✔
40
                    stream << val;
1✔
41
                    stream << ";" << std::endl;
1✔
42
                }
1✔
43
            }
1✔
44
        }
2✔
45
    }
46

47
    return applied;
27✔
UNCOV
48
};
×
49

50
void NodeDispatcher::end_node(PrettyPrinter& stream, bool applied) {
27✔
51
    auto& sdfg = schedule_.sdfg();
27✔
52

53
    if (applied) {
27✔
54
        for (auto& container : sdfg.containers()) {
4✔
55
            if (!sdfg.is_transient(container)) {
2✔
56
                continue;
×
57
            }
58
            if (schedule_.allocation_lifetime(container) == &node_) {
2✔
59
                if (schedule_.allocation_type(container) == AllocationType::ALLOCATE) {
2✔
60
                    auto& type = sdfg.type(container);
1✔
61
                    std::string val = this->language_extension_.deallocation(container, type);
1✔
62
                    if (!val.empty()) {
1✔
63
                        stream << val;
1✔
64
                        stream << ";" << std::endl;
1✔
65
                    }
1✔
66
                }
1✔
67
            }
2✔
68
        }
69

70
        stream.setIndent(stream.indent() - 4);
2✔
71
        stream << "}" << std::endl;
2✔
72
    }
2✔
73
};
27✔
74

75
void NodeDispatcher::begin_instrumentation(PrettyPrinter& stream){
×
76

77
};
×
78

79
void NodeDispatcher::end_instrumentation(PrettyPrinter& stream){
×
80

81
};
×
82

83
void NodeDispatcher::dispatch(PrettyPrinter& main_stream, PrettyPrinter& globals_stream,
27✔
84
                              PrettyPrinter& library_stream) {
85
    bool applied = begin_node(main_stream);
27✔
86

87
    if (instrumented_) {
27✔
88
        this->begin_instrumentation(main_stream);
×
UNCOV
89
    }
×
90

91
    dispatch_node(main_stream, globals_stream, library_stream);
27✔
92

93
    if (instrumented_) {
27✔
94
        this->end_instrumentation(main_stream);
×
UNCOV
95
    }
×
96

97
    end_node(main_stream, applied);
27✔
98
};
27✔
99

100
}  // namespace codegen
101
}  // 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