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

daisytuner / sdfglib / 19525173698

19 Nov 2025 09:22AM UTC coverage: 62.105% (-0.08%) from 62.184%
19525173698

push

github

web-flow
Merge pull request #354 from daisytuner/tenstorrent-transform

Tenstorrent transform

52 of 95 new or added lines in 15 files covered. (54.74%)

28 existing lines in 8 files now uncovered.

11141 of 17939 relevant lines covered (62.1%)

112.03 hits per line

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

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

10
      };
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

NEW
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&) ) {
996✔
30
    if (frozen_) {
996✔
31
        throw std::runtime_error("PrettyPrinter is frozen");
×
32
    }
33
    stream << manip;
996✔
34
    // Reset indent application on new lines
35
    if (manip == static_cast<std::ostream& (*) (std::ostream&)>(std::endl)) {
996✔
36
        isNewLine = true;
996✔
37
    }
996✔
38
    return *this;
996✔
39
};
×
40

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

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

51
Reference::Reference(
1✔
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