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

daisytuner / sdfglib / 15044057891

15 May 2025 11:42AM UTC coverage: 59.37% (+1.8%) from 57.525%
15044057891

push

github

web-flow
Merge pull request #14 from daisytuner/sanitizers

enables sanitizer on unit tests

63 of 67 new or added lines in 47 files covered. (94.03%)

570 existing lines in 62 files now uncovered.

7356 of 12390 relevant lines covered (59.37%)

505.93 hits per line

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

85.71
/include/sdfg/codegen/utils.h
1
#pragma once
2

3
#include <iomanip>
4
#include <iostream>
5
#include <sstream>
6

7
#include "sdfg/types/type.h"
8

9
namespace sdfg {
10
namespace codegen {
11
class PrettyPrinter {
12
   public:
13
    // Constructor
14
    PrettyPrinter(int indent = 0, bool frozen = false);
15

16
    // Set the indentation level
17
    void setIndent(int indent);
18

19
    int indent() const;
20

21
    // Get the underlying string
22
    std::string str() const;
23

24
    // Clear the stringstream content
25
    void clear();
26

27
    // Overload the insertion operator
28
    template <typename T>
29
    PrettyPrinter& operator<<(const T& value) {
377✔
30
        if (frozen_) {
377✔
31
            throw std::runtime_error("PrettyPrinter is frozen");
1✔
32
        }
33
        applyIndent();
376✔
34
        stream << value;
376✔
35
        return *this;
376✔
UNCOV
36
    }
×
37

38
    // Overload for manipulators (like std::endl)
39
    PrettyPrinter& operator<<(std::ostream& (*manip)(std::ostream&));
40

41
   private:
42
    std::stringstream stream;
43
    int indentSize;
44
    bool isNewLine = true;
45
    bool frozen_;
46

47
    // Apply indentation only at the beginning of a new line
48
    void applyIndent();
49
};
50

51
class Reference : public types::IType {
52
   private:
53
    std::unique_ptr<types::IType> reference_;
54

55
   public:
56
    Reference(const types::IType& reference_);
57

58
    std::unique_ptr<types::IType> clone() const override;
59

60
    types::PrimitiveType primitive_type() const override;
61

62
    bool is_symbol() const override;
63

64
    const types::IType& reference_type() const;
65

66
    bool operator==(const types::IType& other) const override;
67

68
    uint address_space() const override;
69

70
    sdfg::types::DeviceLocation device_location() const override;
71

72
    std::string initializer() const override;
73
};
74

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