diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 10:51:19 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2018-07-28 10:51:19 +0000 |
commit | eb11fae6d08f479c0799db45860a98af528fa6e7 (patch) | |
tree | 44d492a50c8c1a7eb8e2d17ea3360ec4d066f042 /lib/Object/ELFObjectFile.cpp | |
parent | b8a2042aa938069e862750553db0e4d82d25822c (diff) |
Notes
Diffstat (limited to 'lib/Object/ELFObjectFile.cpp')
-rw-r--r-- | lib/Object/ELFObjectFile.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/Object/ELFObjectFile.cpp b/lib/Object/ELFObjectFile.cpp index 0aad1c89a2d8..e806c8f28b15 100644 --- a/lib/Object/ELFObjectFile.cpp +++ b/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(); } |