Skip to content

Commit 3f2873b

Browse files
authored
Merge pull request #33161 from gottesmm/pr-bd42cfb6401f22297a2fa6a1ee127f25b7170f11
[sil] Add an implicit operator bool conversion to SILDebugLocation.
2 parents 6e7c6fd + 94cafc3 commit 3f2873b

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

include/swift/SIL/SILLocation.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -755,17 +755,18 @@ class SILDebugScope;
755755

756756
/// A SILLocation paired with a SILDebugScope.
757757
class SILDebugLocation {
758-
const SILDebugScope *Scope = nullptr;
759-
SILLocation Location;
758+
const SILDebugScope *debugScope;
759+
SILLocation location;
760760

761761
public:
762762
SILDebugLocation()
763-
: Scope(nullptr),
764-
Location(RegularLocation::getAutoGeneratedLocation()) {}
765-
SILDebugLocation(SILLocation Loc, const SILDebugScope *DS)
766-
: Scope(DS), Location(Loc) {}
767-
SILLocation getLocation() const { return Location; }
768-
const SILDebugScope *getScope() const { return Scope; }
763+
: debugScope(nullptr),
764+
location(RegularLocation::getAutoGeneratedLocation()) {}
765+
SILDebugLocation(SILLocation location, const SILDebugScope *debugScope)
766+
: debugScope(debugScope), location(location) {}
767+
SILLocation getLocation() const { return location; }
768+
const SILDebugScope *getScope() const { return debugScope; }
769+
operator bool() const { return bool(location) && debugScope; }
769770
};
770771

771772
} // end swift namespace

0 commit comments

Comments
 (0)