Daniel Dunbar
7f2896406c
IRgen: Move the bit-field access type into CGBitFieldInfo, and change 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-08 02:59:45 +00:00
Daniel Dunbar
efbf487da8
IRgen: Move BitFieldIsSigned bit into CGBitFieldInfo.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100513 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 01:07:44 +00:00
Daniel Dunbar
c7a984af71
Simplify.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100512 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 01:07:41 +00:00
Daniel Dunbar
2eec0b2e3e
IRgen: Lift BitFieldInfo to CGBitFieldInfo at namespace level.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100433 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 16:20:44 +00:00
Daniel Dunbar
198bcb44b6
IRGen: Move the auxiliary data structures tracking AST -> LLVM mappings out 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-31 01:09:11 +00:00
Daniel Dunbar
490fc90271
CGRecordLayoutBuilder: Switch unions to use same mechanism for tracking 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-31 00:55:13 +00:00
Daniel Dunbar
270e203b50
IRGen: Hide CGRecordLayoutBuilder class, because I can.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99967 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 00:11:27 +00:00
Daniel Dunbar
2924ade97e
IRgen: Move CGRecordLayout to its own happy little file.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99945 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 22:26:10 +00:00
Anders Carlsson
2c12d0319a
Improve handling of emitting 'null' pointers to data members.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95066 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 05:17:25 +00:00
Anders Carlsson
21fd7d7347
Fix an incorrect union layout assert. Fixes PR6164.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94754 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28 18:22:03 +00:00
Anders Carlsson
4b3e5be334
Baby steps towards fixing PR5589. If a class needs a vtable pointer, add one.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91545 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-16 17:27:20 +00:00
Anders Carlsson
c2456824a1
No need to add tail padding if the resulting LLVM struct type will have the 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-12-08 01:24:23 +00:00
Anders Carlsson
1a5e0d7f18
Have ASTRecordLayout keep track of the key function, in preparation of 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-30 23:41:22 +00:00
Mike Stump
a84b4044b7
Fixup key function calculations.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89412 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-20 00:02:19 +00:00
Mike Stump
88bd0094d8
This doesn't work yet.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89307 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-19 03:53:54 +00:00
Fariborz Jahanian
e504170f68
Prevent a code gen. crash on empty unions - pr5408.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86287 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-06 20:47:40 +00:00
Anders Carlsson
5017a157c6
Store the key function of a record decl inside CGRecordLayout.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83900 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-12 21:16:22 +00:00
Mike Stump
1eb4433ac4
Remove tabs, and whitespace cleanups.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 15:08:12 +00:00
Anders Carlsson
366200045f
If the alignment of the chosen field in a union is greater than the 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
2009-09-03 22:56:02 +00:00
Anders Carlsson
d0eb3b93e8
Packed unions should be packed. Fixes an assert Daniel reported.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80808 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 17:51:33 +00:00
Anders Carlsson
fc3eaa47fa
More work towards zero-initializing structs that contain member pointers in constant expressions.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79805 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 01:25:01 +00:00
Anders Carlsson
341bdf8d56
Remove the PaddingFields member from CGRecordLayout, it wasn't used anyway.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79799 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 01:01:04 +00:00
Owen Anderson
0032b2781b
Update for LLVM API change.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78946 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 21:57:51 +00:00
Anders Carlsson
a5dd722bdf
Take #pragma pack into account when laying out structs. Fixes rdar://problem/7095436.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78490 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 19:38:24 +00:00
Anders Carlsson
a860e755f1
Introduce a new PragmaPack attribute, and use it for #pragma pack. The 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
2009-08-08 18:23:56 +00:00
Anders Carlsson
df31e09112
Assert that the LLVM type has the same size as the RecordDecl size.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78481 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-08 18:01:57 +00:00
Owen Anderson
47a434ff3d
Update for LLVM API change.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78259 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 23:18:46 +00:00
Anders Carlsson
de9f2c937a
Simplify alignment handling in the record builder.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78069 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-04 16:29:15 +00:00
Fariborz Jahanian
8a8a629844
No longer need to keep base class offsets in the offset
...
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
2009-07-29 18:50:06 +00:00
Anders Carlsson
c2cc1d5e29
More CGRecordLayoutBuilder cleanup.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77335 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 17:56:36 +00:00
Fariborz Jahanian
cad8665394
Some minor changes toward support of data
...
member access in the presense of non-virtual bases.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77246 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 20:57:45 +00:00
Anders Carlsson
abdad358b5
Enable the new struct type builder now that the constant struct builder works. (The old code will still be there until we know that everything works well.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77190 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 15:31:55 +00:00
Anders Carlsson
c1efe36ca7
Fix a tail padding bug in the record layout builder code. The bug was found by an existing test.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77189 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 14:55:54 +00:00
Anders Carlsson
4c98efdf06
Check in a half finished new constant struct builder (Obviously not used yet).
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76969 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 15:20:52 +00:00
Anders Carlsson
728d7cd2e2
Get rid of the size parameter to AppendField. No functionality change.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76931 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 02:45:50 +00:00
Anders Carlsson
94ae95f17e
Don't just store the field/bit field info one field, do it for all fields in the union.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76907 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-23 22:52:34 +00:00
Anders Carlsson
177d4d8700
Fix another thinko.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76903 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-23 21:52:03 +00:00
Anders Carlsson
faaec2234f
Correct a thinko in bitfield layout code. Fixes PR4611.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76898 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-23 21:16:33 +00:00
Anders Carlsson
4b5584b38b
We don't need to keep track of the packed alignment, just whether the struct is packed or not. Fixes PR4610.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76884 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-23 17:24:40 +00:00
Anders Carlsson
8330ceeebb
Move the LLVM field number for bit fields into the BitFieldInfo structure, since it's meaning is completely different than for non-bit fields.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76882 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-23 17:01:21 +00:00
Anders Carlsson
cfc6758b5f
Set field info for unions.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76856 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-23 04:59:05 +00:00
Anders Carlsson
2cc8f1740d
Handle zero width bit fields in unions correctly (by ignoring them).
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76847 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-23 04:00:39 +00:00
Anders Carlsson
5a6e398eaf
Implement union layout support.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76846 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-23 03:43:54 +00:00
Anders Carlsson
45372a6fdc
Check in CGRecordLayoutBuilder which is a reimplementation of the record layout code. (Yay, no more packed structs unless absolutely necessary). We currently don't use the layouts being built but that will change when the new code is mature enough :)
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76845 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-23 03:17:50 +00:00