• Home
  • Raw
  • Download

Lines Matching full:alignment

59 /// as alignment attributes on fields and pragmas in effect.
66 /// \brief Overall record alignment in bits.
579 /// Alignment - The current alignment of the record layout.
580 CharUnits Alignment; member in __anona2f417160111::ItaniumRecordLayoutBuilder
582 /// \brief The alignment if attribute packed is not used.
591 /// \brief Whether we need to infer alignment, even when we have an
613 /// MaxFieldAlignment - The maximum allowed field alignment. This is set by
661 Alignment(CharUnits::One()), UnpackedAlignment(CharUnits::One()), in ItaniumRecordLayoutBuilder()
741 /// alignment.
772 CharUnits getAligment() const { return Alignment; } in getAligment()
969 // The maximum field alignment overrides base align. in EnsureVTablePointerAlignment()
975 // Round up the current record size to pointer alignment. in EnsureVTablePointerAlignment()
979 // Update the alignment. in EnsureVTablePointerAlignment()
1189 // The maximum field alignment overrides base align. in LayoutBase()
1196 // Round up the current record size to the base's alignment boundary. in LayoutBase()
1210 Alignment = CharUnits::One(); in LayoutBase()
1223 // Remember max struct/class alignment. in LayoutBase()
1237 // Honor the default struct packing maximum alignment flag. in InitializeLayout()
1242 // mac68k alignment supersedes maximum field alignment and attribute aligned, in InitializeLayout()
1243 // and forces all structures to have 2-byte alignment. The IBM docs on it in InitializeLayout()
1249 Alignment = CharUnits::fromQuantity(2); in InitializeLayout()
1265 // Update based on external alignment. in InitializeLayout()
1268 Alignment = Context.toCharUnitsFromBits(External.Align); in InitializeLayout()
1270 // The external source didn't have alignment information; infer it. in InitializeLayout()
1281 // Finally, round the size of the total struct up to the alignment of the in Layout()
1296 NonVirtualAlignment = Alignment; in Layout()
1301 // Finally, round the size of the total struct up to the alignment in Layout()
1343 // Finally, round the size of the total struct up to the alignment of the in Layout()
1349 // Layout each field, for now, just sequentially, respecting alignment. In in LayoutFields()
1431 // Remember max struct/class alignment. in LayoutWideBitField()
1477 // does not change the alignment of the struct itself, but it does in LayoutBitField()
1482 // A field alignment restriction (e.g. from #pragma pack) or in LayoutBitField()
1484 // formal alignment of the field. For System V, this alters the in LayoutBitField()
1485 // required alignment of the notional storage unit that must contain in LayoutBitField()
1494 // In an ms_struct struct, the alignment of a fundamental type is in LayoutBitField()
1496 // the i386 alignment rules on targets which might not fully align in LayoutBitField()
1501 // The field alignment for integer types is always the size. in LayoutBitField()
1528 // Handle targets that don't honor bitfield type alignment. in LayoutBitField()
1533 // The alignment to round up to is the max of the field's natural in LayoutBitField()
1534 // alignment and a target-specific fixed value (sometimes zero). in LayoutBitField()
1539 // If that doesn't apply, just ignore the field alignment. in LayoutBitField()
1545 // Remember the alignment we would have used if the field were not packed. in LayoutBitField()
1548 // Ignore the field alignment if the field is packed unless it has zero-size. in LayoutBitField()
1571 // alignment attributes. in LayoutBitField()
1578 // adding any alignment padding or if the field weren't packed. in LayoutBitField()
1583 // allocation unit with the right size and alignment. The rules are in LayoutBitField()
1589 // other consideration. Otherwise, round up to the right alignment. in LayoutBitField()
1611 // bit-field type alignment like ARM APCS ABI. in LayoutBitField()
1639 // Anonymous members don't affect the overall record alignment, in LayoutBitField()
1682 // including padding up to char alignment, and then remember how in LayoutBitField()
1699 // Remember max struct/class alignment. in LayoutBitField()
1748 // alignment if necessary. in LayoutField()
1770 // The maximum field alignment overrides the aligned attribute. in LayoutField()
1776 // Round up the current record size to the field's alignment boundary. in LayoutField()
1827 // Remember max struct/class alignment. in LayoutField()
1845 // Finally, round the size of the record up to the alignment of the in FinishLayout()
1852 llvm::alignTo(getSizeInBits(), Context.toBits(Alignment)); in FinishLayout()
1855 // If we're inferring alignment, and the external size is smaller than in FinishLayout()
1856 // our size after we've rounded up to alignment, conservatively set the in FinishLayout()
1857 // alignment to 1. in FinishLayout()
1859 Alignment = CharUnits::One(); in FinishLayout()
1885 // Warn if we packed it unnecessarily. If the alignment is 1 byte don't in FinishLayout()
1886 // bother since there won't be alignment issues. in FinishLayout()
1896 // The alignment is not modified when using 'mac68k' alignment or when in UpdateAlignment()
1897 // we have an externally-supplied layout that also provides overall alignment. in UpdateAlignment()
1901 if (NewAlignment > Alignment) { in UpdateAlignment()
1903 "Alignment not a power of 2"); in UpdateAlignment()
1904 Alignment = NewAlignment; in UpdateAlignment()
1909 "Alignment not a power of 2"); in UpdateAlignment()
1922 Alignment = CharUnits::One(); in updateExternalFieldOffset()
1982 // Warn if we packed it unnecessarily. If the alignment is 1 byte don't in CheckFieldPadding()
1983 // bother since there won't be alignment issues. in CheckFieldPadding()
2125 // * The alignment of bitfields in unions is ignored when computing the
2126 // alignment of the union.
2142 // * vtordisps are allocated in a block of memory with size and alignment equal
2143 // to the alignment of the completed structure (before applying __declspec(
2147 // order to guarantee proper alignment of all fields, the vfptr injection
2148 // pushes all bases and fields back by the alignment imposed by those bases
2152 // order to guarantee proper alignment of all fields, the vfptr injection
2153 // pushes all bases and fields back by the alignment imposed by those bases
2172 // bases is 1 byte. The padding added between vbases depends on the alignment
2174 // * There is no concept of non-virtual alignment, non-virtual alignment and
2175 // alignment are always identical.
2176 // * There is a distinction between alignment and required alignment.
2177 // __declspec(align) changes the required alignment of a struct. This
2178 // alignment is _always_ obeyed, even in the presence of #pragma pack. A
2179 // record inherits required alignment from all of its fields and bases.
2181 // alignment instead of its required alignment. This is the only known way
2182 // to make the alignment of a struct bigger than 8. Interestingly enough
2183 // this alignment is also immune to the effects of #pragma pack and can be
2184 // used to create structures with large alignment under #pragma pack.
2185 // However, because it does not impact required alignment, such a structure,
2197 // * 2012 and back: In 64-bit mode, if the alignment of a record is 16 or
2214 CharUnits Alignment; member
2224 /// \brief Initializes size and alignment and honors some flags.
2226 /// \brief Initialized C++ layout, compute alignment and virtual alignment and
2227 /// existence of vfptrs and vbptrs. Alignment is needed before the vfptr is
2238 /// alignment.
2247 /// \brief Gets the size and alignment of a base taking pragma pack and
2250 /// \brief Gets the size and alignment of a field taking pragma pack and
2273 /// \brief The current alignment of the record layout.
2274 CharUnits Alignment; member
2275 /// \brief The maximum allowed field alignment. This is set by #pragma pack.
2277 /// \brief The alignment that this record must obey. This is imposed by
2288 /// \brief The size and alignment info of a pointer.
2333 Info.Alignment = Layout.getAlignment(); in getAdjustedElementInfo()
2336 Info.Alignment = std::min(Info.Alignment, MaxFieldAlignment); in getAdjustedElementInfo()
2339 // Respect required alignment, this is necessary because we may have adjusted in getAdjustedElementInfo()
2340 // the alignment in the case of pragam pack. Note that the required alignment in getAdjustedElementInfo()
2341 // doesn't actually apply to the struct alignment at this point. in getAdjustedElementInfo()
2342 Alignment = std::max(Alignment, Info.Alignment); in getAdjustedElementInfo()
2344 Info.Alignment = std::max(Info.Alignment, Layout.getRequiredAlignment()); in getAdjustedElementInfo()
2352 // Get the alignment of the field type's natural alignment, ignore any in getAdjustedElementInfo()
2353 // alignment attributes. in getAdjustedElementInfo()
2355 std::tie(Info.Size, Info.Alignment) = in getAdjustedElementInfo()
2366 // For some reason __declspec align impacts alignment rather than required in getAdjustedElementInfo()
2367 // alignment when it is applied to bitfields. in getAdjustedElementInfo()
2368 Info.Alignment = std::max(Info.Alignment, FieldRequiredAlignment); in getAdjustedElementInfo()
2377 // Capture required alignment as a side-effect. in getAdjustedElementInfo()
2382 Info.Alignment = std::min(Info.Alignment, MaxFieldAlignment); in getAdjustedElementInfo()
2384 Info.Alignment = CharUnits::One(); in getAdjustedElementInfo()
2385 Info.Alignment = std::max(Info.Alignment, FieldRequiredAlignment); in getAdjustedElementInfo()
2394 DataSize = Size = Size.alignTo(Alignment); in layout()
2410 Alignment = std::max(Alignment, PointerInfo.Alignment); in cxxLayout()
2411 auto RoundingAlignment = Alignment; in cxxLayout()
2424 Alignment = CharUnits::One(); in initializeLayout()
2425 // In 64-bit mode we always perform an alignment step after laying out vbases. in initializeLayout()
2426 // In 32-bit mode we do not. The check to see if we need to perform alignment in initializeLayout()
2427 // checks the RequiredAlignment field and performs alignment if it isn't 0. in initializeLayout()
2431 // Compute the maximum field alignment. in initializeLayout()
2433 // Honor the default struct packing maximum alignment flag. in initializeLayout()
2443 // Packed attribute forces max field alignment to be 1. in initializeLayout()
2463 // Calculate pointer size and alignment. These are used for vfptr and vbprt in initializeCXXLayout()
2467 PointerInfo.Alignment = in initializeCXXLayout()
2471 PointerInfo.Alignment = std::min(PointerInfo.Alignment, MaxFieldAlignment); in initializeCXXLayout()
2480 // information about the bases, such as required alignment and the presence of in layoutNonVirtualBases()
2593 BaseOffset = Size = Size.alignTo(Info.Alignment); in layoutNonVirtualBase()
2614 Alignment = std::max(Alignment, Info.Alignment); in layoutField()
2625 FieldOffset = Size.alignTo(Info.Alignment); in layoutField()
2657 // TODO: Add a Sema warning that MS ignores bitfield alignment in unions. in layoutBitField()
2660 CharUnits FieldOffset = Size.alignTo(Info.Alignment); in layoutBitField()
2663 Alignment = std::max(Alignment, Info.Alignment); in layoutBitField()
2674 // TODO: Add a Sema warning that MS ignores alignment for zero in layoutZeroWidthBitField()
2683 // TODO: Add a Sema warning that MS ignores bitfield alignment in unions. in layoutZeroWidthBitField()
2685 // Round up the current record size to the field's alignment boundary. in layoutZeroWidthBitField()
2686 CharUnits FieldOffset = Size.alignTo(Info.Alignment); in layoutZeroWidthBitField()
2689 Alignment = std::max(Alignment, Info.Alignment); in layoutZeroWidthBitField()
2699 VBPtrOffset = VBPtrOffset.alignTo(PointerInfo.Alignment); in injectVBPtr()
2707 // alignment. in injectVBPtr()
2709 .alignTo(std::max(RequiredAlignment, Alignment)); in injectVBPtr()
2722 // alignment. in injectVFPtr()
2724 PointerInfo.Size.alignTo(std::max(RequiredAlignment, Alignment)); in injectVFPtr()
2752 // The alignment of the vtordisp is at least the required alignment of the in layoutVirtualBases()
2775 // the required alignment, we don't know why. in layoutVirtualBases()
2780 Alignment = std::max(VtorDispAlignment, Alignment); in layoutVirtualBases()
2794 BaseOffset = Size.alignTo(Info.Alignment); in layoutVirtualBases()
2804 // Respect required alignment. Note that in 32-bit mode Required alignment in finalizeLayout()
2808 Alignment = std::max(Alignment, RequiredAlignment); in finalizeLayout()
2809 auto RoundingAlignment = Alignment; in finalizeLayout()
2820 // Zero-sized structures have size equal to their alignment if a in finalizeLayout()
2823 Size = Alignment; in finalizeLayout()
2831 Alignment = Context.toCharUnitsFromBits(External.Align); in finalizeLayout()
2950 *this, Builder.Size, Builder.Alignment, Builder.RequiredAlignment, in getASTRecordLayout()
2953 Builder.NonVirtualSize, Builder.Alignment, CharUnits::Zero(), in getASTRecordLayout()
2960 *this, Builder.Size, Builder.Alignment, Builder.RequiredAlignment, in getASTRecordLayout()
2981 *this, Builder.getSize(), Builder.Alignment, in getASTRecordLayout()
2983 Builder.Alignment, Builder.HasOwnVFPtr, RD->isDynamicClass(), in getASTRecordLayout()
2994 *this, Builder.getSize(), Builder.Alignment, in getASTRecordLayout()
2996 Builder.Alignment, Builder.getSize(), Builder.FieldOffsets); in getASTRecordLayout()
3112 Builder.Alignment, in getObjCLayout()
3114 Builder.Alignment, in getObjCLayout()
3313 OS << " Alignment:" << toBits(Info.getAlignment()) << "\n"; in DumpRecordLayout()