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

daisytuner / sdfglib / 15656007340

14 Jun 2025 08:51PM UTC coverage: 13.234% (-49.9%) from 63.144%
15656007340

Pull #76

github

web-flow
Merge 9586c8161 into 413c53212
Pull Request #76: New Loop Dependency Analysis

361 of 465 new or added lines in 7 files covered. (77.63%)

6215 existing lines in 110 files now uncovered.

1612 of 12181 relevant lines covered (13.23%)

13.64 hits per line

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

60.53
/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) {}
136✔
7

8
void ScopeAnalysis::run(structured_control_flow::ControlFlowNode* current,
706✔
9
                        structured_control_flow::ControlFlowNode* parent_scope) {
10
    if (dynamic_cast<structured_control_flow::Block*>(current)) {
706✔
11
        this->scope_tree_[current] = parent_scope;
154✔
12
    } else if (auto sequence_stmt = dynamic_cast<structured_control_flow::Sequence*>(current)) {
706✔
13
        this->scope_tree_[current] = parent_scope;
344✔
14
        for (size_t i = 0; i < sequence_stmt->size(); i++) {
706✔
15
            this->run(&sequence_stmt->at(i).first, current);
362✔
16
        }
362✔
17
    } else if (auto if_else_stmt = dynamic_cast<structured_control_flow::IfElse*>(current)) {
552✔
UNCOV
18
        this->scope_tree_[current] = parent_scope;
×
UNCOV
19
        for (size_t i = 0; i < if_else_stmt->size(); i++) {
×
UNCOV
20
            this->run(&if_else_stmt->at(i).first, current);
×
UNCOV
21
        }
×
22
    } else if (auto while_stmt = dynamic_cast<structured_control_flow::While*>(current)) {
208✔
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::For*>(current)) {
208✔
26
        this->scope_tree_[current] = parent_scope;
208✔
27
        this->run(&for_stmt->root(), current);
208✔
28
    } else if (dynamic_cast<structured_control_flow::Break*>(current)) {
208✔
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
}
706✔
38

39
void ScopeAnalysis::run(AnalysisManager& analysis_manager) {
136✔
40
    this->scope_tree_.clear();
136✔
41

42
    this->scope_tree_[&this->sdfg_.root()] = nullptr;
136✔
43
    this->run(&this->sdfg_.root(), nullptr);
136✔
44
}
136✔
45

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

52
structured_control_flow::ControlFlowNode* ScopeAnalysis::parent_scope(
454✔
53
    const structured_control_flow::ControlFlowNode* scope) const {
54
    return this->scope_tree_.at(scope);
454✔
55
}
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