[Lexer] NFC: Fix an off-by-one bug in getAsCharRange().
authorArtem Dergachev <artem.dergachev@gmail.com>
Fri, 5 Apr 2019 21:48:52 +0000 (21:48 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Fri, 5 Apr 2019 21:48:52 +0000 (21:48 +0000)
commit1dfd74ac4a16a9b18b1c34ec427f5545e1645c13
treea03b07200c0edeaf88dcd603f9af27c5f1c8d7e9
parentc76b6215302f42c1ebdc5dfff3a875403f6abb67
[Lexer] NFC: Fix an off-by-one bug in getAsCharRange().

As the unit test demonstrates, subtracting 1 from the offset was unnecessary.

The only user of this function was the plist file emitter (in Static Analyzer
and ARCMigrator). It means that a lot of Static Analyzer's plist arrows
are in fact off by one character. The patch carefully preserves this
completely incorrect behavior and causes no functional change,
i.e. no plist format breakage.

Differential Revision: https://reviews.llvm.org/D59977

llvm-svn: 357823
clang/include/clang/Basic/PlistSupport.h
clang/include/clang/Lex/Lexer.h
clang/unittests/Lex/LexerTest.cpp