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

via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 24 05:25: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>


cor3ntin wrote:

> Kind of - [this run](http://llvm-compile-time-tracker.com/compare.php?from=6ade5183232dc1398205d7c9dbe21243b2560837&to=5ad516d39b6706af6fd55eded264aba4ba432ad2&stat=instructions:u) only shows noticeable slowdown in one test. But we also only highlight the main file right now - that means we don't get syntax highlighting in included files and implementing that would probably make it a bit slower as well since we'd have to map the save points to their FileID.

I think we should do it for includes to.
Did you play with `reserve`? I think it would be reasonable to preallocate maybe ~1k check points - which should just be 8kb per file, which would be reasonable

> Regardless of the approach we take in the end - what do you think about tests for this? Should we have a flag similar to `-fdiagnostics-print-source-range-info` for the code style ranges?

I have no opinion. @AaronBallman ?


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


More information about the cfe-commits mailing list