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

daisytuner / sdfglib / 15049122732

15 May 2025 03:33PM UTC coverage: 62.241% (+4.7%) from 57.525%
15049122732

Pull #9

github

web-flow
Merge b96e33e0e into 9d3b1a2b3
Pull Request #9: Graphviz DOT Visualizer for SDFGs

520 of 542 new or added lines in 3 files covered. (95.94%)

782 existing lines in 68 files now uncovered.

8049 of 12932 relevant lines covered (62.24%)

504.09 hits per line

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

96.3
/src/builder/function_builder.cpp
1
#include "sdfg/builder/function_builder.h"
2

3
namespace sdfg {
4
namespace builder {
5

6
FunctionBuilder::FunctionBuilder() : element_counter_(1) {};
854✔
7

8
const types::IType& FunctionBuilder::add_container(const std::string& name,
1,227✔
9
                                                   const types::IType& type, bool is_argument,
10
                                                   bool is_external) const {
11
    assert(!is_argument || !is_external);
1,227✔
12

13
    auto res = this->function().containers_.insert({name, type.clone()});
1,227✔
14
    assert(res.second);
1,227✔
15

16
    if (is_argument) {
1,227✔
17
        this->function().arguments_.push_back(name);
414✔
18
    }
414✔
19
    if (is_external) {
1,227✔
20
        this->function().externals_.push_back(name);
9✔
21
    }
9✔
22
    if (type.is_symbol() && dynamic_cast<const types::Scalar*>(&type)) {
1,227✔
23
        auto sym = symbolic::symbol(name);
891✔
24
        this->function().assumptions_.insert({sym, symbolic::Assumption::create(sym, type)});
891✔
25
    }
891✔
26

27
    return *(*res.first).second;
1,227✔
UNCOV
28
};
×
29

30
void FunctionBuilder::remove_container(const std::string& name) const {
4✔
31
    auto& function = this->function();
4✔
32
    assert(function.is_transient(name));
4✔
33

34
    auto& type = function.containers_[name];
4✔
35
    if (type->is_symbol() && dynamic_cast<const types::Scalar*>(type.get())) {
4✔
36
        function.assumptions_.erase(symbolic::symbol(name));
4✔
37
    }
4✔
38

39
    function.containers_.erase(name);
4✔
40
};
4✔
41

42
void FunctionBuilder::change_type(const std::string& name, const types::IType& type) const {
9✔
43
    auto& function = this->function();
9✔
44
    assert(function.is_transient(name));
9✔
45

46
    function.containers_[name] = type.clone();
9✔
47
};
9✔
48

49
types::StructureDefinition& FunctionBuilder::add_structure(const std::string& name,
19✔
50
                                                           bool is_packed) const {
51
    auto res = this->function().structures_.insert(
19✔
52
        {name, std::make_unique<types::StructureDefinition>(name, is_packed)});
19✔
53
    assert(res.second);
19✔
54

55
    return *(*res.first).second;
19✔
UNCOV
56
};
×
57

58
void FunctionBuilder::make_array(const std::string& name, const symbolic::Expression& size) const {
5✔
59
    auto& function = this->function();
5✔
60
    assert(function.is_transient(name));
5✔
61

62
    auto& old_type = function.containers_[name];
5✔
63

64
    if (old_type->is_symbol()) {
5✔
65
        function.assumptions_.erase(symbolic::symbol(name));
1✔
66
    }
1✔
67

68
    function.containers_[name] = std::make_unique<types::Array>(*old_type, size);
5✔
69
};
5✔
70

71
std::string FunctionBuilder::find_new_name(std::string prefix) const {
52✔
72
    size_t i = 0;
52✔
73
    std::string new_name = prefix + std::to_string(i);
52✔
74
    while (this->function().exists(new_name)) {
74✔
75
        i++;
22✔
76
        new_name = prefix + std::to_string(i);
22✔
77
    }
78
    return new_name;
52✔
79
};
52✔
80

81
}  // namespace builder
82
}  // 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