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

daisytuner / sdfglib / 15487347373

06 Jun 2025 09:26AM UTC coverage: 57.73% (+0.003%) from 57.727%
15487347373

push

github

web-flow
Merge pull request #58 from daisytuner/storage_types

moves from address space to storage type enums

109 of 115 new or added lines in 15 files covered. (94.78%)

15 existing lines in 6 files now uncovered.

7939 of 13752 relevant lines covered (57.73%)

108.46 hits per line

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

90.91
/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) : name_(name) {};
22✔
7

8
Structure::Structure(StorageType storage_type, size_t alignment, const std::string& initializer,
11✔
9
                     const std::string& name)
10
    : IType(storage_type, alignment, initializer), name_(name) {};
11✔
11

12
PrimitiveType Structure::primitive_type() const { return PrimitiveType::Void; };
1✔
13

14
bool Structure::is_symbol() const { return false; };
2✔
15

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

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

26
std::unique_ptr<IType> Structure::clone() const {
9✔
27
    return std::make_unique<Structure>(this->storage_type(), this->alignment(), this->initializer(),
18✔
28
                                       this->name_);
9✔
UNCOV
29
};
×
30

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

33
StructureDefinition::StructureDefinition(const std::string& name, bool is_packed)
22✔
34
    : name_(name), is_packed_(is_packed), members_() {};
22✔
35

36
std::unique_ptr<StructureDefinition> StructureDefinition::clone() const {
2✔
37
    auto def = std::make_unique<StructureDefinition>(this->name_, this->is_packed_);
2✔
38
    for (unsigned i = 0; i < this->num_members(); i++) {
4✔
39
        def->add_member(this->member_type(symbolic::integer(i)));
2✔
40
    }
2✔
41
    return def;
2✔
42
};
2✔
43

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

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

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

50
const IType& StructureDefinition::member_type(symbolic::Integer index) const {
35✔
51
    return *this->members_.at(index->as_uint());
35✔
52
};
53

54
void StructureDefinition::add_member(const IType& member_type) {
28✔
55
    this->members_.push_back(member_type.clone());
28✔
56
};
28✔
57

58
}  // namespace types
59
}  // 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