Lines Matching defs:Layout
57 /// \brief Externally provided layout. Typically used when the AST source, such
142 getFieldOffset(const ASTRecordLayout &Layout, unsigned FieldNo) const {
143 uint64_t FieldOffset = Layout.getFieldOffset(FieldNo);
192 const ASTRecordLayout &Layout = Context.getASTRecordLayout(BaseDecl);
195 EmptySize = Layout.getSize();
198 EmptySize = Layout.getSizeOfLargestEmptySubobject();
216 const ASTRecordLayout &Layout = Context.getASTRecordLayout(MemberDecl);
219 EmptySize = Layout.getSize();
222 EmptySize = Layout.getSizeOfLargestEmptySubobject();
280 const ASTRecordLayout &Layout = Context.getASTRecordLayout(Info->Class);
285 CharUnits BaseOffset = Offset + Layout.getBaseClassOffset(Base->Class);
307 CharUnits FieldOffset = Offset + getFieldOffset(Layout, FieldNo);
330 const ASTRecordLayout &Layout = Context.getASTRecordLayout(Info->Class);
335 CharUnits BaseOffset = Offset + Layout.getBaseClassOffset(Base->Class);
354 CharUnits FieldOffset = Offset + getFieldOffset(Layout, FieldNo);
387 const ASTRecordLayout &Layout = Context.getASTRecordLayout(RD);
396 CharUnits BaseOffset = Offset + Layout.getBaseClassOffset(BaseDecl);
406 CharUnits VBaseOffset = Offset + Layout.getVBaseClassOffset(VBaseDecl);
419 CharUnits FieldOffset = Offset + getFieldOffset(Layout, FieldNo);
448 const ASTRecordLayout &Layout = Context.getASTRecordLayout(RD);
461 ElementOffset += Layout.getSize();
493 const ASTRecordLayout &Layout = Context.getASTRecordLayout(RD);
502 CharUnits BaseOffset = Offset + Layout.getBaseClassOffset(BaseDecl);
511 CharUnits VBaseOffset = Offset + Layout.getVBaseClassOffset(VBaseDecl);
523 CharUnits FieldOffset = Offset + getFieldOffset(Layout, FieldNo);
545 const ASTRecordLayout &Layout = Context.getASTRecordLayout(RD);
560 ElementOffset += Layout.getSize();
576 /// Size - The current size of the record layout.
579 /// Alignment - The current alignment of the record layout.
587 /// \brief Whether the external AST source has provided a layout for this
592 /// externally-provided layout.
671 void Layout(const RecordDecl *D);
672 void Layout(const CXXRecordDecl *D);
673 void Layout(const ObjCInterfaceDecl *D);
737 /// InitializeLayout - Initialize record layout for the given record decl.
740 /// FinishLayout - Finalize record layout. Adjust record size based on the
791 "Cannot layout class with dependent bases.");
893 const ASTRecordLayout &Layout = Context.getASTRecordLayout(RD);
894 if (Layout.isPrimaryBaseVirtual()) {
896 PrimaryVirtualBase = Layout.getPrimaryBase();
1055 // Layout the base.
1088 const ASTRecordLayout &Layout = Context.getASTRecordLayout(Info->Class);
1093 CharUnits BaseOffset = Offset + Layout.getBaseClassOffset(Base->Class);
1107 const ASTRecordLayout &Layout = Context.getASTRecordLayout(RD);
1108 PrimaryBase = Layout.getPrimaryBase();
1109 PrimaryBaseIsVirtual = Layout.isPrimaryBaseVirtual();
1114 "Cannot layout class with dependent bases.");
1148 // Layout the base.
1161 const ASTRecordLayout &Layout = Context.getASTRecordLayout(Base->Class);
1166 // Query the external layout to see if it provides an offset.
1176 CharUnits UnpackedBaseAlign = Layout.getNonVirtualAlignment();
1183 setSize(std::max(getSize(), Layout.getSize()));
1217 setDataSize(Offset + Layout.getNonVirtualSize());
1221 setSize(std::max(getSize(), Offset + Layout.getSize()));
1277 void ItaniumRecordLayoutBuilder::Layout(const RecordDecl *D) {
1286 void ItaniumRecordLayoutBuilder::Layout(const CXXRecordDecl *RD) {
1326 void ItaniumRecordLayoutBuilder::Layout(const ObjCInterfaceDecl *D) {
1339 // Layout each ivar sequentially.
1350 // Layout each field, for now, just sequentially, respecting alignment. In
1452 // The struct-layout algorithm is dictated by the platform ABI,
1455 // in the System V generic ABI. The basic bitfield layout rule in
1465 // platform ABI's struct-layout algorithm, with the high-level goal
1466 // of duplicating MSVC's layout. For non-bitfields, this follows
1467 // the standard algorithm. The basic bitfield layout rule is to
1481 // e.g. ARM). In ms_struct layout, zero-width bitfields are
1614 // If we're using external layout, give the external layout a chance
1631 // Diagnose differences in layout due to padding or packing.
1729 // If MS bitfield layout is required, figure out what type is being
1884 // we have an externally-supplied layout that also provides overall alignment.
2076 // layout if it is a POD type (in the sense of ISO C++
2080 // bitfield is not a POD for the purpose of layout. Similarly,
2081 // an array type is not a POD for the purpose of layout if the
2083 // layout.
2107 // This section contains an implementation of struct layout that is, up to the
2108 // included tests, compatible with cl.exe (2013). The layout produced is
2116 // * There is no explicit primary base for the purposes of layout. All bases
2124 // due to the two-pass layout scheme for non-virtual-bases.
2156 // layout of the so the leading base is not always the first one declared).
2185 // greater due to __declspec(align()) then a second layout phase occurs after
2186 // The locations of the vf and vb pointers are known. This layout phase
2190 // anything tries to read the vftbl. The second layout phase also treats
2209 void layout(const RecordDecl *RD);
2213 /// \brief Initialized C++ layout, compute alignment and virtual alignment and
2235 ElementInfo getAdjustedElementInfo(const ASTRecordLayout &Layout);
2255 /// \brief The non-virtual size of the record layout.
2257 /// \brief The data size of the record layout.
2259 /// \brief The current alignment of the record layout.
2306 /// \brief True if the external AST source provided a layout for this record.
2309 /// \brief The layout provided by the external AST source. Only active if
2317 const ASTRecordLayout &Layout) {
2319 Info.Alignment = Layout.getAlignment();
2324 EndsWithZeroSizedObject = Layout.hasZeroSizedSubObject();
2329 RequiredAlignment = std::max(RequiredAlignment, Layout.getRequiredAlignment());
2330 Info.Alignment = std::max(Info.Alignment, Layout.getRequiredAlignment());
2331 Info.Size = Layout.getNonVirtualSize();
2358 auto const &Layout = Context.getASTRecordLayout(RT->getDecl());
2359 EndsWithZeroSizedObject = Layout.hasZeroSizedSubObject();
2361 Layout.getRequiredAlignment());
2375 void MicrosoftRecordLayoutBuilder::layout(const RecordDecl *RD) {
2376 // For C record layout, zero-sized records always have size 4.
2433 // Try to respect the external layout if present.
2514 // If this is the first layout, check to see if it leads with a zero sized
2528 const ASTRecordLayout &Layout = Context.getASTRecordLayout(SharedVBPtrBase);
2529 VBPtrOffset = Bases[SharedVBPtrBase] + Layout.getVBPtrOffset();
2661 // layout.
2686 // regular fields by the offset only if not using external record layout.
2695 // If we're using an external layout, the fields offsets have already
2818 const ASTRecordLayout &Layout = Context.getASTRecordLayout(BaseDecl);
2819 if (Layout.hasExtendableVFPtr())
2829 const ASTRecordLayout &Layout = Context.getASTRecordLayout(BaseDecl);
2830 for (const auto &bi : Layout.getVBaseOffsetsMap())
2876 /// getASTRecordLayout - Get or compute information about the layout of the
2890 assert(D && "Cannot get layout of forward declarations!");
2891 assert(!D->isInvalidDecl() && "Cannot get layout of invalid decl!");
2892 assert(D->isCompleteDefinition() && "Cannot layout type before complete!");
2894 // Look up this layout, if already laid out, return what we have.
2916 Builder.layout(D);
2926 Builder.Layout(RD);
2930 // FIXME: this should be stored in the record layout.
2951 Builder.Layout(D);
2964 llvm::outs() << "\n*** Dumping AST Record Layout\n";
3018 const ASTRecordLayout &Layout = C.getASTRecordLayout(FD->getParent());
3019 return Layout.getFieldOffset(FD->getFieldIndex());
3037 /// getObjCLayout - Get or compute information about the layout of the
3040 /// \param Impl - If given, also include the layout of the interface's
3051 // Look up this layout, if already laid out, return what we have.
3069 Builder.Layout(D);
3121 const ASTRecordLayout &Layout = C.getASTRecordLayout(RD);
3136 const CXXRecordDecl *PrimaryBase = Layout.getPrimaryBase();
3137 bool HasOwnVFPtr = Layout.hasOwnVFPtr();
3138 bool HasOwnVBPtr = Layout.hasOwnVBPtr();
3154 "Cannot layout class with dependent bases.");
3162 return Layout.getBaseClassOffset(L) < Layout.getBaseClassOffset(R);
3167 CharUnits BaseOffset = Offset + Layout.getBaseClassOffset(Base);
3176 PrintOffset(OS, Offset + Layout.getVBPtrOffset(), IndentLevel);
3186 uint64_t LocalFieldOffsetInBits = Layout.getFieldOffset(FieldNo);
3213 Layout.getVBaseOffsetsMap();
3219 CharUnits VBaseOffset = Offset + Layout.getVBaseClassOffset(VBase);
3227 VBase == Layout.getPrimaryBase() ?
3237 OS << "[sizeof=" << Layout.getSize().getQuantity();
3239 OS << ", dsize=" << Layout.getDataSize().getQuantity();
3240 OS << ", align=" << Layout.getAlignment().getQuantity();
3245 OS << " nvsize=" << Layout.getNonVirtualSize().getQuantity();
3246 OS << ", nvalign=" << Layout.getNonVirtualAlignment().getQuantity();
3262 // layout-override testing code. There shouldn't be any external
3263 // uses of this format --- when LLDB overrides a layout, it sets up