summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/lib/Object/ELFObjectFile.cpp
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2019-01-27 16:42:12 +0000
committerpatrick <patrick@openbsd.org>2019-01-27 16:42:12 +0000
commitb773203fb58f3ef282fb69c832d8710cab5bc82d (patch)
treee75913f147570fbd75169647b144df85b88a038c /gnu/llvm/lib/Object/ELFObjectFile.cpp
parenttweak errno in previous (diff)
downloadwireguard-openbsd-b773203fb58f3ef282fb69c832d8710cab5bc82d.tar.xz
wireguard-openbsd-b773203fb58f3ef282fb69c832d8710cab5bc82d.zip
Import LLVM 7.0.1 release including clang, lld and lldb.
Diffstat (limited to 'gnu/llvm/lib/Object/ELFObjectFile.cpp')
-rw-r--r--gnu/llvm/lib/Object/ELFObjectFile.cpp16
1 files changed, 14 insertions, 2 deletions
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();
}