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

daisytuner / sdfglib / 15470021361

05 Jun 2025 02:42PM UTC coverage: 57.727% (-0.2%) from 57.883%
15470021361

push

github

web-flow
Merge pull request #57 from daisytuner/alignments

adds explicit alignment to types

44 of 61 new or added lines in 12 files covered. (72.13%)

7 existing lines in 5 files now uncovered.

7953 of 13777 relevant lines covered (57.73%)

108.58 hits per line

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

94.87
/src/types/structure.cpp
1
#include "sdfg/types/structure.h"
2

3
namespace sdfg {
4
namespace types {
5

6
Structure::Structure(const std::string& name, DeviceLocation device_location, uint address_space,
33✔
7
                     const std::string& initializer, size_t alignment)
8
    : name_(name),
33✔
9
      device_location_(device_location),
33✔
10
      address_space_(address_space),
33✔
11
      initializer_(initializer),
33✔
12
      alignment_(alignment) {};
66✔
13

14
PrimitiveType Structure::primitive_type() const { return PrimitiveType::Void; };
1✔
15

16
bool Structure::is_symbol() const { return false; };
2✔
17

18
const std::string& Structure::name() const { return this->name_; };
23✔
19

20
bool Structure::operator==(const IType& other) const {
3✔
21
    if (auto structure_ = dynamic_cast<const Structure*>(&other)) {
3✔
22
        return this->name_ == structure_->name_ && this->alignment_ == structure_->alignment_;
3✔
23
    } else {
24
        return false;
×
25
    }
26
};
3✔
27

28
std::unique_ptr<IType> Structure::clone() const {
9✔
29
    return std::make_unique<Structure>(this->name_, this->device_location_, this->address_space_,
18✔
30
                                       this->initializer_, this->alignment_);
9✔
31
};
32

33
uint Structure::address_space() const { return this->address_space_; };
11✔
34

35
DeviceLocation Structure::device_location() const { return this->device_location_; };
5✔
36

37
std::string Structure::initializer() const { return this->initializer_; };
5✔
38

39
size_t Structure::alignment() const { return this->alignment_; };
5✔
40

UNCOV
41
std::string Structure::print() const { return "Structure(" + this->name_ + ")"; };
×
42

43
StructureDefinition::StructureDefinition(const std::string& name, bool is_packed)
22✔
44
    : name_(name), is_packed_(is_packed), members_() {};
22✔
45

46
std::unique_ptr<StructureDefinition> StructureDefinition::clone() const {
2✔
47
    auto def = std::make_unique<StructureDefinition>(this->name_, this->is_packed_);
2✔
48
    for (unsigned i = 0; i < this->num_members(); i++) {
4✔
49
        def->add_member(this->member_type(symbolic::integer(i)));
2✔
50
    }
2✔
51
    return def;
2✔
52
};
2✔
53

54
const std::string& StructureDefinition::name() const { return this->name_; };
7✔
55

56
bool StructureDefinition::is_packed() const { return this->is_packed_; };
17✔
57

58
size_t StructureDefinition::num_members() const { return this->members_.size(); };
52✔
59

60
const IType& StructureDefinition::member_type(symbolic::Integer index) const {
35✔
61
    return *this->members_.at(index->as_uint());
35✔
62
};
63

64
void StructureDefinition::add_member(const IType& member_type) {
28✔
65
    this->members_.push_back(member_type.clone());
28✔
66
};
28✔
67

68
}  // namespace types
69
}  // 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