• 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

52.38
/src/codegen/utils.cpp
1
#include "sdfg/codegen/utils.h"
2

3
namespace sdfg {
4
namespace codegen {
5

6
// Constructor
7
PrettyPrinter::PrettyPrinter(int indent, bool frozen)
465✔
8
    : indentSize(indent), frozen_(frozen) {
465✔
9

10
      };
11

12
// Set the indentation level
13
void PrettyPrinter::setIndent(int indent) { indentSize = indent; };
2,198✔
14

15
int PrettyPrinter::indent() const { return indentSize; };
430✔
16

17
// Get the underlying string
18
std::string PrettyPrinter::str() const { return stream.str(); };
397✔
19

20
// Clear the stringstream content
21
void PrettyPrinter::clear() {
171✔
22
    stream.str("");
171✔
23
    stream.clear();
171✔
24
};
171✔
25

26
// Overload for manipulators (like std::endl)
27
PrettyPrinter& PrettyPrinter::operator<<(std::ostream& (*manip)(std::ostream&)) {
4,927✔
28
    if (frozen_) {
4,927✔
29
        throw std::runtime_error("PrettyPrinter is frozen");
×
30
    }
31
    stream << manip;
4,927✔
32
    // Reset indent application on new lines
33
    if (manip == static_cast<std::ostream& (*)(std::ostream&)>(std::endl)) {
4,927✔
34
        isNewLine = true;
4,927✔
35
    }
4,927✔
36
    return *this;
4,927✔
37
};
×
38

39
// Apply indentation only at the beginning of a new line
40
void PrettyPrinter::applyIndent() {
13,601✔
41
    if (isNewLine && indentSize > 0) {
13,601✔
42
        stream << std::setw(indentSize) << "";
4,093✔
43
        isNewLine = false;
4,093✔
44
    }
4,093✔
45
};
13,601✔
46

NEW
47
Reference::Reference(const types::IType& reference_) : reference_(reference_.clone()) {};
×
48

NEW
49
Reference::Reference(types::StorageType storage_type, size_t alignment,
×
50
                     const std::string& initializer, const types::IType& reference_)
NEW
51
    : IType(storage_type, alignment, initializer), reference_(reference_.clone()) {};
×
52

53
std::unique_ptr<types::IType> Reference::clone() const {
×
NEW
54
    return std::make_unique<Reference>(this->storage_type(), this->alignment(), this->initializer(),
×
NEW
55
                                       *this->reference_);
×
UNCOV
56
};
×
57

58
types::PrimitiveType Reference::primitive_type() const {
×
UNCOV
59
    return this->reference_->primitive_type();
×
60
};
61

62
bool Reference::is_symbol() const { return false; };
×
63

64
const types::IType& Reference::reference_type() const { return *this->reference_; };
×
65

66
bool Reference::operator==(const types::IType& other) const {
×
67
    if (auto reference = dynamic_cast<const Reference*>(&other)) {
×
68
        return *(this->reference_) == *reference->reference_ &&
×
69
               this->alignment_ == reference->alignment_;
×
70
    } else {
71
        return false;
×
72
    }
73
};
×
74

75
std::string Reference::print() const { return "Reference(" + this->reference_->print() + ")"; };
×
76

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