aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGRecordLayoutBuilder.cpp
AgeCommit message (Collapse)Author
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
2010-04-05IRgen: Lift BitFieldInfo to CGBitFieldInfo at namespace level.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100433 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31IRGen: Move the auxiliary data structures tracking AST -> LLVM mappings out ↵Daniel Dunbar
of CodeGenTypes, to per-record CGRecordLayout structures. - I did a cursory check that this was perf neutral, FWIW. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99978 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31CGRecordLayoutBuilder: Switch unions to use same mechanism for tracking ↵Daniel Dunbar
field and bit-field info as structs. - Anders, please check. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99977 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31IRGen: Hide CGRecordLayoutBuilder class, because I can.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99967 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30IRgen: Move CGRecordLayout to its own happy little file.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99945 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02Improve handling of emitting 'null' pointers to data members.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95066 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28Fix an incorrect union layout assert. Fixes PR6164.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94754 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-16Baby steps towards fixing PR5589. If a class needs a vtable pointer, add one.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91545 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-08No need to add tail padding if the resulting LLVM struct type will have the ↵Anders Carlsson
same size as the final record size. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90820 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30Have ASTRecordLayout keep track of the key function, in preparation of ↵Anders Carlsson
fixing a synthetic ctor/dtor bug. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90168 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-20Fixup key function calculations.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89412 91177308-0d34-0410-b5e6-96231b3b80d8