aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGRecordLayoutBuilder.cpp
AgeCommit message (Collapse)Author
2011-02-10Eliminate some signed-to-unsigned comparision warnings introduced inKen Dyck
r125156. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125280 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-09Convert RecordLayout::Size to CharUnits from bits. No changes toKen Dyck
functionality intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125156 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-08Convert RecordLayout::NonVirtualAlign to CharUnits. No change inKen Dyck
functionality intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125069 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-01Convert RecordLayout::NonVirtualSize from bit units to CharUnits.Ken Dyck
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124646 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-10Fix another obscure corner layout case.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121436 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04Add a LayoutBase member function. No functionality change.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120924 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04Replace calls to AppendBytes with calls to AppendPadding when the bytes ↵Anders Carlsson
appended are padding. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120922 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-30CGRecordLayoutBuilder does not need to be exported from this module.John McCall
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120489 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-28Don't store the maximum alignment, we can trivially compute it.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120268 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-28More work on laying out virtual bases.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120257 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-25Begin work on actually laying out virtual bases.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120140 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-24Rename RecordLayout::getPrimaryBaseWasVirtual to isPrimaryBaseVirtual.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120133 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-24Add CXXRecordDecl::getIndirectPrimaryBases.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120129 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-24Simplify code.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120109 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-24CGRecordLayout types are always struct types.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120106 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-22Remove FIXME; we don't ever want to lay out empty bases.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119957 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-21Rename BaseLLVMType to NonVirtualBaseLLVMType.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119956 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-21Add getCGRecordLayout helper function. No functionality change.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119955 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-09Remove debugging printf.Nick Lewycky
Fix linux build. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118497 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-09Introduce the concept of a non-virtual base type to CGRecordLayoutBuilder as ↵Anders Carlsson
a first step towards fixing PR6995. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118491 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-31Rename getBaseClassOffset to getBaseClassOffsetInBits and introduce a ↵Anders Carlsson
getBaseClassOffset which returns the offset in CharUnits. Do the same thing for getVBaseClassOffset. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117881 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02IRgen: Move CGBitFieldInfo strategy computation helpers to static memberDaniel Dunbar
functions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112913 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-22Go back to asking CodeGenTypes whether a type is zero-initializable.John McCall
Make CGT defer to the ABI on all member pointer types. This requires giving CGT a handle to the ABI. It's way easier to make that work if we avoid lazily creating the ABI. Make it so. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111786 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-27AST: Rename PragmaPackAttr to MaxFieldAlignmentAttr, which is more accurate.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104795 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-18Correctly initialize bases with member pointers. This should fix PR6441 but ↵Anders Carlsson
that test case is a bit weird and I'd like to investigate further before closing that bug. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104025 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-18Keep track of the LLVM field numbers for non-virtual bases.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104013 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-18Start laying out bases as individual fields. We still use ugly i8 arrays but ↵Anders Carlsson
this is a step in the right direction. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104012 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-05Use a more appropriate LLVM type for the vtable pointer.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103078 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22IRgen: Fix another case where we generated an invalid access component when weDaniel Dunbar
immediately narrowed the access size. Fix this (and previous case) by just choosing a better access size up-front. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102068 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22IRgen: Fix case where we might generate an access component with width == 0, ifDaniel Dunbar
we have to narrow the access side immediately (can happen with packed, -fno-bitfield-type-align). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102067 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22IRgen: Set alignment correctly on bit-field accesses.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102046 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22IRgen: Rewrite bit-field access policy to not access data beyond the bounds ↵Daniel Dunbar
of the structure, which we also now verify as part of the post-layout consistency checks. - This fixes some pedantic bugs with packed structures, as well as major problems with -fno-bitfield-type-align. - Fixes PR5591, PR5567, and all known -fno-bitfield-type-align issues. - Review appreciated. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102045 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22IRgen: Fix CGRecordLayout::print to print the bit-field infos in a ↵Daniel Dunbar
consistent order. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102044 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-21IRgen: Add checking that the LLVM and AST record layout offsets agree (forDaniel Dunbar
non-bit-fields). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102014 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-20IRgen: Always use i8 arrays to access union bit-fields. This is ugly, butDaniel Dunbar
matches how we currently handle structs, and this correctly handles -fno-bitfield-type-align. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101918 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-19AST: Dump ASTRecordLayout objects when they are created with ↵Daniel Dunbar
-fdump-record-layouts. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101815 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-19IRgen: Kill unused function and move the type match assert to after record ↵Daniel Dunbar
dumping. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101814 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17Simplify wide bit-field layout in CGRecordLayoutBuilder, and also fix a bug ↵Anders Carlsson
where assigning to a bit-field member would overwrite other parts of the struct. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101681 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17Unnamed bit-fields in a union should be laid out with a type that doesn't ↵Anders Carlsson
affect alignment. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101673 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17Factor union field layout code out into a separate function. No ↵Anders Carlsson
functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101671 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17Vtable -> VTable renames across the board.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101666 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16Make CGRecordLayoutBuilder deal with wide bit-fields. Will land tests ↵Anders Carlsson
shortly (Daniel, please review). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101472 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-15IRgen: Change CGBitFieldInfo to take the AccessInfo as constructor ↵Daniel Dunbar
arguments, it is now an immutable object. Also, add some checking of various invariants that should hold on the CGBitFieldInfo access. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101345 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-15IRgen: Eliminate now unused fields from CGBitFieldInfo.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101344 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13IRgen: Enhance CGBitFieldInfo with enough information to fully describe the ↵Daniel Dunbar
"policy" with which a bit-field should be accessed. - For now, these policies are computed to match the current IRgen strategy, although the new information isn't being used yet (except in -fdump-record-layouts). - Design comments appreciated. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101178 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-12IRgen: Factor out ComputeBitFieldInfo.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101066 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-12IRgen: Add CGRecordLayout::dump, and dump (irgen) record layouts as part of ↵Daniel Dunbar
-fdump-record-layouts. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101051 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-08IRgen: Move the bit-field access type into CGBitFieldInfo, and change ↵Daniel Dunbar
bit-field LValues to just store the base address of object containing the bit-field. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100745 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06IRgen: Move BitFieldIsSigned bit into CGBitFieldInfo.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100513 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06Simplify.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100512 91177308-0d34-0410-b5e6-96231b3b80d8