From 255d6c9fe5a7577c6caf78004034f2555bd0cba0 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 4 Jul 2022 21:20:19 +0200 Subject: Merge llvm-project main llvmorg-15-init-15358-g53dc0f10787 This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvmorg-15-init-15358-g53dc0f10787. PR: 265425 MFC after: 2 weeks (cherry picked from commit 81ad626541db97eb356e2c1d4a20eb2a26a766ab) --- contrib/llvm-project/llvm/lib/Object/ObjectFile.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'contrib/llvm-project/llvm/lib/Object/ObjectFile.cpp') diff --git a/contrib/llvm-project/llvm/lib/Object/ObjectFile.cpp b/contrib/llvm-project/llvm/lib/Object/ObjectFile.cpp index 6fd02f3b9592..1be8f11751be 100644 --- a/contrib/llvm-project/llvm/lib/Object/ObjectFile.cpp +++ b/contrib/llvm-project/llvm/lib/Object/ObjectFile.cpp @@ -21,10 +21,9 @@ #include "llvm/Support/Error.h" #include "llvm/Support/ErrorHandling.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 #include #include #include @@ -147,6 +146,9 @@ ObjectFile::createObjectFile(MemoryBufferRef Object, file_magic Type, case file_magic::pdb: case file_magic::minidump: case file_magic::goff_object: + case file_magic::cuda_fatbinary: + case file_magic::offload_binary: + case file_magic::dxcontainer_object: return errorCodeToError(object_error::invalid_file_type); case file_magic::tapi_file: return errorCodeToError(object_error::invalid_file_type); @@ -198,3 +200,12 @@ ObjectFile::createObjectFile(StringRef ObjectPath) { return OwningBinary(std::move(Obj), std::move(Buffer)); } + +bool ObjectFile::isReflectionSectionStrippable( + llvm::binaryformat::Swift5ReflectionSectionKind ReflectionSectionKind) + const { + using llvm::binaryformat::Swift5ReflectionSectionKind; + return ReflectionSectionKind == Swift5ReflectionSectionKind::fieldmd || + ReflectionSectionKind == Swift5ReflectionSectionKind::reflstr || + ReflectionSectionKind == Swift5ReflectionSectionKind::assocty; +} -- cgit v1.2.3