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

daisytuner / sdfglib / 20770413849

06 Jan 2026 10:50PM UTC coverage: 62.168% (+21.4%) from 40.764%
20770413849

push

github

web-flow
Merge pull request #433 from daisytuner/clang-coverage

updates clang coverage flags

14988 of 24109 relevant lines covered (62.17%)

88.57 hits per line

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

29.82
/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) {};
7✔
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) {};
2✔
13

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

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

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

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

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

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

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

28
bool Function::is_var_arg() const { return this->is_var_arg_; }
7✔
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 {
1✔
62
    auto new_function = std::make_unique<
1✔
63
        Function>(this->storage_type(), this->alignment(), this->initializer(), *this->return_type_, this->is_var_arg_);
1✔
64
    for (const auto& param : this->params_) {
2✔
65
        new_function->add_param(*param);
2✔
66
    }
2✔
67
    return new_function;
1✔
68
}
1✔
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

86
} // namespace types
87
} // 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