comparison clang/lib/CodeGen/CGRecordLayout.h @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 1d019706d866
children c4bab56944e8
comparison
equal deleted inserted replaced
173:0572611fdcc8 207:2e18cbf3894f
44 /// unsigned more_bits : 4; 44 /// unsigned more_bits : 4;
45 /// unsigned still_more_bits : 7; 45 /// unsigned still_more_bits : 7;
46 /// }; 46 /// };
47 /// 47 ///
48 /// This will end up as the following LLVM type. The first array is the 48 /// This will end up as the following LLVM type. The first array is the
49 /// bitfield, and the second is the padding out to a 4-byte alignmnet. 49 /// bitfield, and the second is the padding out to a 4-byte alignment.
50 /// 50 ///
51 /// %t = type { i8, i8, i8, i8, i8, [3 x i8] } 51 /// %t = type { i8, i8, i8, i8, i8, [3 x i8] }
52 /// 52 ///
53 /// When generating code to access more_bits, we'll generate something 53 /// When generating code to access more_bits, we'll generate something
54 /// essentially like this: 54 /// essentially like this:
78 unsigned StorageSize; 78 unsigned StorageSize;
79 79
80 /// The offset of the bitfield storage from the start of the struct. 80 /// The offset of the bitfield storage from the start of the struct.
81 CharUnits StorageOffset; 81 CharUnits StorageOffset;
82 82
83 /// The offset within a contiguous run of bitfields that are represented as a
84 /// single "field" within the LLVM struct type, taking into account the AAPCS
85 /// rules for volatile bitfields. This offset is in bits.
86 unsigned VolatileOffset : 16;
87
88 /// The storage size in bits which should be used when accessing this
89 /// bitfield.
90 unsigned VolatileStorageSize;
91
92 /// The offset of the bitfield storage from the start of the struct.
93 CharUnits VolatileStorageOffset;
94
83 CGBitFieldInfo() 95 CGBitFieldInfo()
84 : Offset(), Size(), IsSigned(), StorageSize(), StorageOffset() {} 96 : Offset(), Size(), IsSigned(), StorageSize(), StorageOffset(),
97 VolatileOffset(), VolatileStorageSize(), VolatileStorageOffset() {}
85 98
86 CGBitFieldInfo(unsigned Offset, unsigned Size, bool IsSigned, 99 CGBitFieldInfo(unsigned Offset, unsigned Size, bool IsSigned,
87 unsigned StorageSize, CharUnits StorageOffset) 100 unsigned StorageSize, CharUnits StorageOffset)
88 : Offset(Offset), Size(Size), IsSigned(IsSigned), 101 : Offset(Offset), Size(Size), IsSigned(IsSigned),
89 StorageSize(StorageSize), StorageOffset(StorageOffset) {} 102 StorageSize(StorageSize), StorageOffset(StorageOffset) {}