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

daisytuner / sdfglib / 15278747374

27 May 2025 02:59PM UTC coverage: 58.37% (-0.08%) from 58.452%
15278747374

push

github

web-flow
Merge pull request #39 from daisytuner/codegen-fixes

Codegen: Raw pointers and reinterpret cast fixes

0 of 28 new or added lines in 2 files covered. (0.0%)

7912 of 13555 relevant lines covered (58.37%)

96.19 hits per line

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

56.1
/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, DeviceLocation device_location,
16✔
7
                   uint address_space, const std::string& initializer)
8
    : return_type_(return_type.clone()),
8✔
9
      is_var_arg_(is_var_arg),
8✔
10
      device_location_(device_location),
8✔
11
      address_space_(address_space),
8✔
12
      initializer_(initializer) {}
8✔
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 {
7✔
21
    return *this->params_[index->as_int()];
7✔
22
}
23

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

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

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

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

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

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

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

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

NEW
58
    return true;
×
NEW
59
}
×
60

61
std::unique_ptr<IType> Function::clone() const {
1✔
62
    auto new_function =
63
        std::make_unique<Function>(*this->return_type_, this->is_var_arg_, this->device_location_,
2✔
64
                                   this->address_space_, this->initializer_);
1✔
65
    for (const auto& param : this->params_) {
3✔
66
        new_function->add_param(*param);
2✔
67
    }
68
    return new_function;
1✔
69
}
1✔
70

71
DeviceLocation Function::device_location() const { return this->device_location_; }
4✔
72

73
uint Function::address_space() const { return this->address_space_; }
4✔
74

75
std::string Function::initializer() const { return this->initializer_; }
4✔
76

77
}  // namespace types
78
}  // 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