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

daisytuner / docc / 29992851043

23 Jul 2026 08:52AM UTC coverage: 64.1% (+0.3%) from 63.787%
29992851043

Pull #866

github

web-flow
Merge f4354fb28 into 2e568810b
Pull Request #866: Add Support for Complex Types

188 of 296 new or added lines in 12 files covered. (63.51%)

272 existing lines in 10 files now uncovered.

42854 of 66855 relevant lines covered (64.1%)

737.97 hits per line

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

26.09
/sdfg/src/types/function.cpp
1
#include "sdfg/types/function.h"
2

3
namespace sdfg {
4
namespace types {
5

6
Function::Function(const IType& return_type, bool is_var_arg)
7
    : return_type_(return_type.clone()), is_var_arg_(is_var_arg) {};
14✔
8

9
Function::Function(
10
    StorageType storage_type, size_t alignment, const std::string& initializer, const IType& return_type, bool is_var_arg
11
)
12
    : IType(storage_type, alignment, initializer), return_type_(return_type.clone()), is_var_arg_(is_var_arg) {};
19✔
13

14
PrimitiveType Function::primitive_type() const { return PrimitiveType::Void; }
2✔
15

16
bool Function::is_symbol() const { return false; }
4✔
17

18
size_t Function::num_params() const { return this->params_.size(); }
36✔
19

20
const IType& Function::param_type(symbolic::Integer index) const { return *this->params_[index->as_int()]; }
15✔
21

22
void Function::add_param(const IType& param) { this->params_.push_back(param.clone()); }
60✔
23

24
const IType& Function::return_type() const { return *this->return_type_; }
6✔
25

26
TypeID Function::type_id() const { return TypeID::Function; };
11✔
27

28
bool Function::is_var_arg() const { return this->is_var_arg_; }
26✔
29

30
bool Function::operator==(const IType& other) const {
×
31
    auto other_function = dynamic_cast<const Function*>(&other);
×
32
    if (other_function == nullptr) {
×
33
        return false;
×
34
    }
×
35

36
    if (this->is_var_arg_ != other_function->is_var_arg_) {
×
37
        return false;
×
38
    }
×
39

40
    if (*this->return_type_ == *other_function->return_type_) {
×
41
        // Do nothing
42
    } else {
×
43
        return false;
×
44
    }
×
45

46
    if (this->params_.size() != other_function->params_.size()) {
×
47
        return false;
×
48
    }
×
49

50
    for (size_t i = 0; i < this->params_.size(); i++) {
×
51
        if (*this->params_[i] == *other_function->params_[i]) {
×
52
            continue;
×
53
        } else {
×
54
            return false;
×
55
        }
×
56
    }
×
57

58
    return true;
×
59
}
×
60

61
std::unique_ptr<IType> Function::clone() const {
15✔
62
    auto new_function = std::make_unique<
15✔
63
        Function>(this->storage_type(), this->alignment(), this->initializer(), *this->return_type_, this->is_var_arg_);
15✔
64
    for (const auto& param : this->params_) {
32✔
65
        new_function->add_param(*param);
32✔
66
    }
32✔
67
    return new_function;
15✔
68
}
15✔
69

70
std::string Function::print() const {
×
71
    std::string params = "";
×
72
    for (size_t i = 0; i < this->params_.size(); i++) {
×
73
        params += this->params_[i]->print();
×
74
        if (i != this->params_.size() - 1) {
×
75
            params += ", ";
×
76
        }
×
77
    }
×
78
    if (this->is_var_arg_) {
×
79
        params += ", ...)";
×
80
    } else {
×
81
        params += ")";
×
82
    }
×
83
    return "Function(" + this->return_type_->print() + ", " + params + ")";
×
84
};
×
85

UNCOV
86
void Function::replace_symbols(const symbolic::Expression old_expression, const symbolic::Expression new_expression) {
×
UNCOV
87
    for (size_t i = 0; i < this->num_params(); i++) {
×
UNCOV
88
        this->params_[i]->replace_symbols(old_expression, new_expression);
×
UNCOV
89
    }
×
UNCOV
90
    this->return_type_->replace_symbols(old_expression, new_expression);
×
UNCOV
91
}
×
92

UNCOV
93
void Function::replace_symbols(const symbolic::ExpressionMapping& replacements) {
×
UNCOV
94
    for (size_t i = 0; i < this->num_params(); i++) {
×
UNCOV
95
        this->params_[i]->replace_symbols(replacements);
×
UNCOV
96
    }
×
UNCOV
97
    this->return_type_->replace_symbols(replacements);
×
UNCOV
98
}
×
99

100
} // namespace types
101
} // namespace sdfg
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc