[clang] [clang][Diagnostics] Only record lexer check points when colors are enabled (PR #204926)
Yihan Wang via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 9 02:20:03 PDT 2026
================
@@ -383,6 +383,9 @@ class Preprocessor {
llvm::DenseMap<FileID, SmallVector<const char *>> CheckPoints;
unsigned CheckPointCounter = 0;
+ /// Whether to record lexer check points for diagnostic snippet highlighting.
+ bool RecordCheckPoints = false;
----------------
yronglin wrote:
IIUC, this change shouldn't have a significant performance impact; it simply reduces the number of flags in the Preprocessor. Since it's exactly the same as ShowColors, I tend to use ShowColors directly. If whether to record check points is determined by multiple conditions, then I'd prefer to add a new flag.
https://github.com/llvm/llvm-project/pull/204926
More information about the cfe-commits
mailing list