This revision was automatically updated to reflect the committed changes.
Closed by commit rCTE344735: [clangd] Encode Line/Column as a 32-bits integer.
(authored by hokein, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D53363?vs=170053=170064#toc
Repository:
rCTE Clang
hokein added a comment.
> In https://reviews.llvm.org/D53363#1267721, @hokein wrote:
>
>> Yeah, I have a rough patch for it, using char* will save us ~50MB memory,
>> which will lead to ~300 MB memory usage in total.
>
>
> For just the StringRef in SymbolLocation::Position, or for all our
hokein updated this revision to Diff 170053.
hokein marked 6 inline comments as done.
hokein added a comment.
Address review comments.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D53363
Files:
clangd/FindSymbols.cpp
clangd/XRefs.cpp
clangd/index/Index.cpp
sammccall accepted this revision.
sammccall added a comment.
This revision is now accepted and ready to land.
Nice, just nits!
In https://reviews.llvm.org/D53363#1267721, @hokein wrote:
> Yeah, I have a rough patch for it, using char* will save us ~50MB memory,
> which will lead to ~300 MB
hokein added a comment.
In https://reviews.llvm.org/D53363#1267628, @sammccall wrote:
> (I think your math is off in the description: 20 bits should be 1M lines, not
> 4M)
Oops...Update the desccription.
> I think this is a win, as I think truncation will be rare and not terrible.
> We
hokein updated this revision to Diff 170001.
hokein marked 3 inline comments as done.
hokein added a comment.
Address review comments:
- handle overflowed cases, and added tests
- add getter/setters for line/column and clear all call sides
Repository:
rCTE Clang Tools Extra
sammccall added a comment.
(I think your math is off in the description: 20 bits should be 1M lines, not
4M)
I think this is a win, as I think truncation will be rare and not terrible. We
should document the intentions around truncation though.
Incidentally, this means replacing just the
hokein created this revision.
hokein added a reviewer: sammccall.
Herald added subscribers: kadircet, arphaman, jkorous, MaskRay, ioeric,
ilya-biryukov.
This would buy us more memory. Using a 32-bits integer is enough for
most human-readable source code (up to 4M lines and 4K columns).