summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGRecordLayoutBuilder.cpp
Commit message (Collapse)AuthorAge
...
* Start laying out bases as individual fields. We still use ugly i8 arrays but ↵Anders Carlsson2010-05-18
| | | | | | 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
* Use a more appropriate LLVM type for the vtable pointer.Anders Carlsson2010-05-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103078 91177308-0d34-0410-b5e6-96231b3b80d8
* IRgen: Fix another case where we generated an invalid access component when weDaniel Dunbar2010-04-22
| | | | | | | 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
* IRgen: Fix case where we might generate an access component with width == 0, ifDaniel Dunbar2010-04-22
| | | | | | | 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
* IRgen: Set alignment correctly on bit-field accesses.Daniel Dunbar2010-04-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102046 91177308-0d34-0410-b5e6-96231b3b80d8
* IRgen: Rewrite bit-field access policy to not access data beyond the bounds ↵Daniel Dunbar2010-04-22
| | | | | | | | | | | | 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
* IRgen: Fix CGRecordLayout::print to print the bit-field infos in a ↵Daniel Dunbar2010-04-22
| | | | | | consistent order. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102044 91177308-0d34-0410-b5e6-96231b3b80d8
* IRgen: Add checking that the LLVM and AST record layout offsets agree (forDaniel Dunbar2010-04-21
| | | | | | non-bit-fields). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102014 91177308-0d34-0410-b5e6-96231b3b80d8
* IRgen: Always use i8 arrays to access union bit-fields. This is ugly, butDaniel Dunbar2010-04-20
| | | | | | | 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
* AST: Dump ASTRecordLayout objects when they are created with ↵Daniel Dunbar2010-04-19
| | | | | | -fdump-record-layouts. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101815 91177308-0d34-0410-b5e6-96231b3b80d8
* IRgen: Kill unused function and move the type match assert to after record ↵Daniel Dunbar2010-04-19
| | | | | | dumping. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101814 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify wide bit-field layout in CGRecordLayoutBuilder, and also fix a bug ↵Anders Carlsson2010-04-17
| | | | | | 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
* Unnamed bit-fields in a union should be laid out with a type that doesn't ↵Anders Carlsson2010-04-17
| | | | | | affect alignment. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101673 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor union field layout code out into a separate function. No ↵Anders Carlsson2010-04-17
| | | | | | functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101671 91177308-0d34-0410-b5e6-96231b3b80d8
* Vtable -> VTable renames across the board.Anders Carlsson2010-04-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101666 91177308-0d34-0410-b5e6-96231b3b80d8
* Make CGRecordLayoutBuilder deal with wide bit-fields. Will land tests ↵Anders Carlsson2010-04-16
| | | | | | shortly (Daniel, please review). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101472 91177308-0d34-0410-b5e6-96231b3b80d8
* IRgen: Change CGBitFieldInfo to take the AccessInfo as constructor ↵Daniel Dunbar2010-04-15
| | | | | | | | 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
* IRgen: Eliminate now unused fields from CGBitFieldInfo.Daniel Dunbar2010-04-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101344 91177308-0d34-0410-b5e6-96231b3b80d8
* IRgen: Enhance CGBitFieldInfo with enough information to fully describe the ↵Daniel Dunbar2010-04-13
| | | | | | | | | | "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
* IRgen: Factor out ComputeBitFieldInfo.Daniel Dunbar2010-04-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101066 91177308-0d34-0410-b5e6-96231b3b80d8
* IRgen: Add CGRecordLayout::dump, and dump (irgen) record layouts as part of ↵Daniel Dunbar2010-04-12
| | | | | | -fdump-record-layouts. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101051 91177308-0d34-0410-b5e6-96231b3b80d8
* IRgen: Move the bit-field access type into CGBitFieldInfo, and change ↵Daniel Dunbar2010-04-08
| | | | | | 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
* IRgen: Move BitFieldIsSigned bit into CGBitFieldInfo.Daniel Dunbar2010-04-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100513 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify.Daniel Dunbar2010-04-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100512 91177308-0d34-0410-b5e6-96231b3b80d8
* IRgen: Lift BitFieldInfo to CGBitFieldInfo at namespace level.Daniel Dunbar2010-04-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100433 91177308-0d34-0410-b5e6-96231b3b80d8
* IRGen: Move the auxiliary data structures tracking AST -> LLVM mappings out ↵Daniel Dunbar2010-03-31
| | | | | | | | 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
* CGRecordLayoutBuilder: Switch unions to use same mechanism for tracking ↵Daniel Dunbar2010-03-31
| | | | | | | | 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
* IRGen: Hide CGRecordLayoutBuilder class, because I can.Daniel Dunbar2010-03-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99967 91177308-0d34-0410-b5e6-96231b3b80d8
* IRgen: Move CGRecordLayout to its own happy little file.Daniel Dunbar2010-03-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99945 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve handling of emitting 'null' pointers to data members.Anders Carlsson2010-02-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95066 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an incorrect union layout assert. Fixes PR6164.Anders Carlsson2010-01-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94754 91177308-0d34-0410-b5e6-96231b3b80d8
* Baby steps towards fixing PR5589. If a class needs a vtable pointer, add one.Anders Carlsson2009-12-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91545 91177308-0d34-0410-b5e6-96231b3b80d8
* No need to add tail padding if the resulting LLVM struct type will have the ↵Anders Carlsson2009-12-08
| | | | | | same size as the final record size. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90820 91177308-0d34-0410-b5e6-96231b3b80d8
* Have ASTRecordLayout keep track of the key function, in preparation of ↵Anders Carlsson2009-11-30
| | | | | | fixing a synthetic ctor/dtor bug. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90168 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixup key function calculations.Mike Stump2009-11-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89412 91177308-0d34-0410-b5e6-96231b3b80d8
* This doesn't work yet.Mike Stump2009-11-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89307 91177308-0d34-0410-b5e6-96231b3b80d8
* Prevent a code gen. crash on empty unions - pr5408.Fariborz Jahanian2009-11-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86287 91177308-0d34-0410-b5e6-96231b3b80d8
* Store the key function of a record decl inside CGRecordLayout.Anders Carlsson2009-10-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83900 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
* If the alignment of the chosen field in a union is greater than the ↵Anders Carlsson2009-09-03
| | | | | | alignment of the union, we need to use a packed LLVM struct. Fixes <rdar://problem/7184250>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80964 91177308-0d34-0410-b5e6-96231b3b80d8
* Packed unions should be packed. Fixes an assert Daniel reported.Anders Carlsson2009-09-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80808 91177308-0d34-0410-b5e6-96231b3b80d8
* More work towards zero-initializing structs that contain member pointers in ↵Anders Carlsson2009-08-23
| | | | | | constant expressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79805 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the PaddingFields member from CGRecordLayout, it wasn't used anyway.Anders Carlsson2009-08-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79799 91177308-0d34-0410-b5e6-96231b3b80d8
* Update for LLVM API change.Owen Anderson2009-08-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78946 91177308-0d34-0410-b5e6-96231b3b80d8
* Take #pragma pack into account when laying out structs. Fixes ↵Anders Carlsson2009-08-08
| | | | | | rdar://problem/7095436. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78490 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce a new PragmaPack attribute, and use it for #pragma pack. The ↵Anders Carlsson2009-08-08
| | | | | | | | | PackedAttr now only represents __attribute__((packed)). This is necessary because #pragma pack and __attribute__((packed)) have different semantics. No functionality change yet, but this lays the groundwork for fixing a record layout bug. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78483 91177308-0d34-0410-b5e6-96231b3b80d8
* Assert that the LLVM type has the same size as the RecordDecl size.Anders Carlsson2009-08-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78481 91177308-0d34-0410-b5e6-96231b3b80d8
* Update for LLVM API change.Owen Anderson2009-08-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78259 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify alignment handling in the record builder.Anders Carlsson2009-08-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78069 91177308-0d34-0410-b5e6-96231b3b80d8
* No longer need to keep base class offsets in the offsetFariborz Jahanian2009-07-29
| | | | | | | table as it has its own place now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77491 91177308-0d34-0410-b5e6-96231b3b80d8