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

daisytuner / sdfglib / 16069945621

04 Jul 2025 08:56AM UTC coverage: 64.375% (-0.2%) from 64.606%
16069945621

push

github

web-flow
Merge pull request #137 from daisytuner/clang-format

runs clang-format on codebase

609 of 827 new or added lines in 63 files covered. (73.64%)

46 existing lines in 30 files now uncovered.

8578 of 13325 relevant lines covered (64.38%)

177.24 hits per line

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

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

10
      };
11

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

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

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

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

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

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

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

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

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

58
types::TypeID Reference::type_id() const { return types::TypeID::Reference; };
1✔
59

NEW
60
types::PrimitiveType Reference::primitive_type() const { return this->reference_->primitive_type(); };
×
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)) {
×
NEW
68
        return *(this->reference_) == *reference->reference_ && this->alignment_ == reference->alignment_;
×
69
    } else {
70
        return false;
×
71
    }
72
};
×
73

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

76
} // namespace codegen
77
} // 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

© 2025 Coveralls, Inc