From b773203fb58f3ef282fb69c832d8710cab5bc82d Mon Sep 17 00:00:00 2001 From: patrick Date: Sun, 27 Jan 2019 16:42:12 +0000 Subject: Import LLVM 7.0.1 release including clang, lld and lldb. --- gnu/llvm/lib/Object/ELFObjectFile.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'gnu/llvm/lib/Object/ELFObjectFile.cpp') diff --git a/gnu/llvm/lib/Object/ELFObjectFile.cpp b/gnu/llvm/lib/Object/ELFObjectFile.cpp index 0aad1c89a2d..e806c8f28b1 100644 --- a/gnu/llvm/lib/Object/ELFObjectFile.cpp +++ b/gnu/llvm/lib/Object/ELFObjectFile.cpp @@ -76,8 +76,7 @@ ObjectFile::createELFObjectFile(MemoryBufferRef Obj) { SubtargetFeatures ELFObjectFileBase::getMIPSFeatures() const { SubtargetFeatures Features; - unsigned PlatformFlags; - getPlatformFlags(PlatformFlags); + unsigned PlatformFlags = getPlatformFlags(); switch (PlatformFlags & ELF::EF_MIPS_ARCH) { case ELF::EF_MIPS_ARCH_1: @@ -239,12 +238,25 @@ SubtargetFeatures ELFObjectFileBase::getARMFeatures() const { return Features; } +SubtargetFeatures ELFObjectFileBase::getRISCVFeatures() const { + SubtargetFeatures Features; + unsigned PlatformFlags = getPlatformFlags(); + + if (PlatformFlags & ELF::EF_RISCV_RVC) { + Features.AddFeature("c"); + } + + return Features; +} + SubtargetFeatures ELFObjectFileBase::getFeatures() const { switch (getEMachine()) { case ELF::EM_MIPS: return getMIPSFeatures(); case ELF::EM_ARM: return getARMFeatures(); + case ELF::EM_RISCV: + return getRISCVFeatures(); default: return SubtargetFeatures(); } -- cgit v1.2.3-59-g8ed1b