File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,11 @@ class SourceRange {
96
96
bool isValid () const { return Start.isValid (); }
97
97
bool isInvalid () const { return !isValid (); }
98
98
99
+ bool operator ==(const SourceRange &other) const {
100
+ return Start == other.Start && End == other.End ;
101
+ }
102
+ bool operator !=(const SourceRange &other) const { return !operator ==(other); }
103
+
99
104
// / Print out the SourceRange. If the locations are in the same buffer
100
105
// / as specified by LastBufferID, then we don't print the filename. If not,
101
106
// / we do print the filename, and then update LastBufferID with the BufferID
@@ -134,6 +139,13 @@ class CharSourceRange {
134
139
bool isValid () const { return Start.isValid (); }
135
140
bool isInvalid () const { return !isValid (); }
136
141
142
+ bool operator ==(const CharSourceRange &other) const {
143
+ return Start == other.Start && ByteLength == other.ByteLength ;
144
+ }
145
+ bool operator !=(const CharSourceRange &other) const {
146
+ return !operator ==(other);
147
+ }
148
+
137
149
SourceLoc getStart () const { return Start; }
138
150
SourceLoc getEnd () const { return Start.getAdvancedLocOrInvalid (ByteLength); }
139
151
You can’t perform that action at this time.
0 commit comments