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

daisytuner / sdfglib / 20770413849

06 Jan 2026 10:50PM UTC coverage: 62.168% (+21.4%) from 40.764%
20770413849

push

github

web-flow
Merge pull request #433 from daisytuner/clang-coverage

updates clang coverage flags

14988 of 24109 relevant lines covered (62.17%)

88.57 hits per line

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

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

10
      };
166✔
11

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

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

17
int PrettyPrinter::changeIndent(int delta) { return indentSize += delta; };
×
18

19
// Get the underlying string
20
std::string PrettyPrinter::str() const { return stream.str(); };
91✔
21

22
// Clear the stringstream content
23
void PrettyPrinter::clear() {
18✔
24
    stream.str("");
18✔
25
    stream.clear();
18✔
26
};
18✔
27

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

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

49
Reference::Reference(const types::IType& reference_) : reference_(reference_.clone()) {};
×
50

51
Reference::Reference(
52
    types::StorageType storage_type, size_t alignment, const std::string& initializer, const types::IType& reference_
53
)
54
    : IType(storage_type, alignment, initializer), reference_(reference_.clone()) {};
1✔
55

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

60
types::TypeID Reference::type_id() const { return types::TypeID::Reference; };
1✔
61

62
types::PrimitiveType Reference::primitive_type() const { return this->reference_->primitive_type(); };
×
63

64
bool Reference::is_symbol() const { return false; };
×
65

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

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

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

78

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