Lines Matching refs: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;
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()),
741 /// alignment.
772 CharUnits getAligment() const { return Alignment; }
969 // The maximum field alignment overrides base align.
975 // Round up the current record size to pointer alignment.
979 // Update the alignment.
1189 // The maximum field alignment overrides base align.
1196 // Round up the current record size to the base's alignment boundary.
1210 Alignment = CharUnits::One();
1223 // Remember max struct/class alignment.
1237 // Honor the default struct packing maximum alignment flag.
1242 // mac68k alignment supersedes maximum field alignment and attribute aligned,
1243 // and forces all structures to have 2-byte alignment. The IBM docs on it
1249 Alignment = CharUnits::fromQuantity(2);
1265 // Update based on external alignment.
1268 Alignment = Context.toCharUnitsFromBits(External.Align);
1270 // The external source didn't have alignment information; infer it.
1281 // Finally, round the size of the total struct up to the alignment of the
1296 NonVirtualAlignment = Alignment;
1301 // Finally, round the size of the total struct up to the alignment
1343 // Finally, round the size of the total struct up to the alignment of the
1349 // Layout each field, for now, just sequentially, respecting alignment. In
1431 // Remember max struct/class alignment.
1477 // does not change the alignment of the struct itself, but it does
1482 // A field alignment restriction (e.g. from #pragma pack) or
1484 // formal alignment of the field. For System V, this alters the
1485 // required alignment of the notional storage unit that must contain
1494 // In an ms_struct struct, the alignment of a fundamental type is
1496 // the i386 alignment rules on targets which might not fully align
1501 // The field alignment for integer types is always the size.
1528 // Handle targets that don't honor bitfield type alignment.
1533 // The alignment to round up to is the max of the field's natural
1534 // alignment and a target-specific fixed value (sometimes zero).
1539 // If that doesn't apply, just ignore the field alignment.
1545 // Remember the alignment we would have used if the field were not packed.
1548 // Ignore the field alignment if the field is packed unless it has zero-size.
1571 // alignment attributes.
1578 // adding any alignment padding or if the field weren't packed.
1583 // allocation unit with the right size and alignment. The rules are
1589 // other consideration. Otherwise, round up to the right alignment.
1611 // bit-field type alignment like ARM APCS ABI.
1639 // Anonymous members don't affect the overall record alignment,
1682 // including padding up to char alignment, and then remember how
1699 // Remember max struct/class alignment.
1748 // alignment if necessary.
1770 // The maximum field alignment overrides the aligned attribute.
1776 // Round up the current record size to the field's alignment boundary.
1827 // Remember max struct/class alignment.
1845 // Finally, round the size of the record up to the alignment of the
1852 llvm::alignTo(getSizeInBits(), Context.toBits(Alignment));
1855 // If we're inferring alignment, and the external size is smaller than
1856 // our size after we've rounded up to alignment, conservatively set the
1857 // alignment to 1.
1859 Alignment = CharUnits::One();
1885 // Warn if we packed it unnecessarily. If the alignment is 1 byte don't
1886 // bother since there won't be alignment issues.
1896 // The alignment is not modified when using 'mac68k' alignment or when
1897 // we have an externally-supplied layout that also provides overall alignment.
1901 if (NewAlignment > Alignment) {
1903 "Alignment not a power of 2");
1904 Alignment = NewAlignment;
1909 "Alignment not a power of 2");
1922 Alignment = CharUnits::One();
1982 // Warn if we packed it unnecessarily. If the alignment is 1 byte don't
1983 // bother since there won't be alignment issues.
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
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;
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;
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();
2336 Info.Alignment = std::min(Info.Alignment, MaxFieldAlignment);
2339 // Respect required alignment, this is necessary because we may have adjusted
2340 // the alignment in the case of pragam pack. Note that the required alignment
2341 // doesn't actually apply to the struct alignment at this point.
2342 Alignment = std::max(Alignment, Info.Alignment);
2344 Info.Alignment = std::max(Info.Alignment, Layout.getRequiredAlignment());
2352 // Get the alignment of the field type's natural alignment, ignore any
2353 // alignment attributes.
2355 std::tie(Info.Size, Info.Alignment) =
2366 // For some reason __declspec align impacts alignment rather than required
2367 // alignment when it is applied to bitfields.
2368 Info.Alignment = std::max(Info.Alignment, FieldRequiredAlignment);
2377 // Capture required alignment as a side-effect.
2382 Info.Alignment = std::min(Info.Alignment, MaxFieldAlignment);
2384 Info.Alignment = CharUnits::One();
2385 Info.Alignment = std::max(Info.Alignment, FieldRequiredAlignment);
2394 DataSize = Size = Size.alignTo(Alignment);
2410 Alignment = std::max(Alignment, PointerInfo.Alignment);
2411 auto RoundingAlignment = Alignment;
2424 Alignment = CharUnits::One();
2425 // In 64-bit mode we always perform an alignment step after laying out vbases.
2426 // In 32-bit mode we do not. The check to see if we need to perform alignment
2427 // checks the RequiredAlignment field and performs alignment if it isn't 0.
2431 // Compute the maximum field alignment.
2433 // Honor the default struct packing maximum alignment flag.
2443 // Packed attribute forces max field alignment to be 1.
2463 // Calculate pointer size and alignment. These are used for vfptr and vbprt
2467 PointerInfo.Alignment =
2471 PointerInfo.Alignment = std::min(PointerInfo.Alignment, MaxFieldAlignment);
2480 // information about the bases, such as required alignment and the presence of
2593 BaseOffset = Size = Size.alignTo(Info.Alignment);
2614 Alignment = std::max(Alignment, Info.Alignment);
2625 FieldOffset = Size.alignTo(Info.Alignment);
2657 // TODO: Add a Sema warning that MS ignores bitfield alignment in unions.
2660 CharUnits FieldOffset = Size.alignTo(Info.Alignment);
2663 Alignment = std::max(Alignment, Info.Alignment);
2674 // TODO: Add a Sema warning that MS ignores alignment for zero
2683 // TODO: Add a Sema warning that MS ignores bitfield alignment in unions.
2685 // Round up the current record size to the field's alignment boundary.
2686 CharUnits FieldOffset = Size.alignTo(Info.Alignment);
2689 Alignment = std::max(Alignment, Info.Alignment);
2699 VBPtrOffset = VBPtrOffset.alignTo(PointerInfo.Alignment);
2707 // alignment.
2709 .alignTo(std::max(RequiredAlignment, Alignment));
2722 // alignment.
2724 PointerInfo.Size.alignTo(std::max(RequiredAlignment, Alignment));
2752 // The alignment of the vtordisp is at least the required alignment of the
2775 // the required alignment, we don't know why.
2780 Alignment = std::max(VtorDispAlignment, Alignment);
2794 BaseOffset = Size.alignTo(Info.Alignment);
2804 // Respect required alignment. Note that in 32-bit mode Required alignment
2808 Alignment = std::max(Alignment, RequiredAlignment);
2809 auto RoundingAlignment = Alignment;
2820 // Zero-sized structures have size equal to their alignment if a
2823 Size = Alignment;
2831 Alignment = Context.toCharUnitsFromBits(External.Align);
2950 *this, Builder.Size, Builder.Alignment, Builder.RequiredAlignment,
2953 Builder.NonVirtualSize, Builder.Alignment, CharUnits::Zero(),
2960 *this, Builder.Size, Builder.Alignment, Builder.RequiredAlignment,
2981 *this, Builder.getSize(), Builder.Alignment,
2983 Builder.Alignment, Builder.HasOwnVFPtr, RD->isDynamicClass(),
2994 *this, Builder.getSize(), Builder.Alignment,
2996 Builder.Alignment, Builder.getSize(), Builder.FieldOffsets);
3112 Builder.Alignment,
3114 Builder.Alignment,
3313 OS << " Alignment:" << toBits(Info.getAlignment()) << "\n";