diff options
Diffstat (limited to 'lib/ReaderWriter')
-rw-r--r-- | lib/ReaderWriter/FileArchive.cpp | 13 | ||||
-rw-r--r-- | lib/ReaderWriter/MachO/ExecutableAtoms.h | 2 | ||||
-rw-r--r-- | lib/ReaderWriter/MachO/MachOLinkingContext.cpp | 2 | ||||
-rw-r--r-- | lib/ReaderWriter/MachO/MachONormalizedFile.h | 2 | ||||
-rw-r--r-- | lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp | 15 | ||||
-rw-r--r-- | lib/ReaderWriter/MachO/MachONormalizedFileBinaryUtils.h | 2 | ||||
-rw-r--r-- | lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp | 6 | ||||
-rw-r--r-- | lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp | 5 | ||||
-rw-r--r-- | lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp | 6 | ||||
-rw-r--r-- | lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp | 3 | ||||
-rw-r--r-- | lib/ReaderWriter/MachO/WriterMachO.cpp | 2 | ||||
-rw-r--r-- | lib/ReaderWriter/YAML/ReaderWriterYAML.cpp | 2 |
12 files changed, 33 insertions, 27 deletions
diff --git a/lib/ReaderWriter/FileArchive.cpp b/lib/ReaderWriter/FileArchive.cpp index 799f947a8c82b..762d0871db063 100644 --- a/lib/ReaderWriter/FileArchive.cpp +++ b/lib/ReaderWriter/FileArchive.cpp @@ -11,15 +11,16 @@ #include "lld/Core/File.h" #include "lld/Core/LLVM.h" #include "lld/Core/Reader.h" +#include "llvm/ADT/STLExtras.h" #include "llvm/ADT/StringRef.h" +#include "llvm/BinaryFormat/Magic.h" #include "llvm/Object/Archive.h" -#include "llvm/Support/Debug.h" -#include "llvm/Support/Format.h" -#include "llvm/Support/MemoryBuffer.h" -#include "llvm/ADT/STLExtras.h" #include "llvm/Object/Error.h" +#include "llvm/Support/Debug.h" #include "llvm/Support/ErrorOr.h" #include "llvm/Support/FileSystem.h" +#include "llvm/Support/Format.h" +#include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/raw_ostream.h" #include <memory> #include <set> @@ -30,6 +31,8 @@ #include <vector> using llvm::object::Archive; +using llvm::file_magic; +using llvm::identify_magic; namespace lld { @@ -201,7 +204,7 @@ public: ArchiveReader(bool logLoading) : _logLoading(logLoading) {} bool canParse(file_magic magic, MemoryBufferRef) const override { - return magic == llvm::sys::fs::file_magic::archive; + return magic == file_magic::archive; } ErrorOr<std::unique_ptr<File>> loadFile(std::unique_ptr<MemoryBuffer> mb, diff --git a/lib/ReaderWriter/MachO/ExecutableAtoms.h b/lib/ReaderWriter/MachO/ExecutableAtoms.h index acced33b7e74f..ab14e6d8c3e78 100644 --- a/lib/ReaderWriter/MachO/ExecutableAtoms.h +++ b/lib/ReaderWriter/MachO/ExecutableAtoms.h @@ -13,7 +13,7 @@ #include "Atoms.h" #include "File.h" -#include "llvm/Support/MachO.h" +#include "llvm/BinaryFormat/MachO.h" #include "lld/Core/DefinedAtom.h" #include "lld/Core/File.h" diff --git a/lib/ReaderWriter/MachO/MachOLinkingContext.cpp b/lib/ReaderWriter/MachO/MachOLinkingContext.cpp index db4a96823e74e..7e7b559b150ab 100644 --- a/lib/ReaderWriter/MachO/MachOLinkingContext.cpp +++ b/lib/ReaderWriter/MachO/MachOLinkingContext.cpp @@ -22,11 +22,11 @@ #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/StringExtras.h" #include "llvm/ADT/Triple.h" +#include "llvm/BinaryFormat/MachO.h" #include "llvm/Demangle/Demangle.h" #include "llvm/Support/Debug.h" #include "llvm/Support/Errc.h" #include "llvm/Support/Host.h" -#include "llvm/Support/MachO.h" #include "llvm/Support/Path.h" #include <algorithm> diff --git a/lib/ReaderWriter/MachO/MachONormalizedFile.h b/lib/ReaderWriter/MachO/MachONormalizedFile.h index 60d76d4b5c9b6..31b24dfd10251 100644 --- a/lib/ReaderWriter/MachO/MachONormalizedFile.h +++ b/lib/ReaderWriter/MachO/MachONormalizedFile.h @@ -48,10 +48,10 @@ #include "lld/ReaderWriter/MachOLinkingContext.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringRef.h" +#include "llvm/BinaryFormat/MachO.h" #include "llvm/Support/Allocator.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorOr.h" -#include "llvm/Support/MachO.h" #include "llvm/Support/YAMLTraits.h" using llvm::BumpPtrAllocator; diff --git a/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp b/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp index 23c7ea17f7e7e..edbe576f00863 100644 --- a/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp +++ b/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp @@ -21,24 +21,25 @@ /// | normalized | /// +------------+ -#include "MachONormalizedFile.h" #include "ArchHandler.h" +#include "MachONormalizedFile.h" #include "MachONormalizedFileBinaryUtils.h" #include "lld/Core/Error.h" #include "lld/Core/LLVM.h" #include "lld/Core/SharedLibraryFile.h" +#include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringRef.h" #include "llvm/ADT/StringSwitch.h" -#include "llvm/ADT/STLExtras.h" #include "llvm/ADT/Twine.h" +#include "llvm/BinaryFormat/MachO.h" +#include "llvm/BinaryFormat/Magic.h" #include "llvm/Object/MachO.h" #include "llvm/Support/Casting.h" #include "llvm/Support/Errc.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/FileOutputBuffer.h" #include "llvm/Support/Host.h" -#include "llvm/Support/MachO.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/raw_ostream.h" #include <functional> @@ -46,6 +47,7 @@ using namespace llvm::MachO; using llvm::object::ExportEntry; +using llvm::file_magic; using llvm::object::MachOObjectFile; namespace lld { @@ -531,8 +533,7 @@ public: MachOObjectReader(MachOLinkingContext &ctx) : _ctx(ctx) {} bool canParse(file_magic magic, MemoryBufferRef mb) const override { - return (magic == llvm::sys::fs::file_magic::macho_object && - mb.getBufferSize() > 32); + return (magic == file_magic::macho_object && mb.getBufferSize() > 32); } ErrorOr<std::unique_ptr<File>> @@ -553,8 +554,8 @@ public: bool canParse(file_magic magic, MemoryBufferRef mb) const override { switch (magic) { - case llvm::sys::fs::file_magic::macho_dynamically_linked_shared_lib: - case llvm::sys::fs::file_magic::macho_dynamically_linked_shared_lib_stub: + case file_magic::macho_dynamically_linked_shared_lib: + case file_magic::macho_dynamically_linked_shared_lib_stub: return mb.getBufferSize() > 32; default: return false; diff --git a/lib/ReaderWriter/MachO/MachONormalizedFileBinaryUtils.h b/lib/ReaderWriter/MachO/MachONormalizedFileBinaryUtils.h index d69c5389e9d68..b38f7059228fd 100644 --- a/lib/ReaderWriter/MachO/MachONormalizedFileBinaryUtils.h +++ b/lib/ReaderWriter/MachO/MachONormalizedFileBinaryUtils.h @@ -14,12 +14,12 @@ #include "lld/Core/Error.h" #include "lld/Core/LLVM.h" #include "llvm/ADT/StringRef.h" +#include "llvm/BinaryFormat/MachO.h" #include "llvm/Support/Casting.h" #include "llvm/Support/Endian.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/Host.h" #include "llvm/Support/LEB128.h" -#include "llvm/Support/MachO.h" #include <system_error> namespace lld { diff --git a/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp b/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp index e853faf9112e6..bac41d2a52bfb 100644 --- a/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp +++ b/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp @@ -25,11 +25,12 @@ #include "MachONormalizedFileBinaryUtils.h" #include "lld/Core/Error.h" #include "lld/Core/LLVM.h" -#include "llvm/ADT/ilist.h" -#include "llvm/ADT/ilist_node.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" +#include "llvm/ADT/ilist.h" +#include "llvm/ADT/ilist_node.h" +#include "llvm/BinaryFormat/MachO.h" #include "llvm/Support/Casting.h" #include "llvm/Support/Debug.h" #include "llvm/Support/Errc.h" @@ -37,7 +38,6 @@ #include "llvm/Support/FileOutputBuffer.h" #include "llvm/Support/Format.h" #include "llvm/Support/Host.h" -#include "llvm/Support/MachO.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/raw_ostream.h" #include <functional> diff --git a/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp b/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp index ddd3259842e26..e58e3d2e7a4b2 100644 --- a/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp +++ b/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp @@ -20,19 +20,19 @@ /// | Atoms | /// +-------+ -#include "MachONormalizedFile.h" #include "ArchHandler.h" #include "DebugInfo.h" +#include "MachONormalizedFile.h" #include "MachONormalizedFileBinaryUtils.h" #include "lld/Core/Error.h" #include "lld/Core/LLVM.h" #include "llvm/ADT/StringRef.h" #include "llvm/ADT/StringSwitch.h" +#include "llvm/BinaryFormat/MachO.h" #include "llvm/Support/Casting.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/Format.h" -#include "llvm/Support/MachO.h" #include <map> #include <system_error> #include <unordered_set> @@ -515,6 +515,7 @@ void Util::organizeSections() { // Main executables, need a zero-page segment segmentForName("__PAGEZERO"); // Fall into next case. + LLVM_FALLTHROUGH; case llvm::MachO::MH_DYLIB: case llvm::MachO::MH_BUNDLE: // All dynamic code needs TEXT segment to hold the load commands. diff --git a/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp b/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp index 4b17f7b3a85f1..18fb71f16bcf6 100644 --- a/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp +++ b/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp @@ -20,20 +20,20 @@ /// | Atoms | /// +-------+ -#include "MachONormalizedFile.h" #include "ArchHandler.h" #include "Atoms.h" #include "File.h" +#include "MachONormalizedFile.h" #include "MachONormalizedFileBinaryUtils.h" #include "lld/Core/Error.h" #include "lld/Core/LLVM.h" +#include "llvm/BinaryFormat/Dwarf.h" +#include "llvm/BinaryFormat/MachO.h" #include "llvm/DebugInfo/DWARF/DWARFFormValue.h" #include "llvm/Support/DataExtractor.h" #include "llvm/Support/Debug.h" -#include "llvm/Support/Dwarf.h" #include "llvm/Support/Error.h" #include "llvm/Support/Format.h" -#include "llvm/Support/MachO.h" #include "llvm/Support/LEB128.h" #include "llvm/Support/raw_ostream.h" diff --git a/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp b/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp index 218170965eca3..fe67fc88c467d 100644 --- a/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp +++ b/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp @@ -23,17 +23,16 @@ #include "llvm/ADT/StringRef.h" #include "llvm/ADT/StringSwitch.h" #include "llvm/ADT/Twine.h" +#include "llvm/BinaryFormat/MachO.h" #include "llvm/Support/Casting.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/Format.h" -#include "llvm/Support/MachO.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/SourceMgr.h" #include "llvm/Support/YAMLTraits.h" #include "llvm/Support/raw_ostream.h" #include <system_error> - using llvm::StringRef; using namespace llvm::yaml; using namespace llvm::MachO; diff --git a/lib/ReaderWriter/MachO/WriterMachO.cpp b/lib/ReaderWriter/MachO/WriterMachO.cpp index f08487f21ac1c..c457e7b55a436 100644 --- a/lib/ReaderWriter/MachO/WriterMachO.cpp +++ b/lib/ReaderWriter/MachO/WriterMachO.cpp @@ -12,10 +12,10 @@ #include "lld/Core/File.h" #include "lld/Core/Writer.h" #include "lld/ReaderWriter/MachOLinkingContext.h" +#include "llvm/BinaryFormat/MachO.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/FileOutputBuffer.h" -#include "llvm/Support/MachO.h" #include "llvm/Support/raw_ostream.h" #include <system_error> diff --git a/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp b/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp index 59ca43079a6df..4c88eb1d14762 100644 --- a/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp +++ b/lib/ReaderWriter/YAML/ReaderWriterYAML.cpp @@ -26,6 +26,7 @@ #include "llvm/ADT/StringMap.h" #include "llvm/ADT/StringRef.h" #include "llvm/ADT/Twine.h" +#include "llvm/BinaryFormat/Magic.h" #include "llvm/Support/Allocator.h" #include "llvm/Support/Debug.h" #include "llvm/Support/Error.h" @@ -43,6 +44,7 @@ #include <system_error> #include <vector> +using llvm::file_magic; using llvm::yaml::MappingTraits; using llvm::yaml::ScalarEnumerationTraits; using llvm::yaml::ScalarTraits; |