[clang][lex] Refactor check for the first file include
authorJan Svoboda <jan_svoboda@apple.com>
Thu, 18 Nov 2021 11:34:54 +0000 (12:34 +0100)
committerJan Svoboda <jan_svoboda@apple.com>
Thu, 18 Nov 2021 12:01:07 +0000 (13:01 +0100)
commit197576c40986085cbd5250283e1e80a2679c9cf0
treeb7e8a80342b674d96a2b4581cfbe1b031beca997
parent7b6790850968031fe1c098ed6dcc196ddc547ea5
[clang][lex] Refactor check for the first file include

This patch refactors the code that checks whether a file has just been included for the first time.

The `HeaderSearch::FirstTimeLexingFile` function is removed and the information is threaded to the original call site from `HeaderSearch::ShouldEnterIncludeFile`. This will make it possible to avoid tracking the number of includes in a follow up patch.

Depends on D114092.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D114093
clang/include/clang/Lex/HeaderSearch.h
clang/include/clang/Lex/Lexer.h
clang/include/clang/Lex/Preprocessor.h
clang/lib/Lex/HeaderSearch.cpp
clang/lib/Lex/Lexer.cpp
clang/lib/Lex/PPDirectives.cpp
clang/lib/Lex/PPLexerChange.cpp