diff options
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Object/ObjectFile.cpp')
-rw-r--r-- | contrib/llvm-project/llvm/lib/Object/ObjectFile.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
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 <algorithm> #include <cstdint> #include <memory> #include <system_error> @@ -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<ObjectFile>(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; +} |