[llvm-commits] [PATCH] Change SMRange to be half-open (exclusive end)
Jordan Rose
jordan_rose at apple.com
Mon Jan 7 11:01:30 PST 2013
On Jan 4, 2013, at 18:01 , Chris Lattner <clattner at apple.com> wrote:
>
> On Jan 3, 2013, at 1:25 PM, Jordan Rose <jordan_rose at apple.com> wrote:
>
>> Happy new year, everyone. Here's my half-open SMRange patch again, now with correct fixes for all the asm parsers. A repeat of the justification:
>>
>> - More consistent with C++ (begin() and end()).
>> - Empty ranges are useful to represent insertions (for my upcoming revised fixit patch)
>> - It is unclear what it means if the last character of a range is a multibyte character -- does the pointer refer to the start of the character, or the last byte in the character?
>> - It looks like some of the AsmParser uses of SMRange were already assuming this.
>>
>> This touches a lot of AsmParser code, but it should only be modifying source locations (in some cases the source fidelity will improve because I cleaned the logic up a bit; in others it may actually slip a bit since one-character tokens can no longer be represented by an [X, X] range). If anyone wants to look over the AsmParser changes, or to comment on the change in general, please reply; otherwise I'll check this in tomorrow.
>
> It's a big patch, but LGTM!
Committed in r171765.
More information about the llvm-commits
mailing list