[all-commits] [llvm/llvm-project] f357a4: [clang][lex] Store `HeaderFileInfo` in a `DenseMap...

Jan Svoboda via All-commits all-commits at lists.llvm.org
Thu Jun 4 10:50:11 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f357a470de89660b6a887abc95f6a15aae205e64
      https://github.com/llvm/llvm-project/commit/f357a470de89660b6a887abc95f6a15aae205e64
  Author: Jan Svoboda <jan_svoboda at apple.com>
  Date:   2026-06-04 (Thu, 04 Jun 2026)

  Changed paths:
    M clang/include/clang/Basic/FileManager.h
    M clang/include/clang/Lex/HeaderSearch.h
    M clang/lib/Basic/FileManager.cpp
    M clang/lib/Lex/HeaderSearch.cpp
    M clang/lib/Serialization/ASTWriter.cpp

  Log Message:
  -----------
  [clang][lex] Store `HeaderFileInfo` in a `DenseMap` (#200968)

Calling `FileManager::GetUniqueIDMapping()` during modular builds gets
very expensive if the `FileManager` has seen lots of files. This
function is used in two places in the `ASTWriter` to look up
`HeaderFileInfo` in `HeaderSearch`.

This PR changes the storage of `HeaderFileInfo` from
`FileEntry::getUID()`-indexed `std::vector<T>` to
`llvm::DenseMap<FileEntryRef, T>`, improving scanning performance by
~2.5%.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list