[llvm-commits] [PATCH] Change SMRange to be half-open (exclusive end)

Jordan Rose jordan_rose at apple.com
Thu Jan 3 13:25:36 PST 2013


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.

Jordan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Change-SMRange-to-be-half-open-exclusive-end-instead.patch
Type: application/octet-stream
Size: 50128 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130103/383cc542/attachment.obj>


More information about the llvm-commits mailing list