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

daisytuner / sdfglib / 17637380013

11 Sep 2025 07:29AM UTC coverage: 59.755% (+0.6%) from 59.145%
17637380013

push

github

web-flow
New debug info (#210)

* initial draft

* update data structure and construction logic

* finalize DebugInfo draft

* fix tests

* Update serializer and fix tests

* fix append bug

* update data structure

* sdfg builder update

* const ref vectors

* update implementation and partial tests

* compiling state

* update serializer interface

* update dot test

* reset interface to debug_info in json to maintain compatibility with tools

* first review batch

* second batch of changes

* merge fixes

777 of 1111 new or added lines in 46 files covered. (69.94%)

11 existing lines in 11 files now uncovered.

9755 of 16325 relevant lines covered (59.75%)

115.06 hits per line

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

50.0
/src/passes/debug_info_propagation.cpp
1
#include "sdfg/passes/debug_info_propagation.h"
2
#include "sdfg/debug_info.h"
3

4
namespace sdfg {
5
namespace passes {
6

7
DebugTablePropagation::DebugTablePropagation() : Pass() {}
2✔
8

9
void DebugTablePropagation::
10
    propagate(builder::StructuredSDFGBuilder& builder, structured_control_flow::ControlFlowNode* current) {
4✔
11
    auto current_debug_info = current->debug_info();
4✔
12

13
    if (auto block = dynamic_cast<structured_control_flow::Block*>(current)) {
4✔
14
        auto& graph = block->dataflow();
2✔
15
        for (auto& node : graph.nodes()) {
8✔
16
            current_debug_info =
6✔
17
                DebugInfoRegion::merge(current_debug_info, node.debug_info(), builder.subject().debug_info().elements());
6✔
18
        }
19
        for (auto& edge : graph.edges()) {
6✔
20
            current_debug_info =
4✔
21
                DebugInfoRegion::merge(current_debug_info, edge.debug_info(), builder.subject().debug_info().elements());
4✔
22
        }
23
    } else if (auto sequence_stmt = dynamic_cast<structured_control_flow::Sequence*>(current)) {
4✔
24
        for (size_t i = 0; i < sequence_stmt->size(); i++) {
4✔
25
            this->propagate(builder, &sequence_stmt->at(i).first);
2✔
26
            current_debug_info = DebugInfoRegion::merge(
2✔
27
                current_debug_info, sequence_stmt->at(i).first.debug_info(), builder.subject().debug_info().elements()
2✔
28
            );
29
            current_debug_info = DebugInfoRegion::merge(
2✔
30
                current_debug_info, sequence_stmt->at(i).second.debug_info(), builder.subject().debug_info().elements()
2✔
31
            );
32
        }
2✔
33
    } else if (auto if_else_stmt = dynamic_cast<structured_control_flow::IfElse*>(current)) {
2✔
34
        for (size_t i = 0; i < if_else_stmt->size(); i++) {
×
NEW
35
            this->propagate(builder, &if_else_stmt->at(i).first);
×
NEW
36
            current_debug_info = DebugInfoRegion::merge(
×
NEW
37
                current_debug_info, if_else_stmt->at(i).first.debug_info(), builder.subject().debug_info().elements()
×
38
            );
39
        }
×
40
    } else if (auto while_stmt = dynamic_cast<structured_control_flow::While*>(current)) {
×
NEW
41
        this->propagate(builder, &while_stmt->root());
×
NEW
42
        current_debug_info = DebugInfoRegion::
×
NEW
43
            merge(current_debug_info, while_stmt->root().debug_info(), builder.subject().debug_info().elements());
×
44
    } else if (auto loop_stmt = dynamic_cast<structured_control_flow::StructuredLoop*>(current)) {
×
NEW
45
        this->propagate(builder, &loop_stmt->root());
×
NEW
46
        current_debug_info = DebugInfoRegion::
×
NEW
47
            merge(current_debug_info, loop_stmt->root().debug_info(), builder.subject().debug_info().elements());
×
48
    } else if (auto break_stmt = dynamic_cast<structured_control_flow::Break*>(current)) {
×
NEW
49
        current_debug_info = DebugInfoRegion::
×
NEW
50
            merge(current_debug_info, break_stmt->debug_info(), builder.subject().debug_info().elements());
×
51
    } else if (auto continue_stmt = dynamic_cast<structured_control_flow::Continue*>(current)) {
×
NEW
52
        current_debug_info = DebugInfoRegion::
×
NEW
53
            merge(current_debug_info, continue_stmt->debug_info(), builder.subject().debug_info().elements());
×
54
    } else if (auto return_stmt = dynamic_cast<structured_control_flow::Return*>(current)) {
×
NEW
55
        current_debug_info = DebugInfoRegion::
×
NEW
56
            merge(current_debug_info, return_stmt->debug_info(), builder.subject().debug_info().elements());
×
57
    } else {
×
58
        throw InvalidSDFGException("Unsupported control flow node type");
×
59
    }
60

61
    current->set_debug_info(current_debug_info);
4✔
62
}
4✔
63

64
bool DebugTablePropagation::run_pass(builder::StructuredSDFGBuilder& builder, analysis::AnalysisManager& analysis_manager) {
2✔
65
    this->propagate(builder, &builder.subject().root());
2✔
66
    return true;
2✔
67
}
68

NEW
69
std::string DebugTablePropagation::name() { return "DebugTablePropagation"; }
×
70

71
} // namespace passes
72
} // 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