[PATCH] D104027: [lld/mac] Use sectionType() more

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 11 08:16:05 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rGf2b1a1e10c5a: [lld/mac] Use sectionType() more (authored by thakis).
Herald added a project: LLVM.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104027/new/

https://reviews.llvm.org/D104027

Files:
  lld/MachO/ConcatOutputSection.cpp
  lld/MachO/InputSection.cpp


Index: lld/MachO/InputSection.cpp
===================================================================
--- lld/MachO/InputSection.cpp
+++ lld/MachO/InputSection.cpp
@@ -128,7 +128,7 @@
 }
 
 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;
 
Index: lld/MachO/ConcatOutputSection.cpp
===================================================================
--- lld/MachO/ConcatOutputSection.cpp
+++ lld/MachO/ConcatOutputSection.cpp
@@ -339,8 +339,8 @@
 // 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" +


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104027.351458.patch
Type: text/x-patch
Size: 1130 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210611/6df9ac26/attachment.bin>


More information about the llvm-commits mailing list