aboutsummaryrefslogtreecommitdiff
path: root/lib/Support/SourceMgr.cpp
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2013-01-07 19:00:49 +0000
committerJordan Rose <jordan_rose@apple.com>2013-01-07 19:00:49 +0000
commit3ebe59c892051375623fea55e977ff559fdb3323 (patch)
tree57c29e90762855b6aacd9a7341a1db0bcf526be1 /lib/Support/SourceMgr.cpp
parent7aa1c321f00d29fdc84e9a03080853aa25dd06fc (diff)
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
Diffstat (limited to 'lib/Support/SourceMgr.cpp')
-rw-r--r--lib/Support/SourceMgr.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Support/SourceMgr.cpp b/lib/Support/SourceMgr.cpp
index 6580137569..65403197c7 100644
--- a/lib/Support/SourceMgr.cpp
+++ b/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] = '~';
}