[llvm] Move AttributeMask to a separate header
authorElliot Goodrich <elliotgoodrich@gmail.com>
Sun, 25 Jun 2023 17:04:47 +0000 (18:04 +0100)
committerElliot Goodrich <elliotgoodrich@gmail.com>
Tue, 27 Jun 2023 14:26:17 +0000 (15:26 +0100)
commitf0fa2d7c292853b79b5bcd16be97940859a800ec
tree273ed001ddfcdabd784762f5930c719018fabc97
parent1d699bf2664d2a9e64024fd9eb87451d6360ea8c
[llvm] Move AttributeMask to a separate header

Move `AttributeMask` out of `llvm/IR/Attributes.h` to a new file
`llvm/IR/AttributeMask.h`.  After doing this we can remove the
`#include <bitset>` and `#include <set>` directives from `Attributes.h`.
Since there are many headers including `Attributes.h`, but not needing
the definition of `AttributeMask`, this causes unnecessary bloating of
the translation units and slows down compilation.

This commit adds in the include directive for `llvm/IR/AttributeMask.h`
to the handful of source files that need to see the definition.

This reduces the total number of preprocessing tokens across the LLVM
source files in lib from (roughly) 1,917,509,187 to 1,902,982,273 - a
reduction of ~0.76%. This should result in a small improvement in
compilation time.

Differential Revision: https://reviews.llvm.org/D153728
23 files changed:
clang/lib/CodeGen/CGCall.cpp
clang/lib/CodeGen/CodeGenModule.cpp
llvm/include/llvm/IR/AttributeMask.h [new file with mode: 0644]
llvm/include/llvm/IR/Attributes.h
llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp
llvm/lib/Bitcode/Reader/BitcodeReader.cpp
llvm/lib/CodeGen/MLRegallocEvictAdvisor.cpp
llvm/lib/IR/Attributes.cpp
llvm/lib/IR/AutoUpgrade.cpp
llvm/lib/IR/Instruction.cpp
llvm/lib/IR/Verifier.cpp
llvm/lib/Target/AMDGPU/AMDGPURewriteOutArguments.cpp
llvm/lib/Target/DirectX/DXILPrepare.cpp
llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp
llvm/lib/Transforms/IPO/SCCP.cpp
llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
llvm/lib/Transforms/Utils/CallPromotionUtils.cpp
llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
llvm/tools/llvm-reduce/deltas/ReduceInstructions.cpp
llvm/unittests/IR/AttributesTest.cpp