[Support] Split MallocAllocator out of Allocator.h
authorReid Kleckner <rnk@google.com>
Fri, 24 Jan 2020 23:47:33 +0000 (15:47 -0800)
committerReid Kleckner <rnk@google.com>
Sat, 25 Jan 2020 01:29:32 +0000 (17:29 -0800)
commit0697bcb66f1d82f2fd447e9d13b74d141c3ce085
tree01fbc7517fd3682d070acd3c53862eb71904f8e8
parent3da47749ddd0cfcaa829137a2329a67e20def937
[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
16 files changed:
llvm/include/llvm/ADT/ScopedHashTable.h
llvm/include/llvm/ADT/SparseSet.h
llvm/include/llvm/ADT/StringMap.h
llvm/include/llvm/ADT/StringSet.h
llvm/include/llvm/BinaryFormat/MachO.h
llvm/include/llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h
llvm/include/llvm/DebugInfo/PDB/Native/SymbolCache.h
llvm/include/llvm/Object/IRSymtab.h
llvm/include/llvm/ProfileData/SampleProf.h
llvm/include/llvm/Remarks/RemarkStringTable.h
llvm/include/llvm/Support/Allocator.h
llvm/include/llvm/Support/AllocatorBase.h [new file with mode: 0644]
llvm/include/llvm/Support/BinaryStreamReader.h
llvm/include/llvm/Support/Process.h
llvm/lib/IR/SafepointIRVerifier.cpp
llvm/unittests/Support/BinaryStreamTest.cpp