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

daisytuner / sdfglib / 15044057891

15 May 2025 11:42AM UTC coverage: 59.37% (+1.8%) from 57.525%
15044057891

push

github

web-flow
Merge pull request #14 from daisytuner/sanitizers

enables sanitizer on unit tests

63 of 67 new or added lines in 47 files covered. (94.03%)

570 existing lines in 62 files now uncovered.

7356 of 12390 relevant lines covered (59.37%)

505.93 hits per line

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

42.86
/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)
129✔
8
    : indentSize(indent), frozen_(frozen) {
129✔
9

10
      };
11

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

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

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

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

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

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

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

50
      };
×
51

52
std::unique_ptr<types::IType> Reference::clone() const {
×
53
    return std::make_unique<Reference>(*this->reference_);
×
54
};
55

56
types::PrimitiveType Reference::primitive_type() const {
×
57
    return this->reference_->primitive_type();
×
58
};
59

60
bool Reference::is_symbol() const { return false; };
×
61

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

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

72
uint Reference::address_space() const { return this->reference_->address_space(); };
×
73

74
sdfg::types::DeviceLocation Reference::device_location() const {
×
75
    return this->reference_->device_location();
×
76
};
77

78
std::string Reference::initializer() const { return this->reference_->initializer(); };
×
79

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