diff options
author | Sam McCall <sam.mccall@gmail.com> | 2017-12-19 12:23:48 +0000 |
---|---|---|
committer | Sam McCall <sam.mccall@gmail.com> | 2017-12-19 12:23:48 +0000 |
commit | b536a2a5ba0958619b6e9ce6304f863845eeda30 (patch) | |
tree | 9d7ee07f6bdc9dd7c5135f764e139a7a185a1a75 /llvm/lib/CodeGen/MachineOperand.cpp | |
parent | 110844d21ceece1c2624c7386111d4867cf35b81 (diff) | |
download | llvm-b536a2a5ba0958619b6e9ce6304f863845eeda30.zip llvm-b536a2a5ba0958619b6e9ce6304f863845eeda30.tar.gz llvm-b536a2a5ba0958619b6e9ce6304f863845eeda30.tar.bz2 |
[clangd] Expose offset <-> LSP position functions, and fix bugs
Summary:
- Moved these functions to SourceCode.h
- added unit tests
- fix off by one in positionToOffset: Offset - 1 in final calculation was wrong
- fixed formatOnType which had an equal and opposite off-by-one
- positionToOffset and offsetToPosition both consistently clamp to beginning/end
of file when input is out of range
- gave variables more descriptive names
- removed windows line ending fixmes where there is nothing to fix
- elaborated on UTF-8 fixmes
This will conflict with Eric's D41281, but in a pretty easy-to-resolve way.
Reviewers: ioeric
Subscribers: klimek, mgorny, ilya-biryukov, cfe-commits
Differential Revision: https://reviews.llvm.org/D41351
llvm-svn: 321073
Diffstat (limited to 'llvm/lib/CodeGen/MachineOperand.cpp')
0 files changed, 0 insertions, 0 deletions