[lldb] Use enum constant instead of raw value
authorFred Riss <friss@apple.com>
Thu, 9 Jul 2020 16:43:02 +0000 (09:43 -0700)
committerFred Riss <friss@apple.com>
Thu, 9 Jul 2020 16:43:50 +0000 (09:43 -0700)
lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
llvm/include/llvm/BinaryFormat/MachO.h

index 6c2f22b..2bb4b21 100644 (file)
@@ -2297,7 +2297,7 @@ size_t ObjectFileMachO::ParseSymtab() {
 
 #if defined(__APPLE__) &&                                                      \
     (defined(__arm__) || defined(__arm64__) || defined(__aarch64__))
-      if (m_header.flags & 0x80000000u &&
+      if (m_header.flags & MH_DYLIB_IN_CACHE &&
           process->GetAddressByteSize() == sizeof(void *)) {
         // This mach-o memory file is in the dyld shared cache. If this
         // program is not remote and this is iOS, then this process will
@@ -2379,7 +2379,7 @@ size_t ObjectFileMachO::ParseSymtab() {
             // problem. For binaries outside the shared cache, it's faster to
             // read the entire strtab at once instead of piece-by-piece as we
             // process the nlist records.
-            if ((m_header.flags & 0x80000000u) == 0) {
+            if ((m_header.flags & MH_DYLIB_IN_CACHE) == 0) {
               DataBufferSP strtab_data_sp(
                   ReadMemory(process_sp, strtab_addr, strtab_data_byte_size));
               if (strtab_data_sp) {
@@ -2608,7 +2608,7 @@ size_t ObjectFileMachO::ParseSymtab() {
   // to parse any DSC unmapped symbol information. If we find any, we set a
   // flag that tells the normal nlist parser to ignore all LOCAL symbols.
 
-  if (m_header.flags & 0x80000000u) {
+  if (m_header.flags & MH_DYLIB_IN_CACHE) {
     // Before we can start mapping the DSC, we need to make certain the
     // target process is actually using the cache we can find.
 
index 0010f36..e43fea0 100644 (file)
@@ -82,7 +82,8 @@ enum {
   MH_HAS_TLV_DESCRIPTORS = 0x00800000u,
   MH_NO_HEAP_EXECUTION = 0x01000000u,
   MH_APP_EXTENSION_SAFE = 0x02000000u,
-  MH_NLIST_OUTOFSYNC_WITH_DYLDINFO = 0x04000000u
+  MH_NLIST_OUTOFSYNC_WITH_DYLDINFO = 0x04000000u,
+  MH_DYLIB_IN_CACHE = 0x80000000u,
 };
 
 enum : uint32_t {