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

daisytuner / docc / 24836919684

23 Apr 2026 01:04PM UTC coverage: 64.104% (-0.06%) from 64.167%
24836919684

Pull #690

github

web-flow
Merge 7af6c3c2d into 3762dada8
Pull Request #690: Modular Compile process

224 of 347 new or added lines in 13 files covered. (64.55%)

2 existing lines in 2 files now uncovered.

30800 of 48047 relevant lines covered (64.1%)

573.39 hits per line

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

81.82
/sdfg/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
    : owned_stream(std::make_unique<std::stringstream>()), stream(*owned_stream.get()), indentSize(indent),
199✔
9
      frozen_(frozen) {}
199✔
10

11
PrettyPrinter::PrettyPrinter(std::ostream& stream, int indent, bool frozen)
NEW
12
    : stream(stream), indentSize(indent), frozen_(frozen) {}
×
13

14
// Set the indentation level
15
void PrettyPrinter::setIndent(int indent) { indentSize = indent; };
442✔
16

17
int PrettyPrinter::indent() const { return indentSize; };
252✔
18

19
int PrettyPrinter::changeIndent(int delta) { return indentSize += delta; };
×
20

21
// Get the underlying string
22
std::string PrettyPrinter::str() const { return owned_stream->str(); };
114✔
23

24
// Clear the stringstream content
25
void PrettyPrinter::clear() {
19✔
26
    owned_stream->str("");
19✔
27
    owned_stream->clear();
19✔
28
}
19✔
29

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

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

51
Reference::Reference(const types::IType& reference_) : reference_(reference_.clone()) {};
14✔
52

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

58
std::unique_ptr<types::IType> Reference::clone() const {
4✔
59
    return std::make_unique<Reference>(this->storage_type(), this->alignment(), this->initializer(), *this->reference_);
4✔
60
};
4✔
61

62
types::TypeID Reference::type_id() const { return types::TypeID::Reference; };
32✔
63

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

66
bool Reference::is_symbol() const { return false; };
×
67

68
const types::IType& Reference::reference_type() const { return *this->reference_; };
21✔
69

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

78
std::string Reference::print() const { return "Reference(" + this->reference_->print() + ")"; };
1✔
79

80

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