diff options
Diffstat (limited to 'llvm/lib/Object')
| -rw-r--r-- | llvm/lib/Object/Decompressor.cpp | 7 | ||||
| -rw-r--r-- | llvm/lib/Object/ELF.cpp | 1 | ||||
| -rw-r--r-- | llvm/lib/Object/ELFObjectFile.cpp | 18 | ||||
| -rw-r--r-- | llvm/lib/Object/Error.cpp | 6 |
4 files changed, 16 insertions, 16 deletions
diff --git a/llvm/lib/Object/Decompressor.cpp b/llvm/lib/Object/Decompressor.cpp index de067ed59ac5..a6a28a0589ac 100644 --- a/llvm/lib/Object/Decompressor.cpp +++ b/llvm/lib/Object/Decompressor.cpp @@ -19,7 +19,7 @@ using namespace object; Expected<Decompressor> Decompressor::create(StringRef Name, StringRef Data, bool IsLE, bool Is64Bit) { - if (!zlib::isAvailable()) + if (!compression::zlib::isAvailable()) return createError("zlib is not available"); Decompressor D(Data); @@ -92,7 +92,8 @@ bool Decompressor::isCompressedELFSection(uint64_t Flags, StringRef Name) { return (Flags & ELF::SHF_COMPRESSED) || isGnuStyle(Name); } -Error Decompressor::decompress(MutableArrayRef<char> Buffer) { +Error Decompressor::decompress(MutableArrayRef<uint8_t> Buffer) { size_t Size = Buffer.size(); - return zlib::uncompress(SectionData, Buffer.data(), Size); + return compression::zlib::uncompress(arrayRefFromStringRef(SectionData), + Buffer.data(), Size); } diff --git a/llvm/lib/Object/ELF.cpp b/llvm/lib/Object/ELF.cpp index 6acf4543be5a..0d5aa91c1348 100644 --- a/llvm/lib/Object/ELF.cpp +++ b/llvm/lib/Object/ELF.cpp @@ -297,6 +297,7 @@ StringRef llvm::object::getELFSectionTypeName(uint32_t Machine, unsigned Type) { STRINGIFY_ENUM_CASE(ELF, SHT_LLVM_PART_PHDR); STRINGIFY_ENUM_CASE(ELF, SHT_LLVM_BB_ADDR_MAP_V0); STRINGIFY_ENUM_CASE(ELF, SHT_LLVM_BB_ADDR_MAP); + STRINGIFY_ENUM_CASE(ELF, SHT_LLVM_OFFLOADING); STRINGIFY_ENUM_CASE(ELF, SHT_GNU_ATTRIBUTES); STRINGIFY_ENUM_CASE(ELF, SHT_GNU_HASH); STRINGIFY_ENUM_CASE(ELF, SHT_GNU_verdef); diff --git a/llvm/lib/Object/ELFObjectFile.cpp b/llvm/lib/Object/ELFObjectFile.cpp index 38de669f1d3d..1f342e55e77f 100644 --- a/llvm/lib/Object/ELFObjectFile.cpp +++ b/llvm/lib/Object/ELFObjectFile.cpp @@ -168,11 +168,11 @@ SubtargetFeatures ELFObjectFileBase::getARMFeatures() const { Optional<unsigned> Attr = Attributes.getAttributeValue(ARMBuildAttrs::CPU_arch); if (Attr) - isV7 = Attr.getValue() == ARMBuildAttrs::v7; + isV7 = Attr.value() == ARMBuildAttrs::v7; Attr = Attributes.getAttributeValue(ARMBuildAttrs::CPU_arch_profile); if (Attr) { - switch (Attr.getValue()) { + switch (Attr.value()) { case ARMBuildAttrs::ApplicationProfile: Features.AddFeature("aclass"); break; @@ -191,7 +191,7 @@ SubtargetFeatures ELFObjectFileBase::getARMFeatures() const { Attr = Attributes.getAttributeValue(ARMBuildAttrs::THUMB_ISA_use); if (Attr) { - switch (Attr.getValue()) { + switch (Attr.value()) { default: break; case ARMBuildAttrs::Not_Allowed: @@ -206,7 +206,7 @@ SubtargetFeatures ELFObjectFileBase::getARMFeatures() const { Attr = Attributes.getAttributeValue(ARMBuildAttrs::FP_arch); if (Attr) { - switch (Attr.getValue()) { + switch (Attr.value()) { default: break; case ARMBuildAttrs::Not_Allowed: @@ -230,7 +230,7 @@ SubtargetFeatures ELFObjectFileBase::getARMFeatures() const { Attr = Attributes.getAttributeValue(ARMBuildAttrs::Advanced_SIMD_arch); if (Attr) { - switch (Attr.getValue()) { + switch (Attr.value()) { default: break; case ARMBuildAttrs::Not_Allowed: @@ -249,7 +249,7 @@ SubtargetFeatures ELFObjectFileBase::getARMFeatures() const { Attr = Attributes.getAttributeValue(ARMBuildAttrs::MVE_arch); if (Attr) { - switch (Attr.getValue()) { + switch (Attr.value()) { default: break; case ARMBuildAttrs::Not_Allowed: @@ -268,7 +268,7 @@ SubtargetFeatures ELFObjectFileBase::getARMFeatures() const { Attr = Attributes.getAttributeValue(ARMBuildAttrs::DIV_use); if (Attr) { - switch (Attr.getValue()) { + switch (Attr.value()) { default: break; case ARMBuildAttrs::DisallowDIV: @@ -524,7 +524,7 @@ void ELFObjectFileBase::setARMSubArch(Triple &TheTriple) const { Optional<unsigned> Attr = Attributes.getAttributeValue(ARMBuildAttrs::CPU_arch); if (Attr) { - switch (Attr.getValue()) { + switch (Attr.value()) { case ARMBuildAttrs::v4: Triple += "v4"; break; @@ -556,7 +556,7 @@ void ELFObjectFileBase::setARMSubArch(Triple &TheTriple) const { Optional<unsigned> ArchProfileAttr = Attributes.getAttributeValue(ARMBuildAttrs::CPU_arch_profile); if (ArchProfileAttr && - ArchProfileAttr.getValue() == ARMBuildAttrs::MicroControllerProfile) + ArchProfileAttr.value() == ARMBuildAttrs::MicroControllerProfile) Triple += "v7m"; else Triple += "v7"; diff --git a/llvm/lib/Object/Error.cpp b/llvm/lib/Object/Error.cpp index 6d1e3f2a59d0..62cb51ca09e4 100644 --- a/llvm/lib/Object/Error.cpp +++ b/llvm/lib/Object/Error.cpp @@ -13,7 +13,6 @@ #include "llvm/Object/Error.h" #include "llvm/ADT/Twine.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/ManagedStatic.h" using namespace llvm; using namespace object; @@ -75,10 +74,9 @@ void GenericBinaryError::log(raw_ostream &OS) const { OS << Msg; } -static ManagedStatic<_object_error_category> error_category; - const std::error_category &object::object_category() { - return *error_category; + static _object_error_category error_category; + return error_category; } llvm::Error llvm::object::isNotObjectErrorInvalidFileType(llvm::Error Err) { |
