Index: tools/gn/location.cc |
diff --git a/tools/gn/location.cc b/tools/gn/location.cc |
index 49ca3ffe717f7c1550eae1f25f4c28f73b63b6ac..ce4f06ff391608438ae87262f9af5cd4f97aa2f2 100644 |
--- a/tools/gn/location.cc |
+++ b/tools/gn/location.cc |
@@ -26,6 +26,10 @@ Location::Location(const InputFile* file, |
byte_(byte) { |
} |
+bool Location::is_null() const { |
+ return *this == Location(); |
+} |
+ |
bool Location::operator==(const Location& other) const { |
return other.file_ == file_ && |
other.line_number_ == line_number_ && |
@@ -70,6 +74,10 @@ LocationRange::LocationRange(const Location& begin, const Location& end) |
DCHECK(begin_.file() == end_.file()); |
} |
+bool LocationRange::is_null() const { |
+ return begin_.is_null(); // No need to check both for the null case. |
+} |
+ |
LocationRange LocationRange::Union(const LocationRange& other) const { |
DCHECK(begin_.file() == other.begin_.file()); |
return LocationRange( |