Remove the DenseMapInfo<std::variant<Ts...>> variant out from
llvm/ADT/DenseMapInfo.h into a separate header
llvm/ADT/DenseMapInfoVariant.h
This allows us to remove the <variant> include, which is being
transitively and unncessary included in all translation units that
include llvm/ADT/DenseMap.h.
There have been similar changes to move out specializations for
- APInt.h fd7e309e02fd226b0390888388ed732608e52c73 and
- StringRef.h/ArrayRef.h 983565a6fe4a9f40c7caf82b65c650c20dbcc104
to reduce the compilation time. As we are unable to move the
specialization into <variant>, we create a separate
DenseMapInfoVariant.h header that can be used by anyone who needs this
specialization.
This reduces the total number of preprocessing tokens across the LLVM
source files in lib from (roughly) 1,964,876,961 to 1,936,551,496 - a
reduction of ~1.44%. This should result in a small improvement in
compilation time.
Regardless of this change, I think the equality here needs to be fixed in the future to delegate to DenseMapInfo for checking equality of the contents of the std::variant