[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
This commit is contained in:
Nico Weber 2021-06-11 11:15:11 -04:00
parent 74af4bb1f4
commit f2b1a1e10c
2 changed files with 3 additions and 3 deletions

View File

@ -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" +

View File

@ -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;