[PATCH] D73392: [Support] Split MallocAllocator out of Allocator.h

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 24 16:36:15 PST 2020


rnk created this revision.
rnk added reviewers: MaskRay, hans.
Herald added subscribers: dexonsmith, hiraditya.
Herald added a project: LLVM.

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D73392

Files:
  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
  llvm/include/llvm/Support/BinaryStreamReader.h
  llvm/include/llvm/Support/Process.h
  llvm/lib/IR/SafepointIRVerifier.cpp
  llvm/unittests/Support/BinaryStreamTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73392.240326.patch
Type: text/x-patch
Size: 14327 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200125/60ebf90f/attachment.bin>


More information about the llvm-commits mailing list