[PATCH] D143142: [clang][lex] Enable Lexer to grow its buffer
Thorsten via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 20 02:55:42 PST 2023
tschuett added inline comments.
================
Comment at: clang/include/clang/Lex/Lexer.h:89
- // End of the buffer.
- const char *BufferEnd;
+ // Size of the buffer.
+ unsigned BufferSize;
----------------
cor3ntin wrote:
> Should that use `SourceLocation::UIntTy`?
> Looking at comments in SourceManager, I think there was an attempt at supporting > 2GB file but I don't think it got anywhere.
> Nevertheless, using `SourceLocation::UIntTy` would arguably be more consistent
>
> It does seem to be a huge undertaking to change it though, I'm not sure it would be worth it at all. There would be far bigger issues with ridiculously large source files anyway.
I am a bit afraid that unsigned has different sizes on different platforms. At least a `using BufferOffsetType = uint64_t;` would be nice.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D143142/new/
https://reviews.llvm.org/D143142
More information about the cfe-commits
mailing list