[all-commits] [llvm/llvm-project] 0697bc: [Support] Split MallocAllocator out of Allocator.h

Reid Kleckner via All-commits all-commits at lists.llvm.org
Fri Jan 24 17:35:04 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 0697bcb66f1d82f2fd447e9d13b74d141c3ce085
      https://github.com/llvm/llvm-project/commit/0697bcb66f1d82f2fd447e9d13b74d141c3ce085
  Author: Reid Kleckner <rnk at google.com>
  Date:   2020-01-24 (Fri, 24 Jan 2020)

  Changed paths:
    M llvm/include/llvm/ADT/ScopedHashTable.h
    M llvm/include/llvm/ADT/SparseSet.h
    M llvm/include/llvm/ADT/StringMap.h
    M llvm/include/llvm/ADT/StringSet.h
    M llvm/include/llvm/BinaryFormat/MachO.h
    M llvm/include/llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h
    M llvm/include/llvm/DebugInfo/PDB/Native/SymbolCache.h
    M llvm/include/llvm/Object/IRSymtab.h
    M llvm/include/llvm/ProfileData/SampleProf.h
    M llvm/include/llvm/Remarks/RemarkStringTable.h
    M llvm/include/llvm/Support/Allocator.h
    A llvm/include/llvm/Support/AllocatorBase.h
    M llvm/include/llvm/Support/BinaryStreamReader.h
    M llvm/include/llvm/Support/Process.h
    M llvm/lib/IR/SafepointIRVerifier.cpp
    M llvm/unittests/Support/BinaryStreamTest.cpp

  Log Message:
  -----------
  [Support] Split MallocAllocator out of Allocator.h

StringMap.h is very popular (4K uses), and it doesn't need to see
BumpPtrAllocator, which is relatively expensive according to
ClangBuildAnalyzer. StringMap only needs MallocAllocator, so split that
into AllocatorBase.h and use it instead.

Here is the change in header uses:
$ diff -u thedeps-before.txt thedeps-after.txt | \
    grep '^[-+] ' |  sort | uniq -c | sort -nr
   3993 +    ../llvm/include/llvm/Support/AllocatorBase.h
    758 -    ../llvm/include/llvm/Support/Allocator.h
    270 -    ../llvm/include/llvm/Support/Alignment.h
     13 -    ../llvm/include/llvm/Support/Host.h
      6 -    ../llvm/include/llvm/ADT/StringMap.h
      4 -    ../llvm/include/llvm/Support/SwapByteOrder.h
      4 -    ../llvm/include/llvm/Support/MathExtras.h
      4 -    ../llvm/include/llvm/Support/AlignOf.h
      4 -    ../llvm/include/llvm/ADT/SmallVector.h
      1 -    ../llvm/include/llvm/Support/PointerLikeTypeTraits.h

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D73392




More information about the All-commits mailing list