mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SourceManager: emphasize that some APIs accept only valid SourceLocations
Adding these asserts would help debugging. Without the asserts it would fail anyway, but in a more obscure place, usually with a null pointer dereference. Swift SVN r14512
This commit is contained in:
@@ -111,10 +111,11 @@ public:
|
||||
/// might point at whitespace or comment.
|
||||
SourceLoc getLocForBufferStart(unsigned BufferID) const;
|
||||
|
||||
/// \brief Returns the offset in bytes for the given source location.
|
||||
/// \brief Returns the offset in bytes for the given valid source location.
|
||||
unsigned getLocOffsetInBuffer(SourceLoc Loc, unsigned BufferID) const;
|
||||
|
||||
/// \brief Returns the distance in bytes between the given source locations.
|
||||
/// \brief Returns the distance in bytes between the given valid source
|
||||
/// locations.
|
||||
unsigned getByteDistance(SourceLoc Start, SourceLoc End) const;
|
||||
|
||||
/// Returns the SourceLoc for the byte offset in the specified buffer.
|
||||
|
||||
Reference in New Issue
Block a user