================
@@ -0,0 +1,75 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+///
+/// Precompiled header for LLVMSupport.
+///
+//===----------------------------------------------------------------------===//
+
+#include "llvm/ADT/ADL.h"
+#include "llvm/ADT/APFloat.h"
+#include "llvm/ADT/APInt.h"
+#include "llvm/ADT/APSInt.h"
+#include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/BitVector.h"
+#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/Hashing.h"
+#include "llvm/ADT/STLExtras.h"
+#include "llvm/ADT/SetVector.h"
+#include "llvm/ADT/SmallString.h"
+#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/Statistic.h"
+#include "llvm/ADT/StringExtras.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/Twine.h"
----------------
aengelke wrote:
I looked at the output of -ftime-trace of a full Clang+LLVM build, sorted by
time spent in parsing (including transitively included headers), and selected
headers that showed up high in that list. This is obviously not accurate, but
was sufficient for the initial RFC. That's also how headers like JSON ended up
in the list: it isn't used much, but it takes ~180ms to parse+instantiate
templates (although I'm unsure whether it's a net win to have it in the PCH).
The includes of Clang+LLVM by counts (cut off at 100, output by `ninja -t
deps`) and current PCH status is below. The numbers can, however, be slightly
misleading: llvm/ADT/ilist_node.h is used 2631 times, but in >=2205 cases, this
will be pulled in by Instruction.h, which will get part of the llvm/IR PCH.
(NB: MathExtras is currently transitively included, SmallVectorExtras is only
used in 6 CUs in Clang+LLVM.)
We can certainly adjust the list, consider this to be a
not-particularly-optimized initial proposal. I'm not sure if we want to invest
a lot of time in tooling to determine an ideal PCH set, however, as it is a
very complex and multi-dimensional optimization problem.
```
5322 PCH llvm/Support/Compiler.h
5280 PCH llvm/ADT/STLForwardCompat.h
5275 PCH llvm/ADT/STLFunctionalExtras.h
5275 PCH llvm/ADT/DenseMapInfo.h
5275 PCH llvm/ADT/ADL.h
5273 PCH llvm/ADT/iterator_range.h
5265 PCH llvm/Support/DataTypes.h
5251 PCH llvm/ADT/SmallVector.h
5250 PCH llvm/Support/ErrorHandling.h
5245 PCH llvm/ADT/bit.h
5239 PCH llvm/Support/type_traits.h
5232 PCH llvm/ADT/StringRef.h
5229 PCH llvm/Support/SwapByteOrder.h
5228 PCH llvm/ADT/Hashing.h
5220 PCH llvm/ADT/iterator.h
5218 PCH llvm/ADT/STLExtras.h
5121 PCH llvm/Support/MathExtras.h
5103 PCH llvm/Support/raw_ostream.h
5048 PCH llvm/ADT/ArrayRef.h
4960 PCH llvm/Support/MemAlloc.h
4925 PCH llvm/Support/PointerLikeTypeTraits.h
4822 PCH llvm/Support/ReverseIteration.h
4821 PCH llvm/ADT/EpochTracker.h
4815 PCH llvm/Support/AlignOf.h
4797 PCH llvm/ADT/Twine.h
4797 PCH llvm/ADT/DenseMap.h
4660 PCH llvm/ADT/SmallString.h
4572 PCH llvm/Support/Alignment.h
4557 PCH llvm/Support/ErrorOr.h
4536 PCH llvm/Support/Debug.h
4506 PCH llvm/Support/Format.h
4490 PCH llvm/Support/AllocatorBase.h
4402 PCH llvm/Support/Error.h
4381 PCH llvm/Support/Casting.h
4229 PCH llvm/ADT/StringMapEntry.h
4218 PCH llvm/Support/float128.h
4218 PCH llvm/ADT/APInt.h
4195 PCH llvm/ADT/StringMap.h
4102 PCH llvm/Support/Allocator.h
4093 PCH llvm/ADT/StringSwitch.h
4036 PCH llvm/ADT/BitmaskEnum.h
4004 PCH llvm/ADT/DenseSet.h
3893 PCH llvm/Support/CBindingWrapping.h
3870 llvm/ADT/PointerIntPair.h
3850 PCH llvm/Support/VersionTuple.h
3811 PCH llvm/ADT/APSInt.h
3670 PCH llvm/ADT/StringExtras.h
3587 llvm/ADT/PointerUnion.h
3479 llvm/Support/CodeGen.h
3393 PCH llvm/ADT/SmallPtrSet.h
3231 PCH llvm/ADT/FloatingPointMode.h
3214 llvm/Support/TypeSize.h
3205 llvm/ADT/Sequence.h
3125 PCH llvm/ADT/BitVector.h
3110 PCH llvm/Support/Endian.h
3085 llvm/Support/TrailingObjects.h
3052 PCH llvm/Support/SMLoc.h
3051 llvm/Support/AtomicOrdering.h
3050 llvm/ADT/MapVector.h
2913 PCH llvm/ADT/APFloat.h
2865 PCH llvm/Support/MemoryBufferRef.h
2833 llvm/ADT/TinyPtrVector.h
2812 PCH llvm/Support/MemoryBuffer.h
2807 PCH llvm/Support/StringSaver.h
2760 PCH llvm/ADT/IntrusiveRefCntPtr.h
2675 PCH llvm/ADT/SetVector.h
2640 llvm/ADT/StringTable.h
2633 llvm/ADT/ilist_node_base.h
2631 llvm/ADT/ilist_node_options.h
2631 llvm/ADT/ilist_node.h
2621 llvm/ADT/ilist_base.h
2620 llvm/ADT/simple_ilist.h
2620 llvm/ADT/ilist_iterator.h
2604 llvm/Support/Compression.h
2593 llvm/ADT/ilist.h
2501 llvm/ADT/GraphTraits.h
2480 llvm/ADT/FunctionExtras.h
2383 PCH llvm/Support/CommandLine.h
2370 PCH llvm/Support/FormatVariadicDetails.h
2289 llvm/Support/xxhash.h
2273 PCH llvm/Support/SourceMgr.h
2272 llvm/ADT/Bitfields.h
2247 llvm/Support/ModRef.h
2206 llvm/ADT/StringSet.h
2201 llvm/Support/Threading.h
2105 PCH llvm/Support/MD5.h
2105 llvm/ADT/FoldingSet.h
1939 llvm/Support/TypeName.h
1777 llvm/Support/RWMutex.h
1763 PCH llvm/Support/FileSystem/UniqueID.h
1753 PCH llvm/Support/NativeFormatting.h
1748 PCH llvm/Support/FormatProviders.h
1601 llvm/Support/Printable.h
1590 llvm/Support/Recycler.h
1570 llvm/Support/BranchProbability.h
1557 llvm/Support/Discriminator.h
1529 llvm/ADT/SmallSet.h
1395 PCH llvm/Support/Chrono.h
1386 PCH llvm/Support/FileSystem.h
1299 llvm/Support/UniqueBBID.h
1293 llvm/Support/Path.h
1276 llvm/Support/RecyclingAllocator.h
1260 llvm/ADT/SparseBitVector.h
1210 llvm/Support/TargetOpcodes.def
1209 llvm/ADT/PointerSumType.h
1207 llvm/Support/ArrayRecycler.h
1189 llvm/Support/DXILABI.h
1171 llvm/Support/HashBuilder.h
1151 llvm/Support/AllocToken.h
1109 llvm/Support/Errc.h
1078 llvm/ADT/CachedHashString.h
1074 llvm/Support/ExtensibleRTTI.h
1040 llvm/Support/PrettyStackTrace.h
1038 llvm/ADT/Uniformity.h
1011 llvm/Support/raw_os_ostream.h
956 llvm/ADT/IndexedMap.h
951 llvm/Support/AMDGPUAddrSpace.h
951 llvm/ADT/GenericSSAContext.h
942 llvm/ADT/GenericCycleInfo.h
939 llvm/Support/PGOOptions.h
916 llvm/Support/Mutex.h
916 llvm/ADT/APFixedPoint.h
899 llvm/Support/VirtualFileSystem.h
885 llvm/ADT/StableHashing.h
842 llvm/ADT/SmallBitVector.h
804 llvm/ADT/Bitset.h
801 llvm/Support/Regex.h
788 llvm/Support/KnownFPClass.h
756 llvm/ADT/DepthFirstIterator.h
717 llvm/ADT/PagedVector.h
694 llvm/Support/GenericDomTree.h
694 llvm/Support/CFGUpdate.h
694 llvm/Support/CFGDiff.h
693 llvm/Support/DynamicLibrary.h
688 llvm/Support/BlockFrequency.h
613 PCH llvm/Support/FormatVariadic.h
613 PCH llvm/Support/FormatCommon.h
597 llvm/Support/Registry.h
552 llvm/Support/Hash.h
476 llvm/ADT/PostOrderIterator.h
471 llvm/ADT/IntervalMap.h
450 PCH llvm/Support/YAMLParser.h
443 llvm/Support/ConvertUTF.h
434 PCH llvm/Support/YAMLTraits.h
433 PCH llvm/ADT/Statistic.h
414 llvm/Support/FormattedStream.h
398 llvm/ADT/SetOperations.h
395 llvm/Support/ELFAttributes.h
393 llvm/Support/BinaryStreamError.h
392 llvm/Support/BinaryStream.h
378 llvm/Support/GenericLoopInfo.h
353 llvm/Support/KnownBits.h
340 llvm/Support/InstructionCost.h
340 llvm/Support/BinaryStreamRef.h
335 llvm/Support/BinaryStreamArray.h
332 llvm/Support/BinaryStreamReader.h
321 llvm/Support/ARMBuildAttributes.h
320 llvm/Support/WithColor.h
308 llvm/Support/GenericLoopInfoImpl.h
301 llvm/Support/Timer.h
285 llvm/Support/SaveAndRestore.h
273 llvm/Support/FileCollector.h
270 llvm/Support/Signals.h
268 llvm/Support/VirtualOutputConfig.h
268 llvm/Support/VirtualOutputConfig.def
266 llvm/Support/VirtualOutputFile.h
264 llvm/Support/VirtualOutputBackend.h
262 llvm/Support/BuryPointer.h
257 llvm/Support/DataExtractor.h
252 llvm/Support/Program.h
243 PCH llvm/Support/JSON.h
232 llvm/Support/BinaryStreamWriter.h
217 llvm/ADT/ImmutableSet.h
213 llvm/Support/Memory.h
206 llvm/ADT/ImmutableMap.h
202 llvm/ADT/ImmutableList.h
186 llvm/Support/MSVCErrorWorkarounds.h
185 llvm/Support/TargetSelect.h
184 llvm/ADT/Any.h
172 llvm/Testing/Support/SupportHelpers.h
170 llvm/Support/EndianStream.h
169 llvm/Support/FileOutputBuffer.h
164 llvm/Support/ManagedStatic.h
163 llvm/Support/LEB128.h
157 llvm/ADT/SparseSet.h
155 llvm/Support/Process.h
154 llvm/Support/ScopedPrinter.h
150 llvm/Support/BinaryByteStream.h
150 llvm/ADT/fallible_iterator.h
149 llvm/Testing/Support/Error.h
147 llvm/ADT/EquivalenceClasses.h
107 llvm/Support/CheckedArithmetic.h
103 llvm/ADT/SparseMultiSet.h
100 llvm/ADT/IntEqClasses.h
```
https://github.com/llvm/llvm-project/pull/176420
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits