diff options
-rw-r--r-- | lld/COFF/Driver.cpp | 4 | ||||
-rw-r--r-- | lld/COFF/Driver.h | 6 | ||||
-rw-r--r-- | lld/COFF/ICF.cpp | 1 | ||||
-rw-r--r-- | lld/COFF/ICF.h | 26 | ||||
-rw-r--r-- | lld/COFF/MarkLive.h | 24 | ||||
-rw-r--r-- | lld/ELF/Driver.cpp | 1 | ||||
-rw-r--r-- | lld/ELF/ICF.h | 4 | ||||
-rw-r--r-- | lld/ELF/MarkLive.cpp | 2 | ||||
-rw-r--r-- | lld/ELF/MarkLive.h | 21 | ||||
-rw-r--r-- | lld/ELF/Strings.cpp | 2 | ||||
-rw-r--r-- | lld/ELF/Writer.h | 1 |
11 files changed, 80 insertions, 12 deletions
diff --git a/lld/COFF/Driver.cpp b/lld/COFF/Driver.cpp index 9a78987e80ce..3abe02494846 100644 --- a/lld/COFF/Driver.cpp +++ b/lld/COFF/Driver.cpp @@ -9,7 +9,9 @@ #include "Driver.h" #include "Config.h" +#include "ICF.h" #include "InputFiles.h" +#include "MarkLive.h" #include "MinGW.h" #include "SymbolTable.h" #include "Symbols.h" @@ -37,8 +39,8 @@ #include "llvm/Support/raw_ostream.h" #include "llvm/ToolDrivers/llvm-lib/LibDriver.h" #include <algorithm> -#include <memory> #include <future> +#include <memory> using namespace llvm; using namespace llvm::object; diff --git a/lld/COFF/Driver.h b/lld/COFF/Driver.h index 02b24269049d..9bd6c0fa2ab3 100644 --- a/lld/COFF/Driver.h +++ b/lld/COFF/Driver.h @@ -36,12 +36,6 @@ using llvm::COFF::MachineTypes; using llvm::COFF::WindowsSubsystem; using llvm::Optional; -// Implemented in MarkLive.cpp. -void markLive(ArrayRef<Chunk *> Chunks); - -// Implemented in ICF.cpp. -void doICF(ArrayRef<Chunk *> Chunks); - class COFFOptTable : public llvm::opt::OptTable { public: COFFOptTable(); diff --git a/lld/COFF/ICF.cpp b/lld/COFF/ICF.cpp index 2eb11f99192c..c063ab28edcf 100644 --- a/lld/COFF/ICF.cpp +++ b/lld/COFF/ICF.cpp @@ -18,6 +18,7 @@ // //===----------------------------------------------------------------------===// +#include "ICF.h" #include "Chunks.h" #include "Symbols.h" #include "lld/Common/ErrorHandler.h" diff --git a/lld/COFF/ICF.h b/lld/COFF/ICF.h new file mode 100644 index 000000000000..9c54e0c9ec2d --- /dev/null +++ b/lld/COFF/ICF.h @@ -0,0 +1,26 @@ +//===- ICF.h --------------------------------------------------------------===// +// +// The LLVM Linker +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef LLD_COFF_ICF_H +#define LLD_COFF_ICF_H + +#include "lld/Common/LLVM.h" +#include "llvm/ADT/ArrayRef.h" + +namespace lld { +namespace coff { + +class Chunk; + +void doICF(ArrayRef<Chunk *> Chunks); + +} // namespace coff +} // namespace lld + +#endif diff --git a/lld/COFF/MarkLive.h b/lld/COFF/MarkLive.h new file mode 100644 index 000000000000..5b652dd48196 --- /dev/null +++ b/lld/COFF/MarkLive.h @@ -0,0 +1,24 @@ +//===- MarkLive.h -----------------------------------------------*- C++ -*-===// +// +// The LLVM Linker +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef LLD_COFF_MARKLIVE_H +#define LLD_COFF_MARKLIVE_H + +#include "lld/Common/LLVM.h" +#include "llvm/ADT/ArrayRef.h" + +namespace lld { +namespace coff { + +void markLive(ArrayRef<Chunk *> Chunks); + +} // namespace coff +} // namespace lld + +#endif // LLD_COFF_MARKLIVE_H diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp index 1efd2466cdf1..265b3e629186 100644 --- a/lld/ELF/Driver.cpp +++ b/lld/ELF/Driver.cpp @@ -30,6 +30,7 @@ #include "InputFiles.h" #include "InputSection.h" #include "LinkerScript.h" +#include "MarkLive.h" #include "OutputSections.h" #include "ScriptParser.h" #include "Strings.h" diff --git a/lld/ELF/ICF.h b/lld/ELF/ICF.h index 24219855fc17..a6c8636ead6d 100644 --- a/lld/ELF/ICF.h +++ b/lld/ELF/ICF.h @@ -12,8 +12,10 @@ namespace lld { namespace elf { + template <class ELFT> void doIcf(); -} + +} // namespace elf } // namespace lld #endif diff --git a/lld/ELF/MarkLive.cpp b/lld/ELF/MarkLive.cpp index 1aa20f797d97..05ab2c89ab4a 100644 --- a/lld/ELF/MarkLive.cpp +++ b/lld/ELF/MarkLive.cpp @@ -20,6 +20,7 @@ // //===----------------------------------------------------------------------===// +#include "MarkLive.h" #include "InputSection.h" #include "LinkerScript.h" #include "OutputSections.h" @@ -27,7 +28,6 @@ #include "SymbolTable.h" #include "Symbols.h" #include "Target.h" -#include "Writer.h" #include "lld/Common/Memory.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Object/ELF.h" diff --git a/lld/ELF/MarkLive.h b/lld/ELF/MarkLive.h new file mode 100644 index 000000000000..c9b99add34de --- /dev/null +++ b/lld/ELF/MarkLive.h @@ -0,0 +1,21 @@ +//===- MarkLive.h -----------------------------------------------*- C++ -*-===// +// +// The LLVM Linker +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef LLD_ELF_MARKLIVE_H +#define LLD_ELF_MARKLIVE_H + +namespace lld { +namespace elf { + +template <class ELFT> void markLive(); + +} // namespace elf +} // namespace lld + +#endif // LLD_ELF_MARKLIVE_H diff --git a/lld/ELF/Strings.cpp b/lld/ELF/Strings.cpp index 0ef33a14bc3d..ce642cfe7fab 100644 --- a/lld/ELF/Strings.cpp +++ b/lld/ELF/Strings.cpp @@ -10,8 +10,6 @@ #include "Strings.h" #include "Config.h" #include "lld/Common/ErrorHandler.h" -#include "llvm/ADT/ArrayRef.h" -#include "llvm/ADT/StringRef.h" #include "llvm/ADT/Twine.h" #include "llvm/Demangle/Demangle.h" #include <algorithm> diff --git a/lld/ELF/Writer.h b/lld/ELF/Writer.h index 9c7fbd4b1520..41f1e550eeb4 100644 --- a/lld/ELF/Writer.h +++ b/lld/ELF/Writer.h @@ -23,7 +23,6 @@ class InputSectionBase; template <class ELFT> class ObjFile; class SymbolTable; template <class ELFT> void writeResult(); -template <class ELFT> void markLive(); // This describes a program header entry. // Each contains type, access flags and range of output sections that will be |