diff options
author | Jan Svoboda <jan_svoboda@apple.com> | 2023-11-02 15:07:58 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-02 15:07:58 -0700 |
commit | 6c465a201b02f3316efc55eef6909080866f6fb0 (patch) | |
tree | 0c1eeb9076b59921fc22fe4e2eb37e40c5dbea0a /clang/lib/Frontend/FrontendActions.cpp | |
parent | 8750239256cfad8fc5ffd7e158a787ed67e0b444 (diff) | |
download | llvm-6c465a201b02f3316efc55eef6909080866f6fb0.zip llvm-6c465a201b02f3316efc55eef6909080866f6fb0.tar.gz llvm-6c465a201b02f3316efc55eef6909080866f6fb0.tar.bz2 |
[clang][deps] Skip slow `UNHASHED_CONTROL_BLOCK` records (#69975)
Deserialization of the `DIAGNOSTIC_OPTIONS` and `HEADER_SEARCH_PATHS`
records is slow and done for every transitively loaded PCM.
Deserialization of these records cannot be skipped, because the words
are VBR6-encoded and we don't store the length of the entire record. We
could either turn them into binary blobs that can be skipped during
deserialization, or skip writing them altogether. This patch takes the
latter approach, since these records are not necessary in scanning PCMs.
The scanner doesn't make any guarantees about the accuracy of
diagnostics, and we always have the same header search paths due to
strict context hashing.
The commit that makes the `DIAGNOSTIC_OPTIONS` record skippable was
originally implemented by @benlangmuir in a downstream repo.
Diffstat (limited to 'clang/lib/Frontend/FrontendActions.cpp')
-rw-r--r-- | clang/lib/Frontend/FrontendActions.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/lib/Frontend/FrontendActions.cpp b/clang/lib/Frontend/FrontendActions.cpp index ce6e0b7..2afcf1c 100644 --- a/clang/lib/Frontend/FrontendActions.cpp +++ b/clang/lib/Frontend/FrontendActions.cpp @@ -661,6 +661,21 @@ namespace { return false; } + bool ReadHeaderSearchPaths(const HeaderSearchOptions &HSOpts, + bool Complain) override { + Out.indent(2) << "Header search paths:\n"; + Out.indent(4) << "User entries:\n"; + for (const auto &Entry : HSOpts.UserEntries) + Out.indent(6) << Entry.Path << "\n"; + Out.indent(4) << "System header prefixes:\n"; + for (const auto &Prefix : HSOpts.SystemHeaderPrefixes) + Out.indent(6) << Prefix.Prefix << "\n"; + Out.indent(4) << "VFS overlay files:\n"; + for (const auto &Overlay : HSOpts.VFSOverlayFiles) + Out.indent(6) << Overlay << "\n"; + return false; + } + bool ReadPreprocessorOptions(const PreprocessorOptions &PPOpts, bool ReadMacros, bool Complain, std::string &SuggestedPredefines) override { |