mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Change SMRange to be half-open (exclusive end) instead of closed (inclusive)
This is necessary not only for representing empty ranges, but for handling multibyte characters in the input. (If the end pointer in a range refers to a multibyte character, should it point to the beginning or the end of the character in a char array?) Some of the code in the asm parsers was already assuming this anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171765 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
|
||||
namespace llvm {
|
||||
|
||||
/// SMLoc - Represents a location in source code.
|
||||
/// Represents a location in source code.
|
||||
class SMLoc {
|
||||
const char *Ptr;
|
||||
public:
|
||||
@@ -39,9 +39,11 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
/// SMRange - Represents a range in source code. Note that unlike standard STL
|
||||
/// ranges, the locations specified are considered to be *inclusive*. For
|
||||
/// example, [X,X] *does* include X, it isn't an empty range.
|
||||
/// Represents a range in source code.
|
||||
///
|
||||
/// SMRange is implemented using a half-open range, as is the convention in C++.
|
||||
/// In the string "abc", the range (1,3] represents the substring "bc", and the
|
||||
/// range (2,2] represents an empty range between the characters "b" and "c".
|
||||
class SMRange {
|
||||
public:
|
||||
SMLoc Start, End;
|
||||
|
Reference in New Issue
Block a user