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

daisytuner / sdfglib / 15002998838

13 May 2025 05:31PM UTC coverage: 57.685% (-4.0%) from 61.65%
15002998838

Pull #10

github

web-flow
Merge 31348c014 into 89e3d3003
Pull Request #10: Support for Packed Structs and Function Types

33 of 110 new or added lines in 10 files covered. (30.0%)

457 existing lines in 6 files now uncovered.

7161 of 12414 relevant lines covered (57.68%)

526.43 hits per line

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

45.0
/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),
129✔
9
      frozen_(frozen){
129✔
10

11
      };
129✔
12

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

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

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

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

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

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

UNCOV
48
Reference::Reference(const types::IType& reference_)
×
UNCOV
49
    : reference_(reference_.clone()){
×
50

UNCOV
51
      };
×
52

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

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

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

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

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

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

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

79
std::string Reference::initializer() const { return this->reference_->initializer(); };
×
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