diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2018-07-30 16:33:32 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2018-07-30 16:33:32 +0000 |
commit | 51315c45ff5643a27f9c84b816db54ee870ba29b (patch) | |
tree | 1d87443fa0e53d3e6b315ce25787e64be0906bf7 /contrib/llvm/lib/Object/ELFObjectFile.cpp | |
parent | 6dfd050075216be8538ae375a22d30db72916f7e (diff) | |
parent | eb11fae6d08f479c0799db45860a98af528fa6e7 (diff) |
Notes
Diffstat (limited to 'contrib/llvm/lib/Object/ELFObjectFile.cpp')
-rw-r--r-- | contrib/llvm/lib/Object/ELFObjectFile.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/contrib/llvm/lib/Object/ELFObjectFile.cpp b/contrib/llvm/lib/Object/ELFObjectFile.cpp index 0aad1c89a2d8..e806c8f28b15 100644 --- a/contrib/llvm/lib/Object/ELFObjectFile.cpp +++ b/contrib/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(); } |