diff options
author | Jordan Rose <jordan_rose@apple.com> | 2013-01-07 19:00:49 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2013-01-07 19:00:49 +0000 |
commit | e8f1eaea8ac513530fd7ce4c2f0d46cc77f9e540 (patch) | |
tree | b76e2384c32ecddf26166d3b0f3d80432143022f /llvm/lib/Support/SourceMgr.cpp | |
parent | 4fb504fec1a97be27e1130ab53aa169120339464 (diff) | |
download | bcm5719-llvm-e8f1eaea8ac513530fd7ce4c2f0d46cc77f9e540.tar.gz bcm5719-llvm-e8f1eaea8ac513530fd7ce4c2f0d46cc77f9e540.zip |
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.
llvm-svn: 171765
Diffstat (limited to 'llvm/lib/Support/SourceMgr.cpp')
-rw-r--r-- | llvm/lib/Support/SourceMgr.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Support/SourceMgr.cpp b/llvm/lib/Support/SourceMgr.cpp index 65801375691..65403197c7b 100644 --- a/llvm/lib/Support/SourceMgr.cpp +++ b/llvm/lib/Support/SourceMgr.cpp @@ -304,7 +304,7 @@ void SMDiagnostic::print(const char *ProgName, raw_ostream &S, for (unsigned r = 0, e = Ranges.size(); r != e; ++r) { std::pair<unsigned, unsigned> R = Ranges[r]; for (unsigned i = R.first, - e = std::min(R.second, (unsigned)LineContents.size())+1; i != e; ++i) + e = std::min(R.second, (unsigned)LineContents.size()); i != e; ++i) CaretLine[i] = '~'; } |