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

daisytuner / sdfglib / 18558780296

16 Oct 2025 10:49AM UTC coverage: 61.233% (-0.3%) from 61.523%
18558780296

push

github

web-flow
Merge pull request #279 from daisytuner/ext-prefix

Separate Dominance Analysis and Codegen for Linker with Prefixes

62 of 95 new or added lines in 26 files covered. (65.26%)

13 existing lines in 7 files now uncovered.

8981 of 14667 relevant lines covered (61.23%)

98.73 hits per line

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

70.0
/src/analysis/scope_analysis.cpp
1
#include "sdfg/analysis/scope_analysis.h"
2

3
namespace sdfg {
4
namespace analysis {
5

6
ScopeAnalysis::ScopeAnalysis(StructuredSDFG& sdfg) : Analysis(sdfg) {}
754✔
7

8
void ScopeAnalysis::
9
    run(structured_control_flow::ControlFlowNode* current, structured_control_flow::ControlFlowNode* parent_scope) {
6,706✔
10
    if (dynamic_cast<structured_control_flow::Block*>(current)) {
6,706✔
11
        this->scope_tree_[current] = parent_scope;
1,844✔
12
    } else if (auto sequence_stmt = dynamic_cast<structured_control_flow::Sequence*>(current)) {
6,706✔
13
        this->scope_tree_[current] = parent_scope;
2,820✔
14
        for (size_t i = 0; i < sequence_stmt->size(); i++) {
6,708✔
15
            this->run(&sequence_stmt->at(i).first, current);
3,888✔
16
        }
3,888✔
17
    } else if (auto if_else_stmt = dynamic_cast<structured_control_flow::IfElse*>(current)) {
4,862✔
18
        this->scope_tree_[current] = parent_scope;
28✔
19
        for (size_t i = 0; i < if_else_stmt->size(); i++) {
78✔
20
            this->run(&if_else_stmt->at(i).first, current);
50✔
21
        }
50✔
22
    } else if (auto while_stmt = dynamic_cast<structured_control_flow::While*>(current)) {
2,042✔
UNCOV
23
        this->scope_tree_[current] = parent_scope;
×
UNCOV
24
        this->run(&while_stmt->root(), current);
×
25
    } else if (auto for_stmt = dynamic_cast<structured_control_flow::StructuredLoop*>(current)) {
2,014✔
26
        this->scope_tree_[current] = parent_scope;
2,014✔
27
        this->run(&for_stmt->root(), current);
2,014✔
28
    } else if (dynamic_cast<structured_control_flow::Break*>(current)) {
2,014✔
29
        this->scope_tree_[current] = parent_scope;
×
UNCOV
30
    } else if (dynamic_cast<structured_control_flow::Continue*>(current)) {
×
UNCOV
31
        this->scope_tree_[current] = parent_scope;
×
UNCOV
32
    } else if (dynamic_cast<structured_control_flow::Return*>(current)) {
×
33
        this->scope_tree_[current] = parent_scope;
×
34
    } else {
×
35
        throw std::runtime_error("Unsupported control flow node type");
×
36
    }
37
}
6,706✔
38

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

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

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

57
} // namespace analysis
58
} // 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