[clang] [clang][Diagnostics] Highlight code snippets (PR #66514)

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 24 10:47:39 PDT 2023


Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>
Message-ID:
In-Reply-To: <llvm/llvm-project/pull/66514/clang at github.com>


tbaederr wrote:

> > I've already switched to the max file size variant now, is that alright or do you want me to pursue the checkpoint version again?
> 
> Oh wow, there was a failure of communication somewhere. Having checkpoints, AND disabling it entirely for large files is what i thought we were going to do.

No, my point was that we can do it for "small" (but actually large) source files in a few milliseconds per diagnostic, so not a problem, but for larger files (generated or from a unity build) files, it might become too slow. So if we just limit ourselves to, let's say, 1MB files, then it's feasible. The implementation of this is easier, and, most importantly, it has no negative effect on lexing.

The check point approach makes regular lexing slower - even if we reserve the 1000 checkpoints as you mentioned, we still add more overhead for ever token we lex (how much overhead depends of course).

https://github.com/llvm/llvm-project/pull/66514


More information about the cfe-commits mailing list