Ken Dyck
dac54c124e
Convert RecordLayout::Alignment to CharUnits from bit units. No change in
...
functionality intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125549 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-15 02:32:40 +00:00
Ken Dyck
dd76a9ab9e
Add a helper function, ASTContext::toBits(), that converts sizes in
...
CharUnits to sizes in bits, and use it to tidy up the places where the
conversion was done explicitly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125332 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-11 01:54:29 +00:00
Ken Dyck
9186ff310c
Drop the 'InBits' part from the name of RecordSizeInBits as the value is in
...
character units.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125281 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-10 12:36:29 +00:00
Ken Dyck
7198e94d55
Eliminate some signed-to-unsigned comparision warnings introduced in
...
r125156.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125280 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-10 12:20:05 +00:00
Ken Dyck
5f022d8269
Convert RecordLayout::Size to CharUnits from bits. No changes to
...
functionality intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125156 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-09 01:59:34 +00:00
Ken Dyck
68cf1a5a01
Convert RecordLayout::NonVirtualAlign to CharUnits. No change in
...
functionality intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125069 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-08 02:02:47 +00:00
Ken Dyck
5c3633fa57
Convert RecordLayout::NonVirtualSize from bit units to CharUnits.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124646 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-01 01:52:10 +00:00
Argyrios Kyrtzidis
db2b42fb4d
Fix another obscure corner layout case.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121436 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-10 00:11:00 +00:00
Anders Carlsson
860453c4b4
Add a LayoutBase member function. No functionality change.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120924 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 23:59:48 +00:00
Anders Carlsson
57d2d236d2
Replace calls to AppendBytes with calls to AppendPadding when the bytes appended are padding.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120922 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 23:53:18 +00:00
John McCall
d0de0ce304
CGRecordLayoutBuilder does not need to be exported from this module.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120489 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-30 23:17:27 +00:00
Anders Carlsson
fc86d55b6b
Don't store the maximum alignment, we can trivially compute it.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120268 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-28 23:06:23 +00:00
Anders Carlsson
1d7dc22407
More work on laying out virtual bases.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120257 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-28 19:18:44 +00:00
Anders Carlsson
8f2c6899dd
Begin work on actually laying out virtual bases.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120140 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-25 01:59:35 +00:00
Anders Carlsson
c9e814ba19
Rename RecordLayout::getPrimaryBaseWasVirtual to isPrimaryBaseVirtual.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120133 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-24 23:12:57 +00:00
Anders Carlsson
46170f9c7d
Add CXXRecordDecl::getIndirectPrimaryBases.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120129 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-24 22:50:27 +00:00
Anders Carlsson
3379e9bd71
Simplify code.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120109 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-24 19:57:04 +00:00
Anders Carlsson
ba2c2eec87
CGRecordLayout types are always struct types.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120106 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-24 19:37:16 +00:00
Anders Carlsson
a03613d6e3
Remove FIXME; we don't ever want to lay out empty bases.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119957 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-22 00:03:08 +00:00
Anders Carlsson
9a5a3f2f3b
Rename BaseLLVMType to NonVirtualBaseLLVMType.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119956 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-21 23:59:45 +00:00
Anders Carlsson
f4a15b0df4
Add getCGRecordLayout helper function. No functionality change.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119955 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-21 23:56:06 +00:00
Nick Lewycky
cb0511cc29
Remove debugging printf.
...
Fix linux build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118497 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-09 09:53:02 +00:00
Anders Carlsson
3d155e683a
Introduce the concept of a non-virtual base type to CGRecordLayoutBuilder as a first step towards fixing PR6995.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118491 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-09 05:25:47 +00:00
Anders Carlsson
a14f597957
Rename getBaseClassOffset to getBaseClassOffsetInBits and introduce a 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-10-31 23:22:37 +00:00
Daniel Dunbar
e7a80bd66a
IRgen: Move CGBitFieldInfo strategy computation helpers to static member
...
functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112913 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 23:53:28 +00:00
John McCall
f16aa103d3
Go back to asking CodeGenTypes whether a type is zero-initializable.
...
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-08-22 21:01:12 +00:00
Daniel Dunbar
8a2c92cab2
AST: Rename PragmaPackAttr to MaxFieldAlignmentAttr, which is more accurate.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104795 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-27 01:12:46 +00:00
Anders Carlsson
a83fb4bf81
Correctly initialize bases with member pointers. This should fix PR6441 but 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-18 16:51:41 +00:00
Anders Carlsson
c6772ce9c8
Keep track of the LLVM field numbers for non-virtual bases.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104013 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-18 05:22:06 +00:00
Anders Carlsson
15ddfdc5d8
Start laying out bases as individual fields. We still use ugly i8 arrays but 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-18 05:12:20 +00:00
Anders Carlsson
68e3013ade
Use a more appropriate LLVM type for the vtable pointer.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103078 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-05 05:47:36 +00:00
Daniel Dunbar
52968a1c76
IRgen: Fix another case where we generated an invalid access component when we
...
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-22 15:22:33 +00:00
Daniel Dunbar
4651efb5ba
IRgen: Fix case where we might generate an access component with width == 0, if
...
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-22 14:56:10 +00:00
Daniel Dunbar
89da874f8e
IRgen: Set alignment correctly on bit-field accesses.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102046 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 03:17:04 +00:00
Daniel Dunbar
e1467a4cee
IRgen: Rewrite bit-field access policy to not access data beyond the bounds 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-22 02:35:46 +00:00
Daniel Dunbar
ad759530ff
IRgen: Fix CGRecordLayout::print to print the bit-field infos in a consistent order.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102044 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-22 02:35:36 +00:00
Daniel Dunbar
3b2ae7ae59
IRgen: Add checking that the LLVM and AST record layout offsets agree (for
...
non-bit-fields).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102014 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-21 19:10:49 +00:00
Daniel Dunbar
8ab78a7d9d
IRgen: Always use i8 arrays to access union bit-fields. This is ugly, but
...
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-20 17:52:30 +00:00
Daniel Dunbar
8d8ab749f6
AST: Dump ASTRecordLayout objects when they are created with -fdump-record-layouts.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101815 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-19 20:44:53 +00:00
Daniel Dunbar
2e7b7c2f26
IRgen: Kill unused function and move the type match assert to after record dumping.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101814 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-19 20:44:47 +00:00
Anders Carlsson
6ba38151f7
Simplify wide bit-field layout in CGRecordLayoutBuilder, and also fix a bug 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-17 22:54:57 +00:00
Anders Carlsson
d62328e6a0
Unnamed bit-fields in a union should be laid out with a type that doesn't affect alignment.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101673 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 21:04:52 +00:00
Anders Carlsson
86664465ba
Factor union field layout code out into a separate function. No functionality change.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101671 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 20:49:27 +00:00
Anders Carlsson
046c294a43
Vtable -> VTable renames across the board.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101666 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 20:15:18 +00:00
Anders Carlsson
1c7658fd32
Make CGRecordLayoutBuilder deal with wide bit-fields. Will land tests shortly (Daniel, please review).
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101472 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 16:23:02 +00:00
Daniel Dunbar
2df2569679
IRgen: Change CGBitFieldInfo to take the AccessInfo as constructor 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-15 05:09:32 +00:00
Daniel Dunbar
7fb6195004
IRgen: Eliminate now unused fields from CGBitFieldInfo.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101344 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-15 05:09:28 +00:00
Daniel Dunbar
ab970f90ce
IRgen: Enhance CGBitFieldInfo with enough information to fully describe the "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-13 20:58:55 +00:00
Daniel Dunbar
9b28daf9b6
IRgen: Factor out ComputeBitFieldInfo.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101066 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-12 21:01:28 +00:00
Daniel Dunbar
93c62967d4
IRgen: Add CGRecordLayout::dump, and dump (irgen) record layouts as part of -fdump-record-layouts.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101051 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-12 18:14:18 +00:00
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