• Home
  • Raw
  • Download

Lines Matching full:alignment

1 //===-- DataLayout.cpp - Data size & alignment routines --------------------==//
10 // This file defines layout properties related to datatype size/offset/alignment
55 // Keep track of maximum alignment constraint. in StructLayout()
62 // Empty structures have alignment of 1 byte. in StructLayout()
99 assert(abi_align <= pref_align && "Preferred alignment worse than ABI!"); in get()
126 assert(ABIAlign <= PrefAlign && "Preferred alignment worse than ABI!"); in get()
261 // ABI alignment. in parseSpecifier()
264 "Missing alignment specification for pointer in datalayout string"); in parseSpecifier()
269 "Pointer ABI alignment must be a power of 2"); in parseSpecifier()
271 // Preferred alignment. in parseSpecifier()
278 "Pointer preferred alignment must be a power of 2"); in parseSpecifier()
305 // ABI alignment. in parseSpecifier()
308 "Missing alignment specification in datalayout string"); in parseSpecifier()
313 "ABI alignment specification must be >0 for non-aggregate types"); in parseSpecifier()
315 // Preferred alignment. in parseSpecifier()
338 case 'S': { // Stack natural alignment. in parseSpecifier()
398 report_fatal_error("Invalid ABI alignment, must be a 16bit integer"); in setAlignment()
400 report_fatal_error("Invalid preferred alignment, must be a 16bit integer"); in setAlignment()
402 report_fatal_error("Invalid ABI alignment, must be a power of 2"); in setAlignment()
404 report_fatal_error("Invalid preferred alignment, must be a power of 2"); in setAlignment()
408 "Preferred alignment cannot be less than the ABI alignment"); in setAlignment()
437 "Preferred alignment cannot be less than the ABI alignment"); in setPointerAlignment()
450 /// getAlignmentInfo - Return the alignment (either ABI if ABIInfo = true or
482 // If we didn't find an integer alignment, fall back on most conservative. in getAlignmentInfo()
486 // By default, use natural alignment for vector types. This is consistent in getAlignmentInfo()
490 // If the alignment is not a power of 2, round up to the next power of 2. in getAlignmentInfo()
498 // If we still couldn't find a reasonable default alignment, fall back in getAlignmentInfo()
499 // to a simple heuristic that the alignment is the first power of two in getAlignmentInfo()
613 \param abi_or_pref Flag that determines which alignment is returned. true
614 returns the ABI alignment, false returns the preferred alignment.
615 \param Ty The underlying type for which alignment is determined.
617 Get the ABI (\a abi_or_pref == true) or preferred alignment (\a abi_or_pref
640 // Packed structure types always have an ABI alignment of one. in getAlignment()
656 // same size and alignment, so they look the same here. in getAlignment()
678 /// getABIIntegerTypeAlignment - Return the minimum ABI-required alignment for
690 assert(!(Align & (Align-1)) && "Alignment is not a power of two!"); in getPreferredTypeAlignmentShift()
758 /// getPreferredAlignment - Return the preferred alignment of the specified
759 /// global. This includes an explicitly requested alignment (if the global
763 unsigned Alignment = getPrefTypeAlignment(ElemType); in getPreferredAlignment() local
765 if (GVAlignment >= Alignment) { in getPreferredAlignment()
766 Alignment = GVAlignment; in getPreferredAlignment()
768 Alignment = std::max(GVAlignment, getABITypeAlignment(ElemType)); in getPreferredAlignment()
772 if (Alignment < 16) { in getPreferredAlignment()
774 // larger alignment. in getPreferredAlignment()
776 Alignment = 16; // 16-byte alignment. in getPreferredAlignment()
779 return Alignment; in getPreferredAlignment()
782 /// getPreferredAlignmentLog - Return the preferred alignment of the
784 /// requested alignment (if the global has one).