[lld] [lld] Remove unused includes (NFC) (PR #141388)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sat May 24 18:19:19 PDT 2025
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/141388
None
>From 6688bcf32d5852bb72b3f2d972bb776fe24b2134 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Sat, 24 May 2025 16:43:13 -0700
Subject: [PATCH] [lld] Remove unused includes (NFC)
---
lld/COFF/COFFLinkerContext.cpp | 3 ---
lld/COFF/CallGraphSort.cpp | 1 -
lld/COFF/DebugTypes.cpp | 1 -
lld/COFF/Driver.cpp | 2 --
lld/COFF/DriverUtils.cpp | 4 ----
lld/COFF/ICF.cpp | 4 ----
lld/COFF/InputFiles.cpp | 4 ----
lld/COFF/LTO.cpp | 6 ------
lld/COFF/MapFile.cpp | 1 -
lld/COFF/MarkLive.cpp | 2 --
lld/COFF/MinGW.cpp | 1 -
lld/COFF/PDB.cpp | 10 ----------
lld/COFF/Symbols.cpp | 5 -----
lld/COFF/Writer.cpp | 3 ---
lld/Common/ErrorHandler.cpp | 2 --
lld/ELF/AArch64ErrataFix.cpp | 2 --
lld/ELF/ARMErrataFix.cpp | 2 --
lld/ELF/Arch/AArch64.cpp | 1 -
lld/ELF/Arch/ARM.cpp | 1 -
lld/ELF/Arch/AVR.cpp | 1 -
lld/ELF/Arch/Hexagon.cpp | 1 -
lld/ELF/Arch/MSP430.cpp | 1 -
lld/ELF/Arch/Mips.cpp | 2 --
lld/ELF/Arch/MipsArchTree.cpp | 2 --
lld/ELF/Arch/PPC.cpp | 2 --
lld/ELF/Arch/PPC64.cpp | 2 --
lld/ELF/Arch/SPARCV9.cpp | 1 -
lld/ELF/Arch/SystemZ.cpp | 1 -
lld/ELF/Arch/X86.cpp | 1 -
lld/ELF/Arch/X86_64.cpp | 1 -
lld/ELF/DWARF.cpp | 3 ---
lld/ELF/Driver.cpp | 2 --
lld/ELF/EhFrame.cpp | 3 ---
lld/ELF/ICF.cpp | 1 -
lld/ELF/InputFiles.cpp | 2 --
lld/ELF/InputSection.cpp | 2 --
lld/ELF/LTO.cpp | 6 ------
lld/ELF/LinkerScript.cpp | 2 --
lld/ELF/MapFile.cpp | 1 -
lld/ELF/MarkLive.cpp | 2 --
lld/ELF/Relocations.cpp | 1 -
lld/ELF/ScriptLexer.cpp | 2 --
lld/ELF/ScriptParser.cpp | 2 --
lld/ELF/SymbolTable.cpp | 1 -
lld/ELF/Symbols.cpp | 1 -
lld/ELF/SyntheticSections.cpp | 3 ---
lld/ELF/Target.cpp | 1 -
lld/MachO/Arch/ARM64.cpp | 1 -
lld/MachO/Arch/ARM64_32.cpp | 4 ----
lld/MachO/ConcatOutputSection.cpp | 2 --
lld/MachO/Driver.cpp | 4 ----
lld/MachO/DriverUtils.cpp | 2 --
lld/MachO/ExportTrie.cpp | 1 -
lld/MachO/ICF.cpp | 2 --
lld/MachO/InputFiles.cpp | 2 --
lld/MachO/InputSection.cpp | 2 --
lld/MachO/LTO.cpp | 2 --
lld/MachO/MarkLive.cpp | 2 --
lld/MachO/ObjC.cpp | 1 -
lld/MachO/OutputSegment.cpp | 1 -
lld/MachO/SyntheticSections.cpp | 3 ---
lld/MachO/Writer.cpp | 1 -
lld/MinGW/Driver.cpp | 1 -
lld/wasm/Driver.cpp | 1 -
lld/wasm/InputFiles.cpp | 1 -
lld/wasm/LTO.cpp | 8 --------
lld/wasm/MapFile.cpp | 3 ---
lld/wasm/OutputSections.cpp | 1 -
lld/wasm/Writer.cpp | 5 -----
69 files changed, 155 deletions(-)
diff --git a/lld/COFF/COFFLinkerContext.cpp b/lld/COFF/COFFLinkerContext.cpp
index 2aba87d716031..5d43ede913e83 100644
--- a/lld/COFF/COFFLinkerContext.cpp
+++ b/lld/COFF/COFFLinkerContext.cpp
@@ -11,10 +11,7 @@
#include "COFFLinkerContext.h"
#include "Symbols.h"
-#include "lld/Common/Memory.h"
#include "llvm/BinaryFormat/COFF.h"
-#include "llvm/DebugInfo/CodeView/TypeHashing.h"
-#include "llvm/Demangle/Demangle.h"
namespace lld::coff {
COFFLinkerContext::COFFLinkerContext()
diff --git a/lld/COFF/CallGraphSort.cpp b/lld/COFF/CallGraphSort.cpp
index 9cd60dea6e377..395bef5e923be 100644
--- a/lld/COFF/CallGraphSort.cpp
+++ b/lld/COFF/CallGraphSort.cpp
@@ -16,7 +16,6 @@
#include "InputFiles.h"
#include "SymbolTable.h"
#include "Symbols.h"
-#include "lld/Common/ErrorHandler.h"
#include <numeric>
diff --git a/lld/COFF/DebugTypes.cpp b/lld/COFF/DebugTypes.cpp
index c375360d19e70..0999c918eb04f 100644
--- a/lld/COFF/DebugTypes.cpp
+++ b/lld/COFF/DebugTypes.cpp
@@ -9,7 +9,6 @@
#include "DebugTypes.h"
#include "COFFLinkerContext.h"
#include "Chunks.h"
-#include "Driver.h"
#include "InputFiles.h"
#include "PDB.h"
#include "TypeMerger.h"
diff --git a/lld/COFF/Driver.cpp b/lld/COFF/Driver.cpp
index 13e716d9958a0..f3240b22a1442 100644
--- a/lld/COFF/Driver.cpp
+++ b/lld/COFF/Driver.cpp
@@ -19,7 +19,6 @@
#include "Writer.h"
#include "lld/Common/Args.h"
#include "lld/Common/CommonLinkerContext.h"
-#include "lld/Common/Driver.h"
#include "lld/Common/Filesystem.h"
#include "lld/Common/Timer.h"
#include "lld/Common/Version.h"
@@ -28,7 +27,6 @@
#include "llvm/BinaryFormat/Magic.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/LTO/LTO.h"
-#include "llvm/Object/ArchiveWriter.h"
#include "llvm/Object/COFFImportFile.h"
#include "llvm/Option/Arg.h"
#include "llvm/Option/ArgList.h"
diff --git a/lld/COFF/DriverUtils.cpp b/lld/COFF/DriverUtils.cpp
index b6334406035ac..d8b41c7f45400 100644
--- a/lld/COFF/DriverUtils.cpp
+++ b/lld/COFF/DriverUtils.cpp
@@ -17,7 +17,6 @@
#include "Symbols.h"
#include "lld/Common/ErrorHandler.h"
#include "lld/Common/Memory.h"
-#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/BinaryFormat/COFF.h"
@@ -28,14 +27,11 @@
#include "llvm/Option/ArgList.h"
#include "llvm/Option/Option.h"
#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/FileUtilities.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/Program.h"
-#include "llvm/Support/TimeProfiler.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/WindowsManifest/WindowsManifestMerger.h"
-#include <limits>
#include <memory>
#include <optional>
diff --git a/lld/COFF/ICF.cpp b/lld/COFF/ICF.cpp
index e6c965160e4ef..69d339e3fc7cf 100644
--- a/lld/COFF/ICF.cpp
+++ b/lld/COFF/ICF.cpp
@@ -21,13 +21,9 @@
#include "COFFLinkerContext.h"
#include "Chunks.h"
#include "Symbols.h"
-#include "lld/Common/ErrorHandler.h"
#include "lld/Common/Timer.h"
-#include "llvm/ADT/Hashing.h"
-#include "llvm/Support/Debug.h"
#include "llvm/Support/Parallel.h"
#include "llvm/Support/TimeProfiler.h"
-#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/xxhash.h"
#include <algorithm>
#include <atomic>
diff --git a/lld/COFF/InputFiles.cpp b/lld/COFF/InputFiles.cpp
index e10b6419b5ad5..170f747970a99 100644
--- a/lld/COFF/InputFiles.cpp
+++ b/lld/COFF/InputFiles.cpp
@@ -15,7 +15,6 @@
#include "SymbolTable.h"
#include "Symbols.h"
#include "lld/Common/DWARF.h"
-#include "llvm-c/lto.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Twine.h"
#include "llvm/BinaryFormat/COFF.h"
@@ -33,14 +32,11 @@
#include "llvm/Support/Casting.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/Error.h"
-#include "llvm/Support/ErrorOr.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
-#include "llvm/Target/TargetOptions.h"
#include "llvm/TargetParser/Triple.h"
#include <cstring>
#include <optional>
-#include <system_error>
#include <utility>
using namespace llvm;
diff --git a/lld/COFF/LTO.cpp b/lld/COFF/LTO.cpp
index a8cecb39ac614..2a4d07cc2d015 100644
--- a/lld/COFF/LTO.cpp
+++ b/lld/COFF/LTO.cpp
@@ -17,25 +17,19 @@
#include "lld/Common/Strings.h"
#include "lld/Common/TargetOptionsCommandFlags.h"
#include "llvm/ADT/STLExtras.h"
-#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Bitcode/BitcodeWriter.h"
#include "llvm/IR/DiagnosticPrinter.h"
#include "llvm/LTO/Config.h"
#include "llvm/LTO/LTO.h"
-#include "llvm/Object/SymbolicFile.h"
#include "llvm/Support/Caching.h"
#include "llvm/Support/CodeGen.h"
-#include "llvm/Support/Error.h"
-#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/raw_ostream.h"
-#include <algorithm>
#include <cstddef>
#include <memory>
#include <string>
-#include <system_error>
#include <vector>
using namespace llvm;
diff --git a/lld/COFF/MapFile.cpp b/lld/COFF/MapFile.cpp
index 9b7c05b9e68b9..90ebacbe48d44 100644
--- a/lld/COFF/MapFile.cpp
+++ b/lld/COFF/MapFile.cpp
@@ -32,7 +32,6 @@
#include "SymbolTable.h"
#include "Symbols.h"
#include "Writer.h"
-#include "lld/Common/ErrorHandler.h"
#include "lld/Common/Timer.h"
#include "llvm/Support/Parallel.h"
#include "llvm/Support/Path.h"
diff --git a/lld/COFF/MarkLive.cpp b/lld/COFF/MarkLive.cpp
index ad50536892ebb..f40810c6805aa 100644
--- a/lld/COFF/MarkLive.cpp
+++ b/lld/COFF/MarkLive.cpp
@@ -10,9 +10,7 @@
#include "Chunks.h"
#include "Symbols.h"
#include "lld/Common/Timer.h"
-#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/TimeProfiler.h"
-#include <vector>
namespace lld::coff {
diff --git a/lld/COFF/MinGW.cpp b/lld/COFF/MinGW.cpp
index 0c7a8605cd59a..ca9ae403f181b 100644
--- a/lld/COFF/MinGW.cpp
+++ b/lld/COFF/MinGW.cpp
@@ -13,7 +13,6 @@
#include "SymbolTable.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DenseSet.h"
-#include "llvm/Object/COFF.h"
#include "llvm/Support/Parallel.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/TimeProfiler.h"
diff --git a/lld/COFF/PDB.cpp b/lld/COFF/PDB.cpp
index 21475033b0ae8..a54ea403ba2ec 100644
--- a/lld/COFF/PDB.cpp
+++ b/lld/COFF/PDB.cpp
@@ -21,18 +21,12 @@
#include "llvm/DebugInfo/CodeView/DebugInlineeLinesSubsection.h"
#include "llvm/DebugInfo/CodeView/DebugLinesSubsection.h"
#include "llvm/DebugInfo/CodeView/DebugSubsectionRecord.h"
-#include "llvm/DebugInfo/CodeView/GlobalTypeTableBuilder.h"
-#include "llvm/DebugInfo/CodeView/LazyRandomTypeCollection.h"
-#include "llvm/DebugInfo/CodeView/MergingTypeTableBuilder.h"
#include "llvm/DebugInfo/CodeView/RecordName.h"
-#include "llvm/DebugInfo/CodeView/SymbolDeserializer.h"
#include "llvm/DebugInfo/CodeView/SymbolRecordHelpers.h"
#include "llvm/DebugInfo/CodeView/SymbolSerializer.h"
#include "llvm/DebugInfo/CodeView/TypeIndexDiscovery.h"
#include "llvm/DebugInfo/MSF/MSFBuilder.h"
-#include "llvm/DebugInfo/MSF/MSFCommon.h"
#include "llvm/DebugInfo/MSF/MSFError.h"
-#include "llvm/DebugInfo/PDB/GenericError.h"
#include "llvm/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.h"
#include "llvm/DebugInfo/PDB/Native/DbiStream.h"
#include "llvm/DebugInfo/PDB/Native/DbiStreamBuilder.h"
@@ -46,14 +40,10 @@
#include "llvm/DebugInfo/PDB/Native/TpiHashing.h"
#include "llvm/DebugInfo/PDB/Native/TpiStream.h"
#include "llvm/DebugInfo/PDB/Native/TpiStreamBuilder.h"
-#include "llvm/DebugInfo/PDB/PDB.h"
#include "llvm/Object/COFF.h"
#include "llvm/Object/CVDebugRecord.h"
-#include "llvm/Support/BinaryByteStream.h"
#include "llvm/Support/CRC.h"
#include "llvm/Support/Endian.h"
-#include "llvm/Support/Errc.h"
-#include "llvm/Support/FormatAdapters.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/ScopedPrinter.h"
diff --git a/lld/COFF/Symbols.cpp b/lld/COFF/Symbols.cpp
index 002c6945c47b3..b571ce9ce432c 100644
--- a/lld/COFF/Symbols.cpp
+++ b/lld/COFF/Symbols.cpp
@@ -10,12 +10,7 @@
#include "COFFLinkerContext.h"
#include "InputFiles.h"
#include "lld/Common/ErrorHandler.h"
-#include "lld/Common/Memory.h"
-#include "lld/Common/Strings.h"
-#include "llvm/ADT/STLExtras.h"
#include "llvm/Demangle/Demangle.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/raw_ostream.h"
using namespace llvm;
using namespace llvm::object;
diff --git a/lld/COFF/Writer.cpp b/lld/COFF/Writer.cpp
index db6133e20a037..cb9d0001015bd 100644
--- a/lld/COFF/Writer.cpp
+++ b/lld/COFF/Writer.cpp
@@ -24,12 +24,9 @@
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringSet.h"
#include "llvm/BinaryFormat/COFF.h"
-#include "llvm/Support/BinaryStreamReader.h"
-#include "llvm/Support/Debug.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/FileOutputBuffer.h"
#include "llvm/Support/Parallel.h"
-#include "llvm/Support/Path.h"
#include "llvm/Support/RandomNumberGenerator.h"
#include "llvm/Support/TimeProfiler.h"
#include "llvm/Support/xxhash.h"
diff --git a/lld/Common/ErrorHandler.cpp b/lld/Common/ErrorHandler.cpp
index a11960325a9cd..e511b77452cfc 100644
--- a/lld/Common/ErrorHandler.cpp
+++ b/lld/Common/ErrorHandler.cpp
@@ -8,8 +8,6 @@
#include "lld/Common/ErrorHandler.h"
-#include "llvm/Support/Parallel.h"
-
#include "lld/Common/CommonLinkerContext.h"
#include "llvm/ADT/Twine.h"
#include "llvm/IR/DiagnosticInfo.h"
diff --git a/lld/ELF/AArch64ErrataFix.cpp b/lld/ELF/AArch64ErrataFix.cpp
index e2b1cf14daa72..fe8869d237b4d 100644
--- a/lld/ELF/AArch64ErrataFix.cpp
+++ b/lld/ELF/AArch64ErrataFix.cpp
@@ -33,8 +33,6 @@
#include "Symbols.h"
#include "SyntheticSections.h"
#include "Target.h"
-#include "lld/Common/CommonLinkerContext.h"
-#include "lld/Common/Strings.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/Endian.h"
#include <algorithm>
diff --git a/lld/ELF/ARMErrataFix.cpp b/lld/ELF/ARMErrataFix.cpp
index d14d28ee43a2f..6419cee42a1c5 100644
--- a/lld/ELF/ARMErrataFix.cpp
+++ b/lld/ELF/ARMErrataFix.cpp
@@ -21,8 +21,6 @@
#include "Symbols.h"
#include "SyntheticSections.h"
#include "Target.h"
-#include "lld/Common/CommonLinkerContext.h"
-#include "lld/Common/Strings.h"
#include "llvm/Support/Endian.h"
#include <algorithm>
diff --git a/lld/ELF/Arch/AArch64.cpp b/lld/ELF/Arch/AArch64.cpp
index 9538dd4a70bae..2b5d5e90573fe 100644
--- a/lld/ELF/Arch/AArch64.cpp
+++ b/lld/ELF/Arch/AArch64.cpp
@@ -11,7 +11,6 @@
#include "Symbols.h"
#include "SyntheticSections.h"
#include "Target.h"
-#include "lld/Common/ErrorHandler.h"
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/Support/Endian.h"
diff --git a/lld/ELF/Arch/ARM.cpp b/lld/ELF/Arch/ARM.cpp
index e45dd4d354afb..aa90fecc533e3 100644
--- a/lld/ELF/Arch/ARM.cpp
+++ b/lld/ELF/Arch/ARM.cpp
@@ -12,7 +12,6 @@
#include "Symbols.h"
#include "SyntheticSections.h"
#include "Target.h"
-#include "lld/Common/ErrorHandler.h"
#include "lld/Common/Filesystem.h"
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/Support/Endian.h"
diff --git a/lld/ELF/Arch/AVR.cpp b/lld/ELF/Arch/AVR.cpp
index 826ad54dc3dba..5276ff9840591 100644
--- a/lld/ELF/Arch/AVR.cpp
+++ b/lld/ELF/Arch/AVR.cpp
@@ -29,7 +29,6 @@
#include "Symbols.h"
#include "Target.h"
#include "Thunks.h"
-#include "lld/Common/ErrorHandler.h"
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/Support/Endian.h"
diff --git a/lld/ELF/Arch/Hexagon.cpp b/lld/ELF/Arch/Hexagon.cpp
index 4ba61db2733c2..726e425b36dc6 100644
--- a/lld/ELF/Arch/Hexagon.cpp
+++ b/lld/ELF/Arch/Hexagon.cpp
@@ -10,7 +10,6 @@
#include "Symbols.h"
#include "SyntheticSections.h"
#include "Target.h"
-#include "lld/Common/ErrorHandler.h"
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/Support/Endian.h"
diff --git a/lld/ELF/Arch/MSP430.cpp b/lld/ELF/Arch/MSP430.cpp
index fc94424e6c7a1..03d34436d2959 100644
--- a/lld/ELF/Arch/MSP430.cpp
+++ b/lld/ELF/Arch/MSP430.cpp
@@ -17,7 +17,6 @@
#include "Symbols.h"
#include "Target.h"
-#include "lld/Common/ErrorHandler.h"
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/Support/Endian.h"
diff --git a/lld/ELF/Arch/Mips.cpp b/lld/ELF/Arch/Mips.cpp
index c4848fecc6f28..91c7f15ae1f1c 100644
--- a/lld/ELF/Arch/Mips.cpp
+++ b/lld/ELF/Arch/Mips.cpp
@@ -7,11 +7,9 @@
//===----------------------------------------------------------------------===//
#include "InputFiles.h"
-#include "OutputSections.h"
#include "Symbols.h"
#include "SyntheticSections.h"
#include "Target.h"
-#include "lld/Common/ErrorHandler.h"
#include "llvm/BinaryFormat/ELF.h"
using namespace llvm;
diff --git a/lld/ELF/Arch/MipsArchTree.cpp b/lld/ELF/Arch/MipsArchTree.cpp
index 197cb30cdb8a5..9158859045087 100644
--- a/lld/ELF/Arch/MipsArchTree.cpp
+++ b/lld/ELF/Arch/MipsArchTree.cpp
@@ -13,9 +13,7 @@
#include "InputFiles.h"
#include "SymbolTable.h"
#include "Target.h"
-#include "Writer.h"
-#include "lld/Common/ErrorHandler.h"
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/Support/MipsABIFlags.h"
diff --git a/lld/ELF/Arch/PPC.cpp b/lld/ELF/Arch/PPC.cpp
index 3203e27d82fa2..60a0a38d5f23a 100644
--- a/lld/ELF/Arch/PPC.cpp
+++ b/lld/ELF/Arch/PPC.cpp
@@ -11,8 +11,6 @@
#include "SyntheticSections.h"
#include "Target.h"
#include "Thunks.h"
-#include "lld/Common/ErrorHandler.h"
-#include "llvm/Support/Endian.h"
using namespace llvm;
using namespace llvm::support::endian;
diff --git a/lld/ELF/Arch/PPC64.cpp b/lld/ELF/Arch/PPC64.cpp
index 4edb6af4f09ad..3cd4a6294e2a8 100644
--- a/lld/ELF/Arch/PPC64.cpp
+++ b/lld/ELF/Arch/PPC64.cpp
@@ -13,8 +13,6 @@
#include "SyntheticSections.h"
#include "Target.h"
#include "Thunks.h"
-#include "lld/Common/CommonLinkerContext.h"
-#include "llvm/Support/Endian.h"
using namespace llvm;
using namespace llvm::object;
diff --git a/lld/ELF/Arch/SPARCV9.cpp b/lld/ELF/Arch/SPARCV9.cpp
index b594b6677f3ad..86668c50d3c78 100644
--- a/lld/ELF/Arch/SPARCV9.cpp
+++ b/lld/ELF/Arch/SPARCV9.cpp
@@ -9,7 +9,6 @@
#include "Symbols.h"
#include "SyntheticSections.h"
#include "Target.h"
-#include "lld/Common/ErrorHandler.h"
#include "llvm/Support/Endian.h"
using namespace llvm;
diff --git a/lld/ELF/Arch/SystemZ.cpp b/lld/ELF/Arch/SystemZ.cpp
index e0c6feb6031fc..a9125806c0952 100644
--- a/lld/ELF/Arch/SystemZ.cpp
+++ b/lld/ELF/Arch/SystemZ.cpp
@@ -10,7 +10,6 @@
#include "Symbols.h"
#include "SyntheticSections.h"
#include "Target.h"
-#include "lld/Common/ErrorHandler.h"
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/Support/Endian.h"
diff --git a/lld/ELF/Arch/X86.cpp b/lld/ELF/Arch/X86.cpp
index 0edcde950d850..c1980d6e0538f 100644
--- a/lld/ELF/Arch/X86.cpp
+++ b/lld/ELF/Arch/X86.cpp
@@ -10,7 +10,6 @@
#include "Symbols.h"
#include "SyntheticSections.h"
#include "Target.h"
-#include "lld/Common/ErrorHandler.h"
#include "llvm/Support/Endian.h"
using namespace llvm;
diff --git a/lld/ELF/Arch/X86_64.cpp b/lld/ELF/Arch/X86_64.cpp
index 0c4fd00cab65c..974da4d96320a 100644
--- a/lld/ELF/Arch/X86_64.cpp
+++ b/lld/ELF/Arch/X86_64.cpp
@@ -11,7 +11,6 @@
#include "Symbols.h"
#include "SyntheticSections.h"
#include "Target.h"
-#include "lld/Common/ErrorHandler.h"
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/MathExtras.h"
diff --git a/lld/ELF/DWARF.cpp b/lld/ELF/DWARF.cpp
index 8e4740919a481..78fd013bef22c 100644
--- a/lld/ELF/DWARF.cpp
+++ b/lld/ELF/DWARF.cpp
@@ -16,9 +16,6 @@
#include "DWARF.h"
#include "InputSection.h"
#include "Symbols.h"
-#include "lld/Common/Memory.h"
-#include "llvm/DebugInfo/DWARF/DWARFDebugPubTable.h"
-#include "llvm/Object/ELFObjectFile.h"
using namespace llvm;
using namespace llvm::object;
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp
index 76a37b706c5fa..6150fe072156f 100644
--- a/lld/ELF/Driver.cpp
+++ b/lld/ELF/Driver.cpp
@@ -39,12 +39,10 @@
#include "Writer.h"
#include "lld/Common/Args.h"
#include "lld/Common/CommonLinkerContext.h"
-#include "lld/Common/Driver.h"
#include "lld/Common/ErrorHandler.h"
#include "lld/Common/Filesystem.h"
#include "lld/Common/Memory.h"
#include "lld/Common/Strings.h"
-#include "lld/Common/TargetOptionsCommandFlags.h"
#include "lld/Common/Version.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SetVector.h"
diff --git a/lld/ELF/EhFrame.cpp b/lld/ELF/EhFrame.cpp
index 5d5a7bc0ab966..aade9291d1fba 100644
--- a/lld/ELF/EhFrame.cpp
+++ b/lld/ELF/EhFrame.cpp
@@ -21,10 +21,7 @@
#include "InputSection.h"
#include "Relocations.h"
#include "Target.h"
-#include "lld/Common/ErrorHandler.h"
-#include "lld/Common/Strings.h"
#include "llvm/BinaryFormat/Dwarf.h"
-#include "llvm/Object/ELF.h"
using namespace llvm;
using namespace llvm::ELF;
diff --git a/lld/ELF/ICF.cpp b/lld/ELF/ICF.cpp
index 77fe7c58e92cd..6176077a72831 100644
--- a/lld/ELF/ICF.cpp
+++ b/lld/ELF/ICF.cpp
@@ -81,7 +81,6 @@
#include "Symbols.h"
#include "SyntheticSections.h"
#include "llvm/BinaryFormat/ELF.h"
-#include "llvm/Object/ELF.h"
#include "llvm/Support/Parallel.h"
#include "llvm/Support/TimeProfiler.h"
#include "llvm/Support/xxhash.h"
diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp
index 5f6d2b6b647ee..12a77736aba7f 100644
--- a/lld/ELF/InputFiles.cpp
+++ b/lld/ELF/InputFiles.cpp
@@ -16,7 +16,6 @@
#include "Symbols.h"
#include "SyntheticSections.h"
#include "Target.h"
-#include "lld/Common/CommonLinkerContext.h"
#include "lld/Common/DWARF.h"
#include "llvm/ADT/CachedHashString.h"
#include "llvm/ADT/STLExtras.h"
@@ -27,7 +26,6 @@
#include "llvm/Support/Endian.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
-#include "llvm/Support/RISCVAttributeParser.h"
#include "llvm/Support/TimeProfiler.h"
#include "llvm/Support/raw_ostream.h"
#include <optional>
diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp
index 52c472bb89caf..0ce0f08d03874 100644
--- a/lld/ELF/InputSection.cpp
+++ b/lld/ELF/InputSection.cpp
@@ -15,14 +15,12 @@
#include "Symbols.h"
#include "SyntheticSections.h"
#include "Target.h"
-#include "lld/Common/CommonLinkerContext.h"
#include "lld/Common/DWARF.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Compression.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/xxhash.h"
#include <algorithm>
-#include <mutex>
#include <optional>
#include <vector>
diff --git a/lld/ELF/LTO.cpp b/lld/ELF/LTO.cpp
index 195526bf390d2..82a7463446a94 100644
--- a/lld/ELF/LTO.cpp
+++ b/lld/ELF/LTO.cpp
@@ -11,13 +11,10 @@
#include "InputFiles.h"
#include "SymbolTable.h"
#include "Symbols.h"
-#include "lld/Common/Args.h"
-#include "lld/Common/CommonLinkerContext.h"
#include "lld/Common/ErrorHandler.h"
#include "lld/Common/Filesystem.h"
#include "lld/Common/Strings.h"
#include "lld/Common/TargetOptionsCommandFlags.h"
-#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
#include "llvm/BinaryFormat/ELF.h"
@@ -26,11 +23,8 @@
#include "llvm/LTO/LTO.h"
#include "llvm/Support/Caching.h"
#include "llvm/Support/CodeGen.h"
-#include "llvm/Support/Error.h"
-#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Path.h"
-#include <algorithm>
#include <cstddef>
#include <memory>
#include <string>
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index 8149513d821e4..a5d08f4979dab 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -26,7 +26,6 @@
#include "llvm/ADT/StringRef.h"
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/Support/Casting.h"
-#include "llvm/Support/Endian.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/TimeProfiler.h"
#include <algorithm>
@@ -35,7 +34,6 @@
#include <cstdint>
#include <limits>
#include <string>
-#include <vector>
using namespace llvm;
using namespace llvm::ELF;
diff --git a/lld/ELF/MapFile.cpp b/lld/ELF/MapFile.cpp
index 138d35951a3bb..05ae25fc8efea 100644
--- a/lld/ELF/MapFile.cpp
+++ b/lld/ELF/MapFile.cpp
@@ -27,7 +27,6 @@
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Parallel.h"
#include "llvm/Support/TimeProfiler.h"
#include "llvm/Support/raw_ostream.h"
diff --git a/lld/ELF/MarkLive.cpp b/lld/ELF/MarkLive.cpp
index afebc4464c909..8dd341b79c8fc 100644
--- a/lld/ELF/MarkLive.cpp
+++ b/lld/ELF/MarkLive.cpp
@@ -27,11 +27,9 @@
#include "Symbols.h"
#include "SyntheticSections.h"
#include "Target.h"
-#include "lld/Common/CommonLinkerContext.h"
#include "lld/Common/Strings.h"
#include "llvm/ADT/DenseMapInfoVariant.h"
#include "llvm/ADT/STLExtras.h"
-#include "llvm/Object/ELF.h"
#include "llvm/Support/TimeProfiler.h"
#include <variant>
#include <vector>
diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp
index 277acb26987bc..8413d8bb2437c 100644
--- a/lld/ELF/Relocations.cpp
+++ b/lld/ELF/Relocations.cpp
@@ -55,7 +55,6 @@
#include "llvm/ADT/SmallSet.h"
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/Demangle/Demangle.h"
-#include "llvm/Support/Endian.h"
#include <algorithm>
using namespace llvm;
diff --git a/lld/ELF/ScriptLexer.cpp b/lld/ELF/ScriptLexer.cpp
index 8db44f55505f8..3fa473882f3b4 100644
--- a/lld/ELF/ScriptLexer.cpp
+++ b/lld/ELF/ScriptLexer.cpp
@@ -28,12 +28,10 @@
#include "ScriptLexer.h"
#include "Config.h"
-#include "lld/Common/ErrorHandler.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
-#include <algorithm>
using namespace llvm;
using namespace lld;
diff --git a/lld/ELF/ScriptParser.cpp b/lld/ELF/ScriptParser.cpp
index f424199e42540..528c372250e27 100644
--- a/lld/ELF/ScriptParser.cpp
+++ b/lld/ELF/ScriptParser.cpp
@@ -21,7 +21,6 @@
#include "SymbolTable.h"
#include "Symbols.h"
#include "Target.h"
-#include "lld/Common/CommonLinkerContext.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSwitch.h"
@@ -34,7 +33,6 @@
#include "llvm/Support/SaveAndRestore.h"
#include "llvm/Support/TimeProfiler.h"
#include <cassert>
-#include <limits>
#include <optional>
#include <vector>
diff --git a/lld/ELF/SymbolTable.cpp b/lld/ELF/SymbolTable.cpp
index b8a70d4e898fc..9f4e2a06db4c8 100644
--- a/lld/ELF/SymbolTable.cpp
+++ b/lld/ELF/SymbolTable.cpp
@@ -17,7 +17,6 @@
#include "Config.h"
#include "InputFiles.h"
#include "Symbols.h"
-#include "lld/Common/ErrorHandler.h"
#include "lld/Common/Memory.h"
#include "lld/Common/Strings.h"
#include "llvm/ADT/STLExtras.h"
diff --git a/lld/ELF/Symbols.cpp b/lld/ELF/Symbols.cpp
index fe7ba370c9f5d..c461dfed0d741 100644
--- a/lld/ELF/Symbols.cpp
+++ b/lld/ELF/Symbols.cpp
@@ -15,7 +15,6 @@
#include "SyntheticSections.h"
#include "Target.h"
#include "Writer.h"
-#include "lld/Common/ErrorHandler.h"
#include "llvm/Demangle/Demangle.h"
#include "llvm/Support/Compiler.h"
#include <cstring>
diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp
index 46591e909ba4f..6f513b89d8f34 100644
--- a/lld/ELF/SyntheticSections.cpp
+++ b/lld/ELF/SyntheticSections.cpp
@@ -25,9 +25,6 @@
#include "Target.h"
#include "Thunks.h"
#include "Writer.h"
-#include "lld/Common/CommonLinkerContext.h"
-#include "lld/Common/DWARF.h"
-#include "lld/Common/Strings.h"
#include "lld/Common/Version.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/Sequence.h"
diff --git a/lld/ELF/Target.cpp b/lld/ELF/Target.cpp
index c90ef8505aadd..ad7d57d30668d 100644
--- a/lld/ELF/Target.cpp
+++ b/lld/ELF/Target.cpp
@@ -28,7 +28,6 @@
#include "OutputSections.h"
#include "SymbolTable.h"
#include "Symbols.h"
-#include "SyntheticSections.h"
#include "lld/Common/ErrorHandler.h"
#include "llvm/Object/ELF.h"
diff --git a/lld/MachO/Arch/ARM64.cpp b/lld/MachO/Arch/ARM64.cpp
index 849b309edeb26..9631269bf8f27 100644
--- a/lld/MachO/Arch/ARM64.cpp
+++ b/lld/MachO/Arch/ARM64.cpp
@@ -15,7 +15,6 @@
#include "lld/Common/ErrorHandler.h"
#include "mach-o/compact_unwind_encoding.h"
#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/StringRef.h"
#include "llvm/BinaryFormat/MachO.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/LEB128.h"
diff --git a/lld/MachO/Arch/ARM64_32.cpp b/lld/MachO/Arch/ARM64_32.cpp
index e79ca745ed4a8..332ffefcdce04 100644
--- a/lld/MachO/Arch/ARM64_32.cpp
+++ b/lld/MachO/Arch/ARM64_32.cpp
@@ -10,15 +10,11 @@
#include "Arch/ARM64Common.h"
#include "InputFiles.h"
#include "Symbols.h"
-#include "SyntheticSections.h"
#include "Target.h"
#include "lld/Common/ErrorHandler.h"
#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/StringRef.h"
#include "llvm/BinaryFormat/MachO.h"
-#include "llvm/Support/Endian.h"
-#include "llvm/Support/MathExtras.h"
using namespace llvm::MachO;
using namespace llvm::support::endian;
diff --git a/lld/MachO/ConcatOutputSection.cpp b/lld/MachO/ConcatOutputSection.cpp
index 48bc06194eef0..8067d23fa6faf 100644
--- a/lld/MachO/ConcatOutputSection.cpp
+++ b/lld/MachO/ConcatOutputSection.cpp
@@ -15,8 +15,6 @@
#include "Target.h"
#include "lld/Common/CommonLinkerContext.h"
#include "llvm/BinaryFormat/MachO.h"
-#include "llvm/Support/ScopedPrinter.h"
-#include "llvm/Support/TimeProfiler.h"
using namespace llvm;
using namespace llvm::MachO;
diff --git a/lld/MachO/Driver.cpp b/lld/MachO/Driver.cpp
index 5c32055166da6..9eb391c4ee1b9 100644
--- a/lld/MachO/Driver.cpp
+++ b/lld/MachO/Driver.cpp
@@ -25,7 +25,6 @@
#include "lld/Common/Args.h"
#include "lld/Common/CommonLinkerContext.h"
-#include "lld/Common/Driver.h"
#include "lld/Common/ErrorHandler.h"
#include "lld/Common/LLVM.h"
#include "lld/Common/Memory.h"
@@ -43,7 +42,6 @@
#include "llvm/Option/ArgList.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/FileSystem.h"
-#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Parallel.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/TarWriter.h"
@@ -53,8 +51,6 @@
#include "llvm/TextAPI/Architecture.h"
#include "llvm/TextAPI/PackedVersion.h"
-#include <algorithm>
-
using namespace llvm;
using namespace llvm::MachO;
using namespace llvm::object;
diff --git a/lld/MachO/DriverUtils.cpp b/lld/MachO/DriverUtils.cpp
index f519ee617b8f2..f7f6be049f0e1 100644
--- a/lld/MachO/DriverUtils.cpp
+++ b/lld/MachO/DriverUtils.cpp
@@ -9,8 +9,6 @@
#include "Config.h"
#include "Driver.h"
#include "InputFiles.h"
-#include "ObjC.h"
-#include "Target.h"
#include "lld/Common/Args.h"
#include "lld/Common/CommonLinkerContext.h"
diff --git a/lld/MachO/ExportTrie.cpp b/lld/MachO/ExportTrie.cpp
index e5fff36c4b6d3..303eda416c235 100644
--- a/lld/MachO/ExportTrie.cpp
+++ b/lld/MachO/ExportTrie.cpp
@@ -38,7 +38,6 @@
#include "Symbols.h"
#include "lld/Common/ErrorHandler.h"
-#include "lld/Common/Memory.h"
#include "llvm/BinaryFormat/MachO.h"
#include "llvm/Support/LEB128.h"
#include <optional>
diff --git a/lld/MachO/ICF.cpp b/lld/MachO/ICF.cpp
index 9b8aa1837a4aa..ae0bee8e942cb 100644
--- a/lld/MachO/ICF.cpp
+++ b/lld/MachO/ICF.cpp
@@ -12,10 +12,8 @@
#include "InputSection.h"
#include "SymbolTable.h"
#include "Symbols.h"
-#include "UnwindInfoSection.h"
#include "lld/Common/CommonLinkerContext.h"
-#include "llvm/Support/LEB128.h"
#include "llvm/Support/Parallel.h"
#include "llvm/Support/TimeProfiler.h"
#include "llvm/Support/xxhash.h"
diff --git a/lld/MachO/InputFiles.cpp b/lld/MachO/InputFiles.cpp
index 4b29feddc51b0..3b3023a94166f 100644
--- a/lld/MachO/InputFiles.cpp
+++ b/lld/MachO/InputFiles.cpp
@@ -48,7 +48,6 @@
#include "EhFrame.h"
#include "ExportTrie.h"
#include "InputSection.h"
-#include "MachOStructs.h"
#include "ObjC.h"
#include "OutputSection.h"
#include "OutputSegment.h"
@@ -65,7 +64,6 @@
#include "llvm/LTO/LTO.h"
#include "llvm/Support/BinaryStreamReader.h"
#include "llvm/Support/Endian.h"
-#include "llvm/Support/LEB128.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/TarWriter.h"
diff --git a/lld/MachO/InputSection.cpp b/lld/MachO/InputSection.cpp
index 07e39b04cba46..18b3ff961085b 100644
--- a/lld/MachO/InputSection.cpp
+++ b/lld/MachO/InputSection.cpp
@@ -15,12 +15,10 @@
#include "Symbols.h"
#include "SyntheticSections.h"
#include "Target.h"
-#include "UnwindInfoSection.h"
#include "Writer.h"
#include "lld/Common/ErrorHandler.h"
#include "lld/Common/Memory.h"
-#include "llvm/Support/Endian.h"
#include "llvm/Support/xxhash.h"
using namespace llvm;
diff --git a/lld/MachO/LTO.cpp b/lld/MachO/LTO.cpp
index 075faa8801a54..4695b639dcc96 100644
--- a/lld/MachO/LTO.cpp
+++ b/lld/MachO/LTO.cpp
@@ -13,7 +13,6 @@
#include "Symbols.h"
#include "Target.h"
-#include "lld/Common/Args.h"
#include "lld/Common/CommonLinkerContext.h"
#include "lld/Common/Filesystem.h"
#include "lld/Common/Strings.h"
@@ -25,7 +24,6 @@
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/raw_ostream.h"
-#include "llvm/Transforms/ObjCARC.h"
using namespace lld;
using namespace lld::macho;
diff --git a/lld/MachO/MarkLive.cpp b/lld/MachO/MarkLive.cpp
index 4f67f3a2d8028..d87ccaeee2805 100644
--- a/lld/MachO/MarkLive.cpp
+++ b/lld/MachO/MarkLive.cpp
@@ -16,8 +16,6 @@
#include "lld/Common/ErrorHandler.h"
#include "llvm/Support/TimeProfiler.h"
-#include "mach-o/compact_unwind_encoding.h"
-
namespace lld::macho {
using namespace llvm;
diff --git a/lld/MachO/ObjC.cpp b/lld/MachO/ObjC.cpp
index fe9cee9651cca..35954b25f7149 100644
--- a/lld/MachO/ObjC.cpp
+++ b/lld/MachO/ObjC.cpp
@@ -17,7 +17,6 @@
#include "lld/Common/ErrorHandler.h"
#include "llvm/ADT/DenseMap.h"
-#include "llvm/BinaryFormat/MachO.h"
#include "llvm/Bitcode/BitcodeReader.h"
#include "llvm/Support/TimeProfiler.h"
diff --git a/lld/MachO/OutputSegment.cpp b/lld/MachO/OutputSegment.cpp
index 185444673ae47..5824b5c7772b3 100644
--- a/lld/MachO/OutputSegment.cpp
+++ b/lld/MachO/OutputSegment.cpp
@@ -13,7 +13,6 @@
#include "Symbols.h"
#include "SyntheticSections.h"
-#include "lld/Common/ErrorHandler.h"
#include "lld/Common/Memory.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/BinaryFormat/MachO.h"
diff --git a/lld/MachO/SyntheticSections.cpp b/lld/MachO/SyntheticSections.cpp
index c98264871495b..2113aa88d97a0 100644
--- a/lld/MachO/SyntheticSections.cpp
+++ b/lld/MachO/SyntheticSections.cpp
@@ -12,7 +12,6 @@
#include "ExportTrie.h"
#include "ICF.h"
#include "InputFiles.h"
-#include "MachOStructs.h"
#include "ObjC.h"
#include "OutputSegment.h"
#include "SymbolTable.h"
@@ -21,11 +20,9 @@
#include "lld/Common/CommonLinkerContext.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Config/llvm-config.h"
-#include "llvm/Support/EndianStream.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/LEB128.h"
#include "llvm/Support/Parallel.h"
-#include "llvm/Support/Path.h"
#include "llvm/Support/xxhash.h"
#if defined(__APPLE__)
diff --git a/lld/MachO/Writer.cpp b/lld/MachO/Writer.cpp
index f312828819dcc..613e6dea3b897 100644
--- a/lld/MachO/Writer.cpp
+++ b/lld/MachO/Writer.cpp
@@ -25,7 +25,6 @@
#include "lld/Common/CommonLinkerContext.h"
#include "llvm/BinaryFormat/MachO.h"
#include "llvm/Config/llvm-config.h"
-#include "llvm/Support/LEB128.h"
#include "llvm/Support/Parallel.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/TimeProfiler.h"
diff --git a/lld/MinGW/Driver.cpp b/lld/MinGW/Driver.cpp
index 222ee3a93ef48..8996293fdfa1b 100644
--- a/lld/MinGW/Driver.cpp
+++ b/lld/MinGW/Driver.cpp
@@ -31,7 +31,6 @@
#include "lld/Common/Driver.h"
#include "lld/Common/CommonLinkerContext.h"
#include "lld/Common/ErrorHandler.h"
-#include "lld/Common/Memory.h"
#include "lld/Common/Version.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringExtras.h"
diff --git a/lld/wasm/Driver.cpp b/lld/wasm/Driver.cpp
index d22261574f854..2b1fb945f41c8 100644
--- a/lld/wasm/Driver.cpp
+++ b/lld/wasm/Driver.cpp
@@ -23,7 +23,6 @@
#include "lld/Common/Version.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Config/llvm-config.h"
-#include "llvm/Object/Wasm.h"
#include "llvm/Option/Arg.h"
#include "llvm/Option/ArgList.h"
#include "llvm/Support/CommandLine.h"
diff --git a/lld/wasm/InputFiles.cpp b/lld/wasm/InputFiles.cpp
index 1d1b82c9879b9..387b5eb10ba2f 100644
--- a/lld/wasm/InputFiles.cpp
+++ b/lld/wasm/InputFiles.cpp
@@ -12,7 +12,6 @@
#include "InputElement.h"
#include "OutputSegment.h"
#include "SymbolTable.h"
-#include "lld/Common/Args.h"
#include "lld/Common/CommonLinkerContext.h"
#include "lld/Common/Reproduce.h"
#include "llvm/BinaryFormat/Wasm.h"
diff --git a/lld/wasm/LTO.cpp b/lld/wasm/LTO.cpp
index 581104745b8ba..71f18aa25a35c 100644
--- a/lld/wasm/LTO.cpp
+++ b/lld/wasm/LTO.cpp
@@ -10,33 +10,25 @@
#include "Config.h"
#include "InputFiles.h"
#include "Symbols.h"
-#include "lld/Common/Args.h"
#include "lld/Common/CommonLinkerContext.h"
#include "lld/Common/ErrorHandler.h"
#include "lld/Common/Filesystem.h"
#include "lld/Common/Strings.h"
#include "lld/Common/TargetOptionsCommandFlags.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Bitcode/BitcodeWriter.h"
#include "llvm/IR/DiagnosticPrinter.h"
#include "llvm/LTO/Config.h"
#include "llvm/LTO/LTO.h"
-#include "llvm/Object/SymbolicFile.h"
#include "llvm/Support/Caching.h"
#include "llvm/Support/CodeGen.h"
-#include "llvm/Support/Error.h"
-#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/raw_ostream.h"
-#include <algorithm>
#include <cstddef>
#include <memory>
#include <string>
-#include <system_error>
#include <vector>
using namespace llvm;
diff --git a/lld/wasm/MapFile.cpp b/lld/wasm/MapFile.cpp
index d8487e48b8c6b..53db9df8e02b4 100644
--- a/lld/wasm/MapFile.cpp
+++ b/lld/wasm/MapFile.cpp
@@ -23,11 +23,8 @@
#include "InputFiles.h"
#include "OutputSections.h"
#include "OutputSegment.h"
-#include "SymbolTable.h"
#include "Symbols.h"
#include "SyntheticSections.h"
-#include "lld/Common/Strings.h"
-#include "llvm/ADT/MapVector.h"
#include "llvm/Support/Parallel.h"
#include "llvm/Support/raw_ostream.h"
diff --git a/lld/wasm/OutputSections.cpp b/lld/wasm/OutputSections.cpp
index cd80254a18d5c..8ccd38f7895cb 100644
--- a/lld/wasm/OutputSections.cpp
+++ b/lld/wasm/OutputSections.cpp
@@ -16,7 +16,6 @@
#include "lld/Common/Memory.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Support/LEB128.h"
-#include "llvm/Support/Parallel.h"
#define DEBUG_TYPE "lld"
diff --git a/lld/wasm/Writer.cpp b/lld/wasm/Writer.cpp
index 21649bd15973c..b704677d36c93 100644
--- a/lld/wasm/Writer.cpp
+++ b/lld/wasm/Writer.cpp
@@ -21,24 +21,19 @@
#include "lld/Common/CommonLinkerContext.h"
#include "lld/Common/Strings.h"
#include "llvm/ADT/ArrayRef.h"
-#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/BinaryFormat/Wasm.h"
-#include "llvm/BinaryFormat/WasmTraits.h"
#include "llvm/Support/FileOutputBuffer.h"
-#include "llvm/Support/Format.h"
#include "llvm/Support/FormatVariadic.h"
-#include "llvm/Support/LEB128.h"
#include "llvm/Support/Parallel.h"
#include "llvm/Support/RandomNumberGenerator.h"
#include "llvm/Support/SHA1.h"
#include "llvm/Support/xxhash.h"
#include <cstdarg>
-#include <map>
#include <optional>
#define DEBUG_TYPE "lld"
More information about the llvm-commits
mailing list