diff options
author | Reid Kleckner <rnk@google.com> | 2020-02-29 10:23:54 -0800 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2020-02-29 12:30:23 -0800 |
commit | af450eabb925a8735434282d4cab6280911c229a (patch) | |
tree | 35fda0ac1523cd2feed427119e23d5f22ebc5ff0 /llvm/lib/BinaryFormat/AMDGPUMetadataVerifier.cpp | |
parent | 798e661567cfffde92ca080fbfbcf72956499283 (diff) | |
download | llvm-af450eabb925a8735434282d4cab6280911c229a.zip llvm-af450eabb925a8735434282d4cab6280911c229a.tar.gz llvm-af450eabb925a8735434282d4cab6280911c229a.tar.bz2 |
Avoid including FileSystem.h from MemoryBuffer.h
Lots of headers pass around MemoryBuffer objects, but very few open
them. Let those that do include FileSystem.h.
Saves ~250 includes of Chrono.h & FileSystem.h:
$ diff -u thedeps-before.txt thedeps-after.txt | grep '^[-+] ' | sort | uniq -c | sort -nr
254 - ../llvm/include/llvm/Support/FileSystem.h
253 - ../llvm/include/llvm/Support/Chrono.h
237 - ../llvm/include/llvm/Support/NativeFormatting.h
237 - ../llvm/include/llvm/Support/FormatProviders.h
192 - ../llvm/include/llvm/ADT/StringSwitch.h
190 - ../llvm/include/llvm/Support/FormatVariadicDetails.h
...
This requires duplicating the file_t typedef, which is unfortunate. I
sunk the choice of mapping mode down into the cpp file using variable
template specializations instead of class members in headers.
Diffstat (limited to 'llvm/lib/BinaryFormat/AMDGPUMetadataVerifier.cpp')
-rw-r--r-- | llvm/lib/BinaryFormat/AMDGPUMetadataVerifier.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/BinaryFormat/AMDGPUMetadataVerifier.cpp b/llvm/lib/BinaryFormat/AMDGPUMetadataVerifier.cpp index d927171..e8b9e12 100644 --- a/llvm/lib/BinaryFormat/AMDGPUMetadataVerifier.cpp +++ b/llvm/lib/BinaryFormat/AMDGPUMetadataVerifier.cpp @@ -12,6 +12,7 @@ //===----------------------------------------------------------------------===// #include "llvm/BinaryFormat/AMDGPUMetadataVerifier.h" +#include "llvm/ADT/StringSwitch.h" #include "llvm/Support/AMDGPUMetadata.h" namespace llvm { |