Commit 897f3ddc authored by Sam McCall's avatar Sam McCall
Browse files

[Sema] Move Diags.isIgnored() checks off hot paths, it's not free. NFC

This speeds up clangd's buildAST() (i.e. parsing with a preamble) by 5% on
clangd/AST.cpp, by avoiding filling up the diagnostic state map with entries for
all the files where templates are being instantiated from.

(I would assume it has a similar effect on PCH and modules compiles).

This approach is obviously pretty fragile, and we should find ways to make
isIgnored() cheaper instead. But these changes in particular don't seem to make
the code worse in any case.

Differential Revision: https://reviews.llvm.org/D129683
parent fb9fc798
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment