From f2b1a1e10c5a4a3e96cc244adfbacfb5e97c3ca5 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Fri, 11 Jun 2021 11:15:11 -0400 Subject: [PATCH] [lld/mac] Use sectionType() more Not sure sectionType() carries its weight, but while we have it we should use it consistently. No behavior change. Differential Revision: https://reviews.llvm.org/D104027 --- lld/MachO/ConcatOutputSection.cpp | 4 ++-- lld/MachO/InputSection.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lld/MachO/ConcatOutputSection.cpp b/lld/MachO/ConcatOutputSection.cpp index 2ef43598c9d1..3b5a31d8be70 100644 --- a/lld/MachO/ConcatOutputSection.cpp +++ b/lld/MachO/ConcatOutputSection.cpp @@ -339,8 +339,8 @@ void ConcatOutputSection::writeTo(uint8_t *buf) const { // are actually merged. The logic presented here was written without // any form of informed research. void ConcatOutputSection::mergeFlags(InputSection *input) { - uint8_t baseType = flags & SECTION_TYPE; - uint8_t inputType = input->flags & SECTION_TYPE; + uint8_t baseType = sectionType(flags); + uint8_t inputType = sectionType(input->flags); if (baseType != inputType) error("Cannot merge section " + input->name + " (type=0x" + to_hexString(inputType) + ") into " + name + " (type=0x" + diff --git a/lld/MachO/InputSection.cpp b/lld/MachO/InputSection.cpp index 4cd6eb13eef4..0b08e4febac7 100644 --- a/lld/MachO/InputSection.cpp +++ b/lld/MachO/InputSection.cpp @@ -128,7 +128,7 @@ uint64_t CStringInputSection::getOffset(uint64_t off) const { } bool macho::isCodeSection(const InputSection *isec) { - uint32_t type = isec->flags & SECTION_TYPE; + uint32_t type = sectionType(isec->flags); if (type != S_REGULAR && type != S_COALESCED) return false;