Changeset View
Changeset View
Standalone View
Standalone View
kdevplatform/language/duchain/classmemberdeclarationdata.h
Show All 29 Lines | |||||
30 | 30 | | |||
31 | class KDEVPLATFORMLANGUAGE_EXPORT ClassMemberDeclarationData : public DeclarationData | 31 | class KDEVPLATFORMLANGUAGE_EXPORT ClassMemberDeclarationData : public DeclarationData | ||
32 | { | 32 | { | ||
33 | public: | 33 | public: | ||
34 | ClassMemberDeclarationData(); | 34 | ClassMemberDeclarationData(); | ||
35 | ClassMemberDeclarationData( const ClassMemberDeclarationData& rhs ) = default; | 35 | ClassMemberDeclarationData( const ClassMemberDeclarationData& rhs ) = default; | ||
36 | 36 | | |||
37 | Declaration::AccessPolicy m_accessPolicy; | 37 | Declaration::AccessPolicy m_accessPolicy; | ||
38 | | ||||
39 | /** | ||||
40 | * Since alignOf must be integral power of 2, we only need to store the power. | ||||
aaronpuchert: If we want to reduce the storage space required, we could use that alignment is always a power… | |||||
41 | * The max value (63) represents unknown alignment. | ||||
42 | */ | ||||
43 | unsigned m_alignOfExponent : 6; | ||||
44 | static constexpr unsigned MaxAlignOfExponent = 63; | ||||
45 | | ||||
38 | bool m_isStatic: 1; | 46 | bool m_isStatic: 1; | ||
39 | bool m_isAuto: 1; | 47 | bool m_isAuto: 1; | ||
40 | bool m_isFriend: 1; | 48 | bool m_isFriend: 1; | ||
41 | bool m_isRegister: 1; | 49 | bool m_isRegister: 1; | ||
42 | bool m_isExtern: 1; | 50 | bool m_isExtern: 1; | ||
43 | bool m_isMutable: 1; | 51 | bool m_isMutable: 1; | ||
52 | | ||||
53 | /// Stores sizeOf in bytes or -1 if unknown. | ||||
54 | int64_t m_sizeOf; | ||||
55 | | ||||
56 | /// Stores bitOffsetOf in bits or -1 if unknown. | ||||
57 | int64_t m_bitOffsetOf; | ||||
44 | }; | 58 | }; | ||
45 | 59 | | |||
46 | } | 60 | } | ||
47 | 61 | | |||
48 | #endif | 62 | #endif |
If we want to reduce the storage space required, we could use that alignment is always a power of two and only store the exponent. Since int64_t can store values up to 2^63-1, we need 6 bits for the exponent.