From 6f8fc217eaa12bf657be1c6468ed9938d10168b3 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Thu, 27 Jan 2022 23:06:42 +0100 Subject: Vendor import of llvm-project main llvmorg-14-init-17616-g024a1fab5c35. --- llvm/lib/BinaryFormat/AMDGPUMetadataVerifier.cpp | 8 +++++++- llvm/lib/BinaryFormat/ELF.cpp | 3 +-- llvm/lib/BinaryFormat/Magic.cpp | 7 ++++--- 3 files changed, 12 insertions(+), 6 deletions(-) (limited to 'llvm/lib/BinaryFormat') diff --git a/llvm/lib/BinaryFormat/AMDGPUMetadataVerifier.cpp b/llvm/lib/BinaryFormat/AMDGPUMetadataVerifier.cpp index 284e469a1d2f..99d2c8221281 100644 --- a/llvm/lib/BinaryFormat/AMDGPUMetadataVerifier.cpp +++ b/llvm/lib/BinaryFormat/AMDGPUMetadataVerifier.cpp @@ -12,8 +12,14 @@ //===----------------------------------------------------------------------===// #include "llvm/BinaryFormat/AMDGPUMetadataVerifier.h" + +#include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/STLForwardCompat.h" #include "llvm/ADT/StringSwitch.h" -#include "llvm/Support/AMDGPUMetadata.h" +#include "llvm/BinaryFormat/MsgPackDocument.h" + +#include +#include namespace llvm { namespace AMDGPU { diff --git a/llvm/lib/BinaryFormat/ELF.cpp b/llvm/lib/BinaryFormat/ELF.cpp index 2ede63f464d3..e2e601b6d90f 100644 --- a/llvm/lib/BinaryFormat/ELF.cpp +++ b/llvm/lib/BinaryFormat/ELF.cpp @@ -7,9 +7,8 @@ //===----------------------------------------------------------------------===// #include "llvm/BinaryFormat/ELF.h" -#include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/DenseMapInfo.h" #include "llvm/ADT/StringSwitch.h" -#include "llvm/Support/Error.h" using namespace llvm; using namespace ELF; diff --git a/llvm/lib/BinaryFormat/Magic.cpp b/llvm/lib/BinaryFormat/Magic.cpp index 8c7f7b7043a0..044e4840cb3b 100644 --- a/llvm/lib/BinaryFormat/Magic.cpp +++ b/llvm/lib/BinaryFormat/Magic.cpp @@ -10,10 +10,8 @@ #include "llvm/ADT/StringRef.h" #include "llvm/ADT/Twine.h" #include "llvm/BinaryFormat/COFF.h" -#include "llvm/BinaryFormat/ELF.h" #include "llvm/BinaryFormat/MachO.h" #include "llvm/Support/Endian.h" -#include "llvm/Support/FileSystem.h" #include "llvm/Support/MemoryBuffer.h" #if !defined(_MSC_VER) && !defined(__MINGW32__) @@ -88,7 +86,10 @@ file_magic llvm::identify_magic(StringRef Magic) { if (startswith(Magic, "!\n") || startswith(Magic, "!\n")) return file_magic::archive; break; - + case '<': + if (startswith(Magic, "\n")) + return file_magic::archive; + break; case '\177': if (startswith(Magic, "\177ELF") && Magic.size() >= 18) { bool Data2MSB = Magic[5] == 2; -- cgit v1.2.3