[lld] ae31f9f - [lld-macho] Change bitfield types to be identical.

Vy Nguyen via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 2 12:48:53 PDT 2021


Author: Vy Nguyen
Date: 2021-11-02T15:48:39-04:00
New Revision: ae31f9fbaddd57a3c1c63bfd7baf1511122a49f7

URL: https://github.com/llvm/llvm-project/commit/ae31f9fbaddd57a3c1c63bfd7baf1511122a49f7
DIFF: https://github.com/llvm/llvm-project/commit/ae31f9fbaddd57a3c1c63bfd7baf1511122a49f7.diff

LOG: [lld-macho] Change bitfield types to be identical.

Symbol's subclasses all have an additional bitfield of type uint8_t (RefState enum).
For the bitfields in the same block tomerge, they should be of the same type. (clang/gcc will work, but others like MSVC does not)

Differential Revision: https://reviews.llvm.org/D113040

Added: 
    

Modified: 
    lld/MachO/Symbols.h

Removed: 
    


################################################################################
diff  --git a/lld/MachO/Symbols.h b/lld/MachO/Symbols.h
index 54f1a3512728..62c595ec4184 100644
--- a/lld/MachO/Symbols.h
+++ b/lld/MachO/Symbols.h
@@ -103,10 +103,10 @@ class Symbol {
 
 public:
   // True if this symbol was referenced by a regular (non-bitcode) object.
-  bool isUsedInRegularObj : 1;
+  uint8_t isUsedInRegularObj : 1;
 
   // True if an undefined or dylib symbol is used from a live section.
-  bool used : 1;
+  uint8_t used : 1;
 };
 
 class Defined : public Symbol {


        


More information about the llvm-commits mailing list