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

daisytuner / sdfglib / 20778990491

07 Jan 2026 10:50AM UTC coverage: 61.994% (-0.2%) from 62.168%
20778990491

Pull #438

github

web-flow
Merge af6583671 into 0c34ccd02
Pull Request #438: Cuda tiling

8 of 51 new or added lines in 6 files covered. (15.69%)

2 existing lines in 1 file now uncovered.

14904 of 24041 relevant lines covered (61.99%)

88.13 hits per line

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

53.85
/src/analysis/scope_analysis.cpp
1
#include "sdfg/analysis/scope_analysis.h"
2
#include <vector>
3
#include "sdfg/structured_control_flow/control_flow_node.h"
4

5
namespace sdfg {
6
namespace analysis {
7

8
ScopeAnalysis::ScopeAnalysis(StructuredSDFG& sdfg) : Analysis(sdfg) {}
165✔
9

10
void ScopeAnalysis::
11
    run(structured_control_flow::ControlFlowNode* current, structured_control_flow::ControlFlowNode* parent_scope) {
539✔
12
    if (dynamic_cast<structured_control_flow::Block*>(current)) {
539✔
13
        this->scope_tree_[current] = parent_scope;
227✔
14
    } else if (auto sequence_stmt = dynamic_cast<structured_control_flow::Sequence*>(current)) {
312✔
15
        this->scope_tree_[current] = parent_scope;
242✔
16
        for (size_t i = 0; i < sequence_stmt->size(); i++) {
539✔
17
            this->run(&sequence_stmt->at(i).first, current);
297✔
18
        }
297✔
19
    } else if (auto if_else_stmt = dynamic_cast<structured_control_flow::IfElse*>(current)) {
242✔
20
        this->scope_tree_[current] = parent_scope;
7✔
21
        for (size_t i = 0; i < if_else_stmt->size(); i++) {
21✔
22
            this->run(&if_else_stmt->at(i).first, current);
14✔
23
        }
14✔
24
    } else if (auto while_stmt = dynamic_cast<structured_control_flow::While*>(current)) {
63✔
25
        this->scope_tree_[current] = parent_scope;
×
26
        this->run(&while_stmt->root(), current);
×
27
    } else if (auto for_stmt = dynamic_cast<structured_control_flow::StructuredLoop*>(current)) {
63✔
28
        this->scope_tree_[current] = parent_scope;
63✔
29
        this->run(&for_stmt->root(), current);
63✔
30
    } else if (dynamic_cast<structured_control_flow::Break*>(current)) {
63✔
31
        this->scope_tree_[current] = parent_scope;
×
32
    } else if (dynamic_cast<structured_control_flow::Continue*>(current)) {
×
33
        this->scope_tree_[current] = parent_scope;
×
34
    } else if (dynamic_cast<structured_control_flow::Return*>(current)) {
×
35
        this->scope_tree_[current] = parent_scope;
×
36
    } else {
×
37
        throw std::runtime_error("Unsupported control flow node type");
×
38
    }
×
39
}
539✔
40

41
void ScopeAnalysis::run(AnalysisManager& analysis_manager) {
165✔
42
    this->scope_tree_.clear();
165✔
43
    this->run(&this->sdfg_.root(), nullptr);
165✔
44
}
165✔
45

46
const std::unordered_map<const structured_control_flow::ControlFlowNode*, structured_control_flow::ControlFlowNode*>&
47
ScopeAnalysis::scope_tree() const {
×
48
    return this->scope_tree_;
×
49
}
×
50

51
structured_control_flow::ControlFlowNode* ScopeAnalysis::parent_scope(const structured_control_flow::ControlFlowNode*
52
                                                                          scope) const {
176✔
53
    if (this->scope_tree_.find(scope) == this->scope_tree_.end()) {
176✔
54
        return nullptr;
×
55
    }
×
56
    return this->scope_tree_.at(scope);
176✔
57
}
176✔
58

59
std::vector<structured_control_flow::ControlFlowNode*> ScopeAnalysis::
NEW
60
    ancestor_scopes(const structured_control_flow::ControlFlowNode* node) const {
×
NEW
61
    std::vector<structured_control_flow::ControlFlowNode*> result;
×
NEW
62
    auto parent = parent_scope(node);
×
63

NEW
64
    while (parent) {
×
NEW
65
        result.push_back(parent);
×
NEW
66
        parent = parent_scope(parent);
×
NEW
67
    }
×
68

NEW
69
    return result;
×
NEW
70
}
×
71

72
} // namespace analysis
73
} // 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