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

daisytuner / sdfglib / 15656007340

14 Jun 2025 08:51PM UTC coverage: 13.234% (-49.9%) from 63.144%
15656007340

Pull #76

github

web-flow
Merge 9586c8161 into 413c53212
Pull Request #76: New Loop Dependency Analysis

361 of 465 new or added lines in 7 files covered. (77.63%)

6215 existing lines in 110 files now uncovered.

1612 of 12181 relevant lines covered (13.23%)

13.64 hits per line

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

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

3
namespace sdfg {
4
namespace codegen {
5

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

10
      };
11

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

UNCOV
15
int PrettyPrinter::indent() const { return indentSize; };
×
16

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

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

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

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

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

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

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

58
types::PrimitiveType Reference::primitive_type() const {
×
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