From ab1bcda851d95aeec03ffc1218bf9cae261a9280 Mon Sep 17 00:00:00 2001 From: Jim Lin Date: Tue, 7 Jan 2020 17:32:39 +0800 Subject: [NFC] Use isX86() instead of getArch() Summary: This is a clean up for https://reviews.llvm.org/D72247. Reviewers: MaskRay, craig.topper, jhenderson Reviewed By: MaskRay Subscribers: hiraditya, rupprecht, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D72320 --- llvm/lib/MC/MCObjectFileInfo.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'llvm/lib/MC/MCObjectFileInfo.cpp') diff --git a/llvm/lib/MC/MCObjectFileInfo.cpp b/llvm/lib/MC/MCObjectFileInfo.cpp index 76784c7bb0d..29fbda2be82 100644 --- a/llvm/lib/MC/MCObjectFileInfo.cpp +++ b/llvm/lib/MC/MCObjectFileInfo.cpp @@ -40,8 +40,7 @@ static bool useCompactUnwind(const Triple &T) { return true; // And the iOS simulator. - if (T.isiOS() && - (T.getArch() == Triple::x86_64 || T.getArch() == Triple::x86)) + if (T.isiOS() && T.isX86()) return true; return false; @@ -192,7 +191,7 @@ void MCObjectFileInfo::initMachOMCObjectFileInfo(const Triple &T) { Ctx->getMachOSection("__LD", "__compact_unwind", MachO::S_ATTR_DEBUG, SectionKind::getReadOnly()); - if (T.getArch() == Triple::x86_64 || T.getArch() == Triple::x86) + if (T.isX86()) CompactUnwindDwarfEHFrameOnly = 0x04000000; // UNWIND_X86_64_MODE_DWARF else if (T.getArch() == Triple::aarch64 || T.getArch() == Triple::aarch64_32) CompactUnwindDwarfEHFrameOnly = 0x03000000; // UNWIND_ARM64_MODE_DWARF -- cgit v1.2.3