John McCall
bcd38217f3
CGRecordLayoutBuilder does not need to be exported from this module.
...
llvm-svn: 120489
2010-11-30 23:17:27 +00:00
Anders Carlsson
acf877be12
Don't store the maximum alignment, we can trivially compute it.
...
llvm-svn: 120268
2010-11-28 23:06:23 +00:00
Anders Carlsson
a459adb2ff
More work on laying out virtual bases.
...
llvm-svn: 120257
2010-11-28 19:18:44 +00:00
Anders Carlsson
1f95ee3016
Begin work on actually laying out virtual bases.
...
llvm-svn: 120140
2010-11-25 01:59:35 +00:00
Anders Carlsson
7f95cd1817
Rename RecordLayout::getPrimaryBaseWasVirtual to isPrimaryBaseVirtual.
...
llvm-svn: 120133
2010-11-24 23:12:57 +00:00
Anders Carlsson
4131f00a1f
Add CXXRecordDecl::getIndirectPrimaryBases.
...
llvm-svn: 120129
2010-11-24 22:50:27 +00:00
Anders Carlsson
6277615cbb
Simplify code.
...
llvm-svn: 120109
2010-11-24 19:57:04 +00:00
Anders Carlsson
36e2fa8209
CGRecordLayout types are always struct types.
...
llvm-svn: 120106
2010-11-24 19:37:16 +00:00
Anders Carlsson
39a6b22023
Remove FIXME; we don't ever want to lay out empty bases.
...
llvm-svn: 119957
2010-11-22 00:03:08 +00:00
Anders Carlsson
a7dd96ce77
Rename BaseLLVMType to NonVirtualBaseLLVMType.
...
llvm-svn: 119956
2010-11-21 23:59:45 +00:00
Anders Carlsson
e64fbe2a6c
Add getCGRecordLayout helper function. No functionality change.
...
llvm-svn: 119955
2010-11-21 23:56:06 +00:00
Nick Lewycky
30d939681c
Remove debugging printf.
...
Fix linux build.
llvm-svn: 118497
2010-11-09 09:53:02 +00:00
Anders Carlsson
c1351cac17
Introduce the concept of a non-virtual base type to CGRecordLayoutBuilder as a first step towards fixing PR6995.
...
llvm-svn: 118491
2010-11-09 05:25:47 +00:00
Anders Carlsson
fd88a6160d
Rename getBaseClassOffset to getBaseClassOffsetInBits and introduce a getBaseClassOffset which returns the offset in CharUnits. Do the same thing for getVBaseClassOffset.
...
llvm-svn: 117881
2010-10-31 23:22:37 +00:00
Daniel Dunbar
c7f9bbafe4
IRgen: Move CGBitFieldInfo strategy computation helpers to static member
...
functions.
llvm-svn: 112913
2010-09-02 23:53:28 +00:00
John McCall
614dbdcd55
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.
llvm-svn: 111786
2010-08-22 21:01:12 +00:00
Daniel Dunbar
401304462a
AST: Rename PragmaPackAttr to MaxFieldAlignmentAttr, which is more accurate.
...
llvm-svn: 104795
2010-05-27 01:12:46 +00:00
Anders Carlsson
be48c548c5
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.
...
llvm-svn: 104025
2010-05-18 16:51:41 +00:00
Anders Carlsson
061ca524b7
Keep track of the LLVM field numbers for non-virtual bases.
...
llvm-svn: 104013
2010-05-18 05:22:06 +00:00
Anders Carlsson
af9e5afe54
Start laying out bases as individual fields. We still use ugly i8 arrays but this is a step in the right direction.
...
llvm-svn: 104012
2010-05-18 05:12:20 +00:00
Anders Carlsson
58fe1756fb
Use a more appropriate LLVM type for the vtable pointer.
...
llvm-svn: 103078
2010-05-05 05:47:36 +00:00
Daniel Dunbar
5981377698
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.
llvm-svn: 102068
2010-04-22 15:22:33 +00:00
Daniel Dunbar
5d6c07e0e9
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).
llvm-svn: 102067
2010-04-22 14:56:10 +00:00
Daniel Dunbar
fc66e0ed87
IRgen: Set alignment correctly on bit-field accesses.
...
llvm-svn: 102046
2010-04-22 03:17:04 +00:00
Daniel Dunbar
488f55c271
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.
llvm-svn: 102045
2010-04-22 02:35:46 +00:00
Daniel Dunbar
b6f4b05914
IRgen: Fix CGRecordLayout::print to print the bit-field infos in a consistent order.
...
llvm-svn: 102044
2010-04-22 02:35:36 +00:00
Daniel Dunbar
2ba67440b6
IRgen: Add checking that the LLVM and AST record layout offsets agree (for
...
non-bit-fields).
llvm-svn: 102014
2010-04-21 19:10:49 +00:00
Daniel Dunbar
20b551a443
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.
llvm-svn: 101918
2010-04-20 17:52:30 +00:00
Daniel Dunbar
ccabe48235
AST: Dump ASTRecordLayout objects when they are created with -fdump-record-layouts.
...
llvm-svn: 101815
2010-04-19 20:44:53 +00:00
Daniel Dunbar
2ea5183b59
IRgen: Kill unused function and move the type match assert to after record dumping.
...
llvm-svn: 101814
2010-04-19 20:44:47 +00:00
Anders Carlsson
d5f27b0583
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.
...
llvm-svn: 101681
2010-04-17 22:54:57 +00:00
Anders Carlsson
2295f13bb0
Unnamed bit-fields in a union should be laid out with a type that doesn't affect alignment.
...
llvm-svn: 101673
2010-04-17 21:04:52 +00:00
Anders Carlsson
1de2f5710b
Factor union field layout code out into a separate function. No functionality change.
...
llvm-svn: 101671
2010-04-17 20:49:27 +00:00
Anders Carlsson
11e5140db9
Vtable -> VTable renames across the board.
...
llvm-svn: 101666
2010-04-17 20:15:18 +00:00
Anders Carlsson
be6f3181dd
Make CGRecordLayoutBuilder deal with wide bit-fields. Will land tests shortly (Daniel, please review).
...
llvm-svn: 101472
2010-04-16 16:23:02 +00:00
Daniel Dunbar
9c78d63fbc
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.
llvm-svn: 101345
2010-04-15 05:09:32 +00:00
Daniel Dunbar
bb13845c5f
IRgen: Eliminate now unused fields from CGBitFieldInfo.
...
llvm-svn: 101344
2010-04-15 05:09:28 +00:00
Daniel Dunbar
b935b9370d
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.
llvm-svn: 101178
2010-04-13 20:58:55 +00:00
Daniel Dunbar
f9c24f8403
IRgen: Factor out ComputeBitFieldInfo.
...
llvm-svn: 101066
2010-04-12 21:01:28 +00:00
Daniel Dunbar
b97bff9aa9
IRgen: Add CGRecordLayout::dump, and dump (irgen) record layouts as part of -fdump-record-layouts.
...
llvm-svn: 101051
2010-04-12 18:14:18 +00:00
Daniel Dunbar
c75c8bd757
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.
...
llvm-svn: 100745
2010-04-08 02:59:45 +00:00
Daniel Dunbar
196ea449ed
IRgen: Move BitFieldIsSigned bit into CGBitFieldInfo.
...
llvm-svn: 100513
2010-04-06 01:07:44 +00:00
Daniel Dunbar
d45491077a
Simplify.
...
llvm-svn: 100512
2010-04-06 01:07:41 +00:00
Daniel Dunbar
cd3d5e76ce
IRgen: Lift BitFieldInfo to CGBitFieldInfo at namespace level.
...
llvm-svn: 100433
2010-04-05 16:20:44 +00:00
Daniel Dunbar
034299ef25
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.
llvm-svn: 99978
2010-03-31 01:09:11 +00:00
Daniel Dunbar
e75a64f2d3
CGRecordLayoutBuilder: Switch unions to use same mechanism for tracking field and bit-field info as structs.
...
- Anders, please check.
llvm-svn: 99977
2010-03-31 00:55:13 +00:00
Daniel Dunbar
23ee4b7710
IRGen: Hide CGRecordLayoutBuilder class, because I can.
...
llvm-svn: 99967
2010-03-31 00:11:27 +00:00
Daniel Dunbar
072d0bb247
IRgen: Move CGRecordLayout to its own happy little file.
...
llvm-svn: 99945
2010-03-30 22:26:10 +00:00
Anders Carlsson
e8bfe412ec
Improve handling of emitting 'null' pointers to data members.
...
llvm-svn: 95066
2010-02-02 05:17:25 +00:00
Anders Carlsson
b1ef991097
Fix an incorrect union layout assert. Fixes PR6164.
...
llvm-svn: 94754
2010-01-28 18:22:03 +00:00