================
@@ -319,7 +320,10 @@ CodeGenTBAA::CollectFields(uint64_t BaseOffset,
       // base type.
       if ((*i)->isBitField()) {
         const CGBitFieldInfo &Info = CGRL.getBitFieldInfo(*i);
-        if (Info.Offset != 0)
+        bool IsBE = Context.getTargetInfo().isBigEndian();
+        bool IsFirst = IsBE ? Info.StorageSize - (Info.Offset + Info.Size) == 0
----------------
dobbelaj-snps wrote:

Maybe cleaner to say ?

            bool IsFirst = IsBE ? (Info.Offset + Info.Size) == Info.StorageSize

as in: in BE a bitfield is first if it starts at the most significant bit of 
the storage ?


https://github.com/llvm/llvm-project/pull/87753
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to