[clang] [Modules] [HeaderSearch] Don't reenter headers if it is pragma once (PR #76119)
Volodymyr Sapsai via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 23 14:45:32 PST 2024
================
@@ -1458,7 +1458,7 @@ bool HeaderSearch::ShouldEnterIncludeFile(Preprocessor &PP,
} else {
// Otherwise, if this is a #include of a file that was previously #import'd
// or if this is the second #include of a #pragma once file, ignore it.
- if ((FileInfo.isPragmaOnce || FileInfo.isImport) && !TryEnterImported())
----------------
vsapsai wrote:
Technically, `TryEnterImported` can be inlined at another call site but I think it's not worth it and we can keep things the way you have in PR.
https://github.com/llvm/llvm-project/pull/76119
More information about the cfe-commits
mailing list