diff --git a/lld/include/lld/ReaderWriter/Alias.h b/lld/include/lld/Core/Alias.h similarity index 94% rename from lld/include/lld/ReaderWriter/Alias.h rename to lld/include/lld/Core/Alias.h index 1818c5a479e6..31b6f41f7116 100644 --- a/lld/include/lld/ReaderWriter/Alias.h +++ b/lld/include/lld/Core/Alias.h @@ -1,4 +1,4 @@ -//===- lld/ReaderWriter/Alias.h - Alias atoms -----------------------------===// +//===- lld/Core/Alias.h - Alias atoms -------------------------------------===// // // The LLVM Linker // @@ -12,11 +12,11 @@ /// //===----------------------------------------------------------------------===// -#ifndef LLD_READER_WRITER_ALIAS_H -#define LLD_READER_WRITER_ALIAS_H +#ifndef LLD_CORE_ALIAS_H +#define LLD_CORE_ALIAS_H #include "lld/Core/LLVM.h" -#include "lld/ReaderWriter/Simple.h" +#include "lld/Core/Simple.h" #include "llvm/ADT/Optional.h" #include diff --git a/lld/include/lld/ReaderWriter/Simple.h b/lld/include/lld/Core/Simple.h similarity index 97% rename from lld/include/lld/ReaderWriter/Simple.h rename to lld/include/lld/Core/Simple.h index 58bab737c1d4..6e6a99111c24 100644 --- a/lld/include/lld/ReaderWriter/Simple.h +++ b/lld/include/lld/Core/Simple.h @@ -1,4 +1,4 @@ -//===- lld/ReaderWriter/Simple.h - Simple implementations of Atom and File ===// +//===- lld/Core/Simple.h - Simple implementations of Atom and File --------===// // // The LLVM Linker // @@ -12,8 +12,8 @@ /// //===----------------------------------------------------------------------===// -#ifndef LLD_READER_WRITER_SIMPLE_H -#define LLD_READER_WRITER_SIMPLE_H +#ifndef LLD_CORE_SIMPLE_H +#define LLD_CORE_SIMPLE_H #include "lld/Core/DefinedAtom.h" #include "lld/Core/File.h" @@ -21,6 +21,7 @@ #include "lld/Core/UndefinedAtom.h" namespace lld { + class SimpleFile : public MutableFile { public: SimpleFile(StringRef path) : MutableFile(path) {} @@ -197,6 +198,7 @@ private: const File &_file; StringRef _name; }; + } // end namespace lld #endif diff --git a/lld/lib/Core/LinkingContext.cpp b/lld/lib/Core/LinkingContext.cpp index 56388e1a735f..06e06268cf57 100644 --- a/lld/lib/Core/LinkingContext.cpp +++ b/lld/lib/Core/LinkingContext.cpp @@ -7,10 +7,10 @@ // //===----------------------------------------------------------------------===// +#include "lld/Core/Alias.h" #include "lld/Core/LinkingContext.h" #include "lld/Core/Resolver.h" -#include "lld/ReaderWriter/Alias.h" -#include "lld/ReaderWriter/Simple.h" +#include "lld/Core/Simple.h" #include "lld/ReaderWriter/Writer.h" #include "llvm/ADT/Triple.h" diff --git a/lld/lib/Passes/RoundTripNativePass.cpp b/lld/lib/Passes/RoundTripNativePass.cpp index 724baad4e74b..694e8d398935 100644 --- a/lld/lib/Passes/RoundTripNativePass.cpp +++ b/lld/lib/Passes/RoundTripNativePass.cpp @@ -8,8 +8,8 @@ //===----------------------------------------------------------------------===// #include "lld/Core/Instrumentation.h" +#include "lld/Core/Simple.h" #include "lld/Passes/RoundTripNativePass.h" -#include "lld/ReaderWriter/Simple.h" #include "lld/ReaderWriter/Writer.h" #include "llvm/Support/Debug.h" diff --git a/lld/lib/Passes/RoundTripYAMLPass.cpp b/lld/lib/Passes/RoundTripYAMLPass.cpp index ba9926a1f224..d0e085d29d33 100644 --- a/lld/lib/Passes/RoundTripYAMLPass.cpp +++ b/lld/lib/Passes/RoundTripYAMLPass.cpp @@ -6,9 +6,10 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// + #include "lld/Core/Instrumentation.h" +#include "lld/Core/Simple.h" #include "lld/Passes/RoundTripYAMLPass.h" -#include "lld/ReaderWriter/Simple.h" #include "lld/ReaderWriter/Writer.h" #include "llvm/Support/Debug.h" diff --git a/lld/lib/ReaderWriter/CoreLinkingContext.cpp b/lld/lib/ReaderWriter/CoreLinkingContext.cpp index ff8fe37c6225..0adaa017672b 100644 --- a/lld/lib/ReaderWriter/CoreLinkingContext.cpp +++ b/lld/lib/ReaderWriter/CoreLinkingContext.cpp @@ -11,9 +11,9 @@ #include "lld/Core/Pass.h" #include "lld/Core/PassManager.h" +#include "lld/Core/Simple.h" #include "lld/Passes/LayoutPass.h" #include "lld/Passes/RoundTripYAMLPass.h" -#include "lld/ReaderWriter/Simple.h" #include "llvm/ADT/ArrayRef.h" diff --git a/lld/lib/ReaderWriter/ELF/Atoms.h b/lld/lib/ReaderWriter/ELF/Atoms.h index 81d1c7ee6f33..50c5e8c9f928 100644 --- a/lld/lib/ReaderWriter/ELF/Atoms.h +++ b/lld/lib/ReaderWriter/ELF/Atoms.h @@ -13,7 +13,7 @@ #include "TargetHandler.h" #include "lld/Core/LLVM.h" -#include "lld/ReaderWriter/Simple.h" +#include "lld/Core/Simple.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/StringSwitch.h" diff --git a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.cpp b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.cpp index f251b8256b93..5fbec166d667 100644 --- a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.cpp +++ b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.cpp @@ -14,7 +14,7 @@ #include "lld/Core/File.h" #include "lld/Core/Pass.h" #include "lld/Core/PassManager.h" -#include "lld/ReaderWriter/Simple.h" +#include "lld/Core/Simple.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/DenseMap.h" diff --git a/lld/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp b/lld/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp index f03b5be52ef7..fd8baf6036aa 100644 --- a/lld/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp +++ b/lld/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp @@ -21,7 +21,7 @@ #include "X86_64RelocationPass.h" -#include "lld/ReaderWriter/Simple.h" +#include "lld/Core/Simple.h" #include "llvm/ADT/DenseMap.h" diff --git a/lld/lib/ReaderWriter/ELF/X86_64/X86_64TargetHandler.h b/lld/lib/ReaderWriter/ELF/X86_64/X86_64TargetHandler.h index 5c13a96ad2c5..04a63d010948 100644 --- a/lld/lib/ReaderWriter/ELF/X86_64/X86_64TargetHandler.h +++ b/lld/lib/ReaderWriter/ELF/X86_64/X86_64TargetHandler.h @@ -15,7 +15,7 @@ #include "X86_64RelocationHandler.h" #include "TargetLayout.h" -#include "lld/ReaderWriter/Simple.h" +#include "lld/Core/Simple.h" namespace lld { namespace elf { diff --git a/lld/lib/ReaderWriter/MachO/Atoms.h b/lld/lib/ReaderWriter/MachO/Atoms.h index b3d3e2aa1ea1..3d073904ab84 100644 --- a/lld/lib/ReaderWriter/MachO/Atoms.h +++ b/lld/lib/ReaderWriter/MachO/Atoms.h @@ -10,7 +10,7 @@ #ifndef LLD_READER_WRITER_MACHO_ATOMS_H #define LLD_READER_WRITER_MACHO_ATOMS_H -#include "lld/ReaderWriter/Simple.h" +#include "lld/Core/Simple.h" namespace lld { namespace mach_o { diff --git a/lld/lib/ReaderWriter/MachO/ExecutableAtoms.hpp b/lld/lib/ReaderWriter/MachO/ExecutableAtoms.hpp index 144baf7a562c..b6d615ae20ed 100644 --- a/lld/lib/ReaderWriter/MachO/ExecutableAtoms.hpp +++ b/lld/lib/ReaderWriter/MachO/ExecutableAtoms.hpp @@ -13,11 +13,11 @@ #include "llvm/Support/MachO.h" #include "lld/Core/DefinedAtom.h" -#include "lld/Core/UndefinedAtom.h" #include "lld/Core/File.h" -#include "lld/Core/Reference.h" #include "lld/Core/LinkingContext.h" -#include "lld/ReaderWriter/Simple.h" +#include "lld/Core/Reference.h" +#include "lld/Core/Simple.h" +#include "lld/Core/UndefinedAtom.h" namespace lld { namespace mach_o { diff --git a/lld/lib/ReaderWriter/MachO/File.h b/lld/lib/ReaderWriter/MachO/File.h index c466231e4006..9c507e8c28ee 100644 --- a/lld/lib/ReaderWriter/MachO/File.h +++ b/lld/lib/ReaderWriter/MachO/File.h @@ -12,7 +12,7 @@ #include "Atoms.h" -#include "lld/ReaderWriter/Simple.h" +#include "lld/Core/Simple.h" namespace lld { namespace mach_o { diff --git a/lld/lib/ReaderWriter/MachO/StubAtoms.hpp b/lld/lib/ReaderWriter/MachO/StubAtoms.hpp index 2e53f983994c..64afd1ac35f0 100644 --- a/lld/lib/ReaderWriter/MachO/StubAtoms.hpp +++ b/lld/lib/ReaderWriter/MachO/StubAtoms.hpp @@ -13,10 +13,10 @@ #include "llvm/ADT/ArrayRef.h" #include "lld/Core/DefinedAtom.h" -#include "lld/Core/SharedLibraryAtom.h" #include "lld/Core/File.h" #include "lld/Core/Reference.h" -#include "lld/ReaderWriter/Simple.h" +#include "lld/Core/SharedLibraryAtom.h" +#include "lld/Core/Simple.h" #include "ReferenceKinds.h" #include "StubAtoms_x86_64.hpp" diff --git a/lld/lib/ReaderWriter/MachO/StubsPass.hpp b/lld/lib/ReaderWriter/MachO/StubsPass.hpp index 712048a3b7e8..8dac613f0b08 100644 --- a/lld/lib/ReaderWriter/MachO/StubsPass.hpp +++ b/lld/lib/ReaderWriter/MachO/StubsPass.hpp @@ -13,11 +13,11 @@ #include "llvm/ADT/DenseMap.h" #include "lld/Core/DefinedAtom.h" -#include "lld/Core/SharedLibraryAtom.h" #include "lld/Core/File.h" -#include "lld/Core/Reference.h" #include "lld/Core/Pass.h" -#include "lld/ReaderWriter/Simple.h" +#include "lld/Core/Reference.h" +#include "lld/Core/SharedLibraryAtom.h" +#include "lld/Core/Simple.h" #include "ReferenceKinds.h" #include "StubAtoms.hpp" diff --git a/lld/lib/ReaderWriter/Native/ReaderNative.cpp b/lld/lib/ReaderWriter/Native/ReaderNative.cpp index e6871aea7d49..76be92258ae4 100644 --- a/lld/lib/ReaderWriter/Native/ReaderNative.cpp +++ b/lld/lib/ReaderWriter/Native/ReaderNative.cpp @@ -9,12 +9,11 @@ #include "NativeFileFormat.h" -#include "lld/ReaderWriter/Reader.h" -#include "lld/ReaderWriter/Simple.h" - #include "lld/Core/Atom.h" #include "lld/Core/Error.h" #include "lld/Core/File.h" +#include "lld/Core/Simple.h" +#include "lld/ReaderWriter/Reader.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/StringRef.h" diff --git a/lld/lib/ReaderWriter/PECOFF/Atoms.h b/lld/lib/ReaderWriter/PECOFF/Atoms.h index c4ae1271c0b3..16aea4f00ebb 100644 --- a/lld/lib/ReaderWriter/PECOFF/Atoms.h +++ b/lld/lib/ReaderWriter/PECOFF/Atoms.h @@ -11,7 +11,7 @@ #define LLD_READER_WRITER_PE_COFF_ATOMS_H #include "lld/Core/File.h" -#include "lld/ReaderWriter/Simple.h" +#include "lld/Core/Simple.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/Object/COFF.h" diff --git a/lld/lib/ReaderWriter/PECOFF/EdataPass.cpp b/lld/lib/ReaderWriter/PECOFF/EdataPass.cpp index 39ca039a5e05..8b8cc1a86199 100644 --- a/lld/lib/ReaderWriter/PECOFF/EdataPass.cpp +++ b/lld/lib/ReaderWriter/PECOFF/EdataPass.cpp @@ -12,7 +12,7 @@ #include "lld/Core/File.h" #include "lld/Core/Pass.h" -#include "lld/ReaderWriter/Simple.h" +#include "lld/Core/Simple.h" #include "llvm/Support/Debug.h" #include "llvm/Support/Path.h" diff --git a/lld/lib/ReaderWriter/PECOFF/EdataPass.h b/lld/lib/ReaderWriter/PECOFF/EdataPass.h index 4645bd188466..3258b6c0a1c4 100644 --- a/lld/lib/ReaderWriter/PECOFF/EdataPass.h +++ b/lld/lib/ReaderWriter/PECOFF/EdataPass.h @@ -23,8 +23,8 @@ #include "lld/Core/File.h" #include "lld/Core/Pass.h" +#include "lld/Core/Simple.h" #include "lld/ReaderWriter/PECOFFLinkingContext.h" -#include "lld/ReaderWriter/Simple.h" #include "llvm/Support/COFF.h" #include diff --git a/lld/lib/ReaderWriter/PECOFF/IdataPass.cpp b/lld/lib/ReaderWriter/PECOFF/IdataPass.cpp index 578e519373a4..7bb921c4d012 100644 --- a/lld/lib/ReaderWriter/PECOFF/IdataPass.cpp +++ b/lld/lib/ReaderWriter/PECOFF/IdataPass.cpp @@ -12,7 +12,7 @@ #include "lld/Core/File.h" #include "lld/Core/Pass.h" -#include "lld/ReaderWriter/Simple.h" +#include "lld/Core/Simple.h" #include "llvm/Support/COFF.h" #include "llvm/Support/Debug.h" #include "llvm/Support/Endian.h" diff --git a/lld/lib/ReaderWriter/PECOFF/IdataPass.h b/lld/lib/ReaderWriter/PECOFF/IdataPass.h index 979840042bca..99b360f3055b 100644 --- a/lld/lib/ReaderWriter/PECOFF/IdataPass.h +++ b/lld/lib/ReaderWriter/PECOFF/IdataPass.h @@ -23,7 +23,7 @@ #include "lld/Core/File.h" #include "lld/Core/Pass.h" -#include "lld/ReaderWriter/Simple.h" +#include "lld/Core/Simple.h" #include "llvm/Support/COFF.h" #include diff --git a/lld/lib/ReaderWriter/PECOFF/LinkerGeneratedSymbolFile.h b/lld/lib/ReaderWriter/PECOFF/LinkerGeneratedSymbolFile.h index 3cfc8a59492a..b5ee4f19407a 100644 --- a/lld/lib/ReaderWriter/PECOFF/LinkerGeneratedSymbolFile.h +++ b/lld/lib/ReaderWriter/PECOFF/LinkerGeneratedSymbolFile.h @@ -10,8 +10,8 @@ #include "Atoms.h" #include "lld/Core/ArchiveLibraryFile.h" +#include "lld/Core/Simple.h" #include "lld/ReaderWriter/PECOFFLinkingContext.h" -#include "lld/ReaderWriter/Simple.h" #include "llvm/Support/Allocator.h" #include diff --git a/lld/lib/ReaderWriter/PECOFF/LoadConfigPass.cpp b/lld/lib/ReaderWriter/PECOFF/LoadConfigPass.cpp index 1463c47ba981..e8c028a54c51 100644 --- a/lld/lib/ReaderWriter/PECOFF/LoadConfigPass.cpp +++ b/lld/lib/ReaderWriter/PECOFF/LoadConfigPass.cpp @@ -22,7 +22,7 @@ #include "lld/Core/File.h" #include "lld/Core/Pass.h" -#include "lld/ReaderWriter/Simple.h" +#include "lld/Core/Simple.h" #include "llvm/Object/COFF.h" #include "llvm/Support/Debug.h" #include "llvm/Support/Path.h" diff --git a/lld/lib/ReaderWriter/PECOFF/LoadConfigPass.h b/lld/lib/ReaderWriter/PECOFF/LoadConfigPass.h index ba942d314692..4ff0a8c5501d 100644 --- a/lld/lib/ReaderWriter/PECOFF/LoadConfigPass.h +++ b/lld/lib/ReaderWriter/PECOFF/LoadConfigPass.h @@ -22,8 +22,8 @@ #include "lld/Core/File.h" #include "lld/Core/Pass.h" +#include "lld/Core/Simple.h" #include "lld/ReaderWriter/PECOFFLinkingContext.h" -#include "lld/ReaderWriter/Simple.h" #include diff --git a/lld/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp b/lld/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp index a327192f5b26..a33efc8222ba 100644 --- a/lld/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp +++ b/lld/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp @@ -16,12 +16,12 @@ #include "SetSubsystemPass.h" #include "lld/Core/PassManager.h" +#include "lld/Core/Simple.h" #include "lld/Passes/LayoutPass.h" #include "lld/Passes/RoundTripNativePass.h" #include "lld/Passes/RoundTripYAMLPass.h" #include "lld/ReaderWriter/PECOFFLinkingContext.h" #include "lld/ReaderWriter/Reader.h" -#include "lld/ReaderWriter/Simple.h" #include "lld/ReaderWriter/Writer.h" #include "llvm/ADT/SmallString.h" #include "llvm/Support/Allocator.h" diff --git a/lld/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp b/lld/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp index ed1448a1bd24..82ce4c102b02 100644 --- a/lld/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp +++ b/lld/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp @@ -10,10 +10,10 @@ #include "Atoms.h" #include "ReaderImportHeader.h" +#include "lld/Core/Alias.h" #include "lld/Core/File.h" #include "lld/Driver/Driver.h" #include "lld/ReaderWriter/PECOFFLinkingContext.h" -#include "lld/ReaderWriter/Alias.h" #include "lld/ReaderWriter/Reader.h" #include "llvm/ADT/ArrayRef.h" diff --git a/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp b/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp index 7fe156b8166e..008959bf8d0f 100644 --- a/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp +++ b/lld/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp @@ -7,17 +7,16 @@ // //===----------------------------------------------------------------------===// -#include "lld/ReaderWriter/Reader.h" -#include "lld/ReaderWriter/Simple.h" -#include "lld/ReaderWriter/Writer.h" -#include "lld/ReaderWriter/YamlContext.h" - #include "lld/Core/ArchiveLibraryFile.h" #include "lld/Core/DefinedAtom.h" #include "lld/Core/Error.h" #include "lld/Core/File.h" #include "lld/Core/LLVM.h" #include "lld/Core/Reference.h" +#include "lld/Core/Simple.h" +#include "lld/ReaderWriter/Reader.h" +#include "lld/ReaderWriter/Writer.h" +#include "lld/ReaderWriter/YamlContext.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/StringMap.h" diff --git a/lld/unittests/DriverTests/InputGraphTest.cpp b/lld/unittests/DriverTests/InputGraphTest.cpp index 5c6195f28197..d8275fa934b6 100644 --- a/lld/unittests/DriverTests/InputGraphTest.cpp +++ b/lld/unittests/DriverTests/InputGraphTest.cpp @@ -16,7 +16,7 @@ #include "lld/Core/InputGraph.h" #include "lld/Core/Resolver.h" -#include "lld/ReaderWriter/Simple.h" +#include "lld/Core/Simple.h" using namespace lld;