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

daisytuner / sdfglib / 16069945621

04 Jul 2025 08:56AM UTC coverage: 64.375% (-0.2%) from 64.606%
16069945621

push

github

web-flow
Merge pull request #137 from daisytuner/clang-format

runs clang-format on codebase

609 of 827 new or added lines in 63 files covered. (73.64%)

46 existing lines in 30 files now uncovered.

8578 of 13325 relevant lines covered (64.38%)

177.24 hits per line

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

90.32
/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) {};
23✔
7

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

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

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

15
TypeID Structure::type_id() const { return TypeID::Structure; };
1✔
16

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

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

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

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) { this->members_.push_back(member_type.clone()); };
28✔
55

56
} // namespace types
57
} // 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

© 2025 Coveralls, Inc