• 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

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

3
namespace sdfg {
4
namespace types {
5

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

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

UNCOV
15
PrimitiveType Function::primitive_type() const { return PrimitiveType::Void; }
×
16

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

UNCOV
19
size_t Function::num_params() const { return this->params_.size(); }
×
20

UNCOV
21
const IType& Function::param_type(symbolic::Integer index) const {
×
UNCOV
22
    return *this->params_[index->as_int()];
×
23
}
24

UNCOV
25
void Function::add_param(const IType& param) { this->params_.push_back(param.clone()); }
×
26

UNCOV
27
const IType& Function::return_type() const { return *this->return_type_; }
×
28

UNCOV
29
bool Function::is_var_arg() const { return this->is_var_arg_; }
×
30

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

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

41
    if (this->alignment_ != other_function->alignment_) {
×
42
        return false;
×
43
    }
44

45
    if (*this->return_type_ == *other_function->return_type_) {
×
46
        // Do nothing
47
    } else {
×
48
        return false;
×
49
    }
50

51
    if (this->params_.size() != other_function->params_.size()) {
×
52
        return false;
×
53
    }
54

55
    for (size_t i = 0; i < this->params_.size(); i++) {
×
56
        if (*this->params_[i] == *other_function->params_[i]) {
×
57
            continue;
×
58
        } else {
59
            return false;
×
60
        }
61
    }
62

63
    return true;
×
64
}
×
65

UNCOV
66
std::unique_ptr<IType> Function::clone() const {
×
67
    auto new_function =
UNCOV
68
        std::make_unique<Function>(this->storage_type(), this->alignment(), this->initializer(),
×
UNCOV
69
                                   *this->return_type_, this->is_var_arg_);
×
UNCOV
70
    for (const auto& param : this->params_) {
×
UNCOV
71
        new_function->add_param(*param);
×
72
    }
UNCOV
73
    return new_function;
×
UNCOV
74
}
×
75

76
std::string Function::print() const {
×
77
    std::string params = "";
×
78
    for (size_t i = 0; i < this->params_.size(); i++) {
×
79
        params += this->params_[i]->print();
×
80
        if (i != this->params_.size() - 1) {
×
81
            params += ", ";
×
82
        }
×
83
    }
×
84
    if (this->is_var_arg_) {
×
85
        params += ", ...)";
×
86
    } else {
×
87
        params += ")";
×
88
    }
89
    return "Function(" + this->return_type_->print() + ", " + params + ")";
×
90
};
×
91

92
}  // namespace types
93
}  // 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