From 38fbedab3277401749457351c956333cce753eeb Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Wed, 23 Feb 2022 20:44:34 -0800 Subject: [PATCH] [ELF] Don't rely on Symbols.h's transitive inclusion of InputFiles.h. NFC --- lld/ELF/AArch64ErrataFix.cpp | 1 + lld/ELF/ARMErrataFix.cpp | 1 + lld/ELF/Arch/AMDGPU.cpp | 1 + lld/ELF/Arch/AVR.cpp | 1 + lld/ELF/Arch/Hexagon.cpp | 1 + lld/ELF/Arch/Mips.cpp | 1 + lld/ELF/Arch/MipsArchTree.cpp | 1 + lld/ELF/Arch/PPC64.cpp | 1 + lld/ELF/Arch/RISCV.cpp | 1 + lld/ELF/CallGraphSort.cpp | 1 + lld/ELF/MarkLive.cpp | 1 + lld/ELF/Relocations.cpp | 1 + lld/ELF/SymbolTable.cpp | 1 + lld/ELF/Symbols.h | 6 ++++++ lld/ELF/Thunks.cpp | 1 + 15 files changed, 20 insertions(+) diff --git a/lld/ELF/AArch64ErrataFix.cpp b/lld/ELF/AArch64ErrataFix.cpp index c0774be3fd2c..2faee78f0260 100644 --- a/lld/ELF/AArch64ErrataFix.cpp +++ b/lld/ELF/AArch64ErrataFix.cpp @@ -26,6 +26,7 @@ //===----------------------------------------------------------------------===// #include "AArch64ErrataFix.h" +#include "InputFiles.h" #include "LinkerScript.h" #include "OutputSections.h" #include "Relocations.h" diff --git a/lld/ELF/ARMErrataFix.cpp b/lld/ELF/ARMErrataFix.cpp index bfeeb5db9f33..99b7bc7627fe 100644 --- a/lld/ELF/ARMErrataFix.cpp +++ b/lld/ELF/ARMErrataFix.cpp @@ -14,6 +14,7 @@ //===----------------------------------------------------------------------===// #include "ARMErrataFix.h" +#include "InputFiles.h" #include "LinkerScript.h" #include "OutputSections.h" #include "Relocations.h" diff --git a/lld/ELF/Arch/AMDGPU.cpp b/lld/ELF/Arch/AMDGPU.cpp index 197ce8dd1a73..05e6b37fb799 100644 --- a/lld/ELF/Arch/AMDGPU.cpp +++ b/lld/ELF/Arch/AMDGPU.cpp @@ -6,6 +6,7 @@ // //===----------------------------------------------------------------------===// +#include "InputFiles.h" #include "Symbols.h" #include "Target.h" #include "lld/Common/ErrorHandler.h" diff --git a/lld/ELF/Arch/AVR.cpp b/lld/ELF/Arch/AVR.cpp index 2e59c605fced..105a71da625b 100644 --- a/lld/ELF/Arch/AVR.cpp +++ b/lld/ELF/Arch/AVR.cpp @@ -25,6 +25,7 @@ // //===----------------------------------------------------------------------===// +#include "InputFiles.h" #include "Symbols.h" #include "Target.h" #include "lld/Common/ErrorHandler.h" diff --git a/lld/ELF/Arch/Hexagon.cpp b/lld/ELF/Arch/Hexagon.cpp index 882bc75ed0a3..d54b4c9b52f5 100644 --- a/lld/ELF/Arch/Hexagon.cpp +++ b/lld/ELF/Arch/Hexagon.cpp @@ -6,6 +6,7 @@ // //===----------------------------------------------------------------------===// +#include "InputFiles.h" #include "Symbols.h" #include "SyntheticSections.h" #include "Target.h" diff --git a/lld/ELF/Arch/Mips.cpp b/lld/ELF/Arch/Mips.cpp index 1d8256c5237d..61da4a73a6fd 100644 --- a/lld/ELF/Arch/Mips.cpp +++ b/lld/ELF/Arch/Mips.cpp @@ -6,6 +6,7 @@ // //===----------------------------------------------------------------------===// +#include "InputFiles.h" #include "OutputSections.h" #include "Symbols.h" #include "SyntheticSections.h" diff --git a/lld/ELF/Arch/MipsArchTree.cpp b/lld/ELF/Arch/MipsArchTree.cpp index 9e5aade673c6..93929f2b45a4 100644 --- a/lld/ELF/Arch/MipsArchTree.cpp +++ b/lld/ELF/Arch/MipsArchTree.cpp @@ -10,6 +10,7 @@ // //===---------------------------------------------------------------------===// +#include "InputFiles.h" #include "SymbolTable.h" #include "Writer.h" diff --git a/lld/ELF/Arch/PPC64.cpp b/lld/ELF/Arch/PPC64.cpp index 16893bf833a9..fe21fb6f366b 100644 --- a/lld/ELF/Arch/PPC64.cpp +++ b/lld/ELF/Arch/PPC64.cpp @@ -6,6 +6,7 @@ // //===----------------------------------------------------------------------===// +#include "InputFiles.h" #include "SymbolTable.h" #include "Symbols.h" #include "SyntheticSections.h" diff --git a/lld/ELF/Arch/RISCV.cpp b/lld/ELF/Arch/RISCV.cpp index 9f710ab27bd6..a0ea403e241d 100644 --- a/lld/ELF/Arch/RISCV.cpp +++ b/lld/ELF/Arch/RISCV.cpp @@ -6,6 +6,7 @@ // //===----------------------------------------------------------------------===// +#include "InputFiles.h" #include "Symbols.h" #include "SyntheticSections.h" #include "Target.h" diff --git a/lld/ELF/CallGraphSort.cpp b/lld/ELF/CallGraphSort.cpp index ba2bc7889466..23f1da93c45b 100644 --- a/lld/ELF/CallGraphSort.cpp +++ b/lld/ELF/CallGraphSort.cpp @@ -41,6 +41,7 @@ //===----------------------------------------------------------------------===// #include "CallGraphSort.h" +#include "InputFiles.h" #include "InputSection.h" #include "Symbols.h" #include "llvm/Support/FileSystem.h" diff --git a/lld/ELF/MarkLive.cpp b/lld/ELF/MarkLive.cpp index cf8e639ad648..7a97af96d3ed 100644 --- a/lld/ELF/MarkLive.cpp +++ b/lld/ELF/MarkLive.cpp @@ -20,6 +20,7 @@ //===----------------------------------------------------------------------===// #include "MarkLive.h" +#include "InputFiles.h" #include "InputSection.h" #include "LinkerScript.h" #include "SymbolTable.h" diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp index 33b5b3dd098b..9dd2b195e1a2 100644 --- a/lld/ELF/Relocations.cpp +++ b/lld/ELF/Relocations.cpp @@ -42,6 +42,7 @@ #include "Relocations.h" #include "Config.h" +#include "InputFiles.h" #include "LinkerScript.h" #include "OutputSections.h" #include "SymbolTable.h" diff --git a/lld/ELF/SymbolTable.cpp b/lld/ELF/SymbolTable.cpp index bb948218a236..7a24f8ede31a 100644 --- a/lld/ELF/SymbolTable.cpp +++ b/lld/ELF/SymbolTable.cpp @@ -15,6 +15,7 @@ #include "SymbolTable.h" #include "Config.h" +#include "InputFiles.h" #include "Symbols.h" #include "lld/Common/ErrorHandler.h" #include "lld/Common/Memory.h" diff --git a/lld/ELF/Symbols.h b/lld/ELF/Symbols.h index 89b52fec9a94..e7010de4919b 100644 --- a/lld/ELF/Symbols.h +++ b/lld/ELF/Symbols.h @@ -13,6 +13,7 @@ #ifndef LLD_ELF_SYMBOLS_H #define LLD_ELF_SYMBOLS_H +#include "Config.h" #include "InputFiles.h" #include "lld/Common/LLVM.h" #include "lld/Common/Memory.h" @@ -21,6 +22,9 @@ #include namespace lld { +namespace elf { +class Symbol; +} // Returns a string representation for a symbol for diagnostics. std::string toString(const elf::Symbol &); @@ -29,9 +33,11 @@ class CommonSymbol; class Defined; class OutputSection; class SectionBase; +class InputSectionBase; class SharedSymbol; class Symbol; class Undefined; +class InputFile; // Some index properties of a symbol are stored separately in this auxiliary // struct to decrease sizeof(SymbolUnion) in the majority of cases. diff --git a/lld/ELF/Thunks.cpp b/lld/ELF/Thunks.cpp index 0f3858c28d09..d6172edc76f2 100644 --- a/lld/ELF/Thunks.cpp +++ b/lld/ELF/Thunks.cpp @@ -22,6 +22,7 @@ #include "Thunks.h" #include "Config.h" +#include "InputFiles.h" #include "InputSection.h" #include "OutputSections.h" #include "Symbols.h"