[all-commits] [llvm/llvm-project] bc8836: Forward declare FileEntry and DirectoryEntry in Mo...

Reid Kleckner via All-commits all-commits at lists.llvm.org
Thu Feb 27 10:24:38 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: bc8836651fba3304d92e1025ff6a918f25e9e209
      https://github.com/llvm/llvm-project/commit/bc8836651fba3304d92e1025ff6a918f25e9e209
  Author: Reid Kleckner <rnk at google.com>
  Date:   2020-02-27 (Thu, 27 Feb 2020)

  Changed paths:
    M clang/include/clang/Basic/Module.h
    M clang/include/clang/Serialization/ModuleFile.h
    M clang/lib/Basic/Module.cpp
    M clang/lib/Lex/ModuleMap.cpp

  Log Message:
  -----------
  Forward declare FileEntry and DirectoryEntry in Module.h

FileManager.h is an expensive header (~350ms for me in isolation), so
try to do without it.

Notably, we need to avoid checking the alignment of FileEntry, which
happens for DenseMap<FileEntry*> and PointerUnion<FileEntry*>. I
adjusted the code to avoid PointerUnion, and moved the DenseMap
insertion to the .cpp file.

Globally, this only saved about ~17 includes of the related headers
because SourceManager.h still includes FileManager.h, and it is more
popular than Module.h.




More information about the All-commits mailing list