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

via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 25 13:38:18 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>
Message-ID:
In-Reply-To: <llvm/llvm-project/pull/66514/clang at github.com>


cor3ntin wrote:

> > I have concerns about Lexing twice every single file for which we display a warning.
> 
> Sure. Because of performance, memory usage or code complexity?
> 

Performance, mostly

> So, my general procedure for diagnostics is that they shouldn't complicate the non-diagnostic code. And when we emit a diagnostic, performance is basically out the window anyway (printing to stdout is _slow_ and the way we emit code snippets is also slow, etc.)

That is generally true, but how far do want to push that logic? Lexing is going to be fairly expensive on most source files. I'd expect it to be much more (cpu) expensive than a call to print.

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


More information about the cfe-commits mailing list