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

daisytuner / sdfglib / 15612270835

12 Jun 2025 01:44PM UTC coverage: 60.871% (-0.8%) from 61.71%
15612270835

push

github

web-flow
Merge pull request #68 from daisytuner/loop-types

refactors symbolic analysis into polynomials, extreme values and cnf

638 of 862 new or added lines in 24 files covered. (74.01%)

334 existing lines in 20 files now uncovered.

6571 of 10795 relevant lines covered (60.87%)

100.35 hits per line

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

84.21
/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) {}
224✔
7

8
void ScopeAnalysis::run(structured_control_flow::ControlFlowNode* current,
1,364✔
9
                        structured_control_flow::ControlFlowNode* parent_scope) {
10
    if (dynamic_cast<structured_control_flow::Block*>(current)) {
1,364✔
11
        this->scope_tree_[current] = parent_scope;
447✔
12
    } else if (auto sequence_stmt = dynamic_cast<structured_control_flow::Sequence*>(current)) {
1,364✔
13
        this->scope_tree_[current] = parent_scope;
574✔
14
        for (size_t i = 0; i < sequence_stmt->size(); i++) {
1,370✔
15
            this->run(&sequence_stmt->at(i).first, current);
796✔
16
        }
796✔
17
    } else if (auto if_else_stmt = dynamic_cast<structured_control_flow::IfElse*>(current)) {
917✔
18
        this->scope_tree_[current] = parent_scope;
21✔
19
        for (size_t i = 0; i < if_else_stmt->size(); i++) {
50✔
20
            this->run(&if_else_stmt->at(i).first, current);
29✔
21
        }
29✔
22
    } else if (auto while_stmt = dynamic_cast<structured_control_flow::While*>(current)) {
343✔
23
        this->scope_tree_[current] = parent_scope;
31✔
24
        this->run(&while_stmt->root(), current);
31✔
25
    } else if (auto for_stmt = dynamic_cast<structured_control_flow::For*>(current)) {
322✔
26
        this->scope_tree_[current] = parent_scope;
284✔
27
        this->run(&for_stmt->root(), current);
284✔
28
    } else if (dynamic_cast<structured_control_flow::Break*>(current)) {
291✔
29
        this->scope_tree_[current] = parent_scope;
×
30
    } else if (dynamic_cast<structured_control_flow::Continue*>(current)) {
7✔
31
        this->scope_tree_[current] = parent_scope;
7✔
32
    } else if (dynamic_cast<structured_control_flow::Return*>(current)) {
7✔
33
        this->scope_tree_[current] = parent_scope;
×
34
    } else {
×
35
        throw std::runtime_error("Unsupported control flow node type");
×
36
    }
37
}
1,364✔
38

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

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

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

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