[PATCH] D114093: [clang][lex] Refactor check for the first file include

Jan Svoboda via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 17 08:18:38 PST 2021


jansvoboda11 created this revision.
jansvoboda11 added reviewers: Bigcheese, dexonsmith, vsapsai.
jansvoboda11 requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

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 <https://reviews.llvm.org/D114092>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D114093

Files:
  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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114093.387948.patch
Type: text/x-patch
Size: 10347 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20211117/9612a90a/attachment-0001.bin>


More information about the cfe-commits mailing list