Skip to content

Commit

Permalink
text: drop "DEBUG" macro inconsistencies
Browse files Browse the repository at this point in the history
  • Loading branch information
jesec authored and renau committed Oct 9, 2021
1 parent 8ec0195 commit 5164f43
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions include/slang/text/SourceLocation.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ class SourceManager;
struct BufferID {
BufferID() = default;
constexpr BufferID(uint32_t value, string_view name) :
#ifdef DEBUG
name(name),
#endif
id(value) {
(void)name;
}
Expand All @@ -50,10 +47,6 @@ struct BufferID {
/// be observed.
static BufferID getPlaceholder() { return BufferID(UINT32_MAX, ""sv); }

#ifdef DEBUG
string_view name;
#endif

private:
uint32_t id = 0;
};
Expand All @@ -66,19 +59,12 @@ class SourceLocation {
public:
constexpr SourceLocation() : bufferID(0), charOffset(0) {}
constexpr SourceLocation(BufferID buffer, size_t offset) :
#ifdef DEBUG
bufferName(buffer.name),
#endif
bufferID(buffer.getId()), charOffset(offset) {
}

/// @return an identifier for the buffer that contains this location.
BufferID buffer() const {
#ifdef DEBUG
return BufferID(bufferID, bufferName);
#else
return BufferID(bufferID, ""sv);
#endif
}

/// @return the character offset of this location within the source buffer.
Expand Down Expand Up @@ -122,10 +108,6 @@ class SourceLocation {

bool operator>=(const SourceLocation& rhs) const { return !(*this < rhs); }

#ifdef DEBUG
string_view bufferName;
#endif

/// A location that is reserved to represent "no location" at all.
static const SourceLocation NoLocation;

Expand Down

0 comments on commit 5164f43

Please sign in to comment.