Fariborz Jahanian
307eace474
In ms_struct structs, Establish a new alignment for a
...
non-bitfield following a bitfield if size of their types differ.
llvm-svn: 131032
2011-05-06 22:42:22 +00:00
Fariborz Jahanian
b7a2879677
Establish a new alignment for an ms_struct bitfield following
...
a non-bitfield if size of their types differ.
llvm-svn: 131023
2011-05-06 21:56:12 +00:00
Fariborz Jahanian
84335f7c8e
More ms_struct bitfield stuff:
...
Adjacent bit fields are packed into the same 1-, 2-, or
4-byte allocation unit if the integral types are the same
size. // rdar://8823265.
llvm-svn: 130851
2011-05-04 18:51:37 +00:00
Fariborz Jahanian
759e4a1add
Only the first zero-length bitfield decides alignment of
...
the followup data member in an ms_struct struct.
// rdar:// 8823265
llvm-svn: 130795
2011-05-03 22:07:14 +00:00
Fariborz Jahanian
fc0fe6eb52
Finish off rules for z-length bitfields in ms_struct
...
structs. // rdar://8823265
llvm-svn: 130783
2011-05-03 20:21:04 +00:00
Fariborz Jahanian
eb39741c0b
More rule enforcement of zero bitfields for ms_struct.
...
llvm-svn: 130696
2011-05-02 17:20:56 +00:00
Fariborz Jahanian
595ec5d43c
Some refactoring of my ms_struct patch.
...
// rdar://8823265 related.
llvm-svn: 130311
2011-04-27 17:14:21 +00:00
Fariborz Jahanian
bcb23a180b
With ms_struct attribut, Zero-length bitfields following
...
non-bitfield members are ignore. // rdar://8823265 wip
llvm-svn: 130257
2011-04-26 23:52:16 +00:00
Ted Kremenek
022dbc1672
Simplify crash recovery cleanup registration.
...
llvm-svn: 128057
2011-03-22 01:15:19 +00:00
Ted Kremenek
f75d089679
Recover memory from RecordLayoutBuilders during crashes.
...
llvm-svn: 127931
2011-03-19 01:00:36 +00:00
Ken Dyck
a1a2e8decb
Instead of round up sizes to '8', round them up to the alignment of the char
...
type.
llvm-svn: 127391
2011-03-10 02:00:35 +00:00
Ken Dyck
e73807538a
Round up the non-virtual size to the next char instead of rounding down.
...
llvm-svn: 127390
2011-03-10 01:53:59 +00:00
Ken Dyck
dbe37f38d0
Use CharUnits for TypeAlign variable in LayoutWideBitField(). No change in
...
functionality intended.
llvm-svn: 126730
2011-03-01 01:36:00 +00:00
Ken Dyck
aab635e67a
Change the return type of GetVirtualPointersSize() to CharUnits. No change
...
in functionality intended.
llvm-svn: 126727
2011-03-01 01:22:45 +00:00
Ken Dyck
1b4420ed42
Retry r126357. Use CharUnits for the Size and DataSize calculations when
...
they are known to be exact multiples of the width of the char type. Add a
test case to CodeGen/union.c that would have caught the problem with the
previous attempt. No change in functionality intended.
llvm-svn: 126628
2011-02-28 02:01:38 +00:00
Daniel Dunbar
30cdc7022b
Revert "Use CharUnits values for Size and DataSize outside of the bitfield
...
layout", it broke some GCC tests.
llvm-svn: 126386
2011-02-24 16:40:53 +00:00
Ken Dyck
8e74e79145
Use CharUnits values for Size and DataSize outside of the bitfield layout
...
methods, when they are known to be exact multiples of the width of the char
type.
llvm-svn: 126357
2011-02-24 02:12:14 +00:00
Ken Dyck
3c215f2fd1
Use Context.getCharWidth() in place of literal '8's in assertions.
...
llvm-svn: 126356
2011-02-24 01:33:05 +00:00
Ken Dyck
ecfc75529f
Make the Size and DataSize members more CharUnits-friendly by wrapping them
...
with getter and setter methods in both bit units and CharUnits. This will help
simplify some of the unit mismatch in the parts of the code where sizes are
known to be exact multiples of the width of the char type.
Assertions in the getters help guard against accidentally converting to
CharUnits when sizes are not exact multiples of the char width.
llvm-svn: 126354
2011-02-24 01:13:28 +00:00
Ken Dyck
6d90e8937c
Expand use of CharUnits in LayoutField(). No change in functionality
...
intended.
llvm-svn: 126066
2011-02-20 02:06:09 +00:00
Ken Dyck
85ef0431a7
Expand use of CharUnits for alignments further. No change in functionality
...
intended.
llvm-svn: 126034
2011-02-19 18:58:07 +00:00
Ken Dyck
02ced6fd19
Convert MaxFieldAlignment to CharUnits from bits. No change in functionality
...
intended.
llvm-svn: 125704
2011-02-17 01:49:42 +00:00
Ken Dyck
1300b3b357
Convert the UnpackedAlignment field to CharUnits from bits. No change in
...
functionality intended.
llvm-svn: 125643
2011-02-16 02:11:31 +00:00
Ken Dyck
4731d5b65a
Convert Alignment member to CharUnits from bits. No change in functionality
...
intended.
llvm-svn: 125641
2011-02-16 02:05:21 +00:00
Ken Dyck
af1c83fbe7
Convert NonVirtualSize to CharUnits from bits. No change in functionality
...
intended.
llvm-svn: 125639
2011-02-16 01:52:01 +00:00
Ken Dyck
a2d3dda041
Convert NonVirtualAlignment to CharUnits. No change in functionality
...
intended.
llvm-svn: 125638
2011-02-16 01:43:15 +00:00
Ken Dyck
7ad11e70b6
Convert RecordLayout::Alignment to CharUnits from bit units. No change in
...
functionality intended.
llvm-svn: 125549
2011-02-15 02:32:40 +00:00
Ken Dyck
d5090c16f8
Convert RecordLayout::DataSize to CharUnits from bits, eliminating two
...
unnecessary calls to RoundUpToAlignment. No changes to functionality
intended.
llvm-svn: 125356
2011-02-11 02:20:09 +00:00
Ken Dyck
b0fcc59e19
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.
llvm-svn: 125332
2011-02-11 01:54:29 +00:00
Ken Dyck
c8ae55050d
Convert RecordLayout::Size to CharUnits from bits. No changes to
...
functionality intended.
llvm-svn: 125156
2011-02-09 01:59:34 +00:00
Ken Dyck
bec0285d7f
Convert RecordLayout::NonVirtualAlign to CharUnits. No change in
...
functionality intended.
llvm-svn: 125069
2011-02-08 02:02:47 +00:00
Fariborz Jahanian
09b2331cf7
For gcc compatibility, size of a class which is zero
...
but has non-empty data fields, such as array of zero length,
remains zero.
// rdar://8945175
llvm-svn: 124741
2011-02-02 19:36:18 +00:00
Douglas Gregor
dbe3927026
Basic support for -mms-bitfields, from Carl Norum!
...
llvm-svn: 124661
2011-02-01 15:15:22 +00:00
Ken Dyck
316d6f69bc
Convert RecordLayout::NonVirtualSize from bit units to CharUnits.
...
llvm-svn: 124646
2011-02-01 01:52:10 +00:00
Ken Dyck
7c4026bea7
Remove private toCharUnits() helper method, replacing with calls to
...
ASTContext::toCharUnitsFromBits().
llvm-svn: 124092
2011-01-24 01:28:50 +00:00
Ken Dyck
86a7fcc19c
Replace calls to CharUnits::fromQuantity() with ones
...
ASTContext::toCharUnitsFromBits() when converting from bit sizes to char units.
llvm-svn: 123715
2011-01-18 01:56:16 +00:00
Jay Foad
39c7980772
PR3558: mark "logically const" accessor methods in ASTContext as const,
...
and mark the fields they use as mutable. This allows us to remove a few
const_casts.
llvm-svn: 123314
2011-01-12 09:06:06 +00:00
Rafael Espindola
7bcde197d7
Fix PR8796.
...
The problem was that we were asserting the we never added an empty class
to the same offset twice. This is not true for unions, where two members, empty
or not, can have the some offset.
llvm-svn: 122633
2010-12-29 23:02:58 +00:00
Argyrios Kyrtzidis
d62c9be4fc
Fix another unnecessary-struct-padding issue.
...
llvm-svn: 121352
2010-12-09 02:47:58 +00:00
Argyrios Kyrtzidis
8b54274fcf
Before determining the effect the alignment of base struct will have in the aligment of the sub-struct,
...
take into account if the sub-struct is packed and its maximum field alignment.
Fixes rdar://8745206
llvm-svn: 121335
2010-12-09 00:35:20 +00:00
Anders Carlsson
60a6263ee8
Move isNearlyEmpty out into the ASTContext so it can be called from CodeGen as well.
...
llvm-svn: 120137
2010-11-25 01:51:53 +00:00
Anders Carlsson
7f95cd1817
Rename RecordLayout::getPrimaryBaseWasVirtual to isPrimaryBaseVirtual.
...
llvm-svn: 120133
2010-11-24 23:12:57 +00:00
Anders Carlsson
5adde29d86
Use the newly added function in ASTRecordLayoutBuilder.
...
llvm-svn: 120131
2010-11-24 22:55:48 +00:00
Argyrios Kyrtzidis
d004064864
Refactoring of Diagnostic class.
...
-Move the stuff of Diagnostic related to creating/querying diagnostic IDs into a new DiagnosticIDs class.
-DiagnosticIDs can be shared among multiple Diagnostics for multiple translation units.
-The rest of the state in Diagnostic object is considered related and tied to one translation unit.
-Have Diagnostic point to the SourceManager that is related with. Diagnostic can now accept just a
SourceLocation instead of a FullSourceLoc.
-Reflect the changes to various interfaces.
llvm-svn: 119730
2010-11-18 20:06:41 +00:00
Anders Carlsson
09814d3f3a
Don't update empty field subobjects for bitfields. Fixes PR8519.
...
llvm-svn: 117921
2010-11-01 15:14:51 +00:00
Anders Carlsson
0a14ee9ed8
Get rid of more calls to getBaseClassOffsetInBits.
...
llvm-svn: 117883
2010-11-01 00:21:58 +00:00
Anders Carlsson
3f01871647
Port over a couple of getVBaseClassOffsetInBits call sites to use getVBaseClassOffset instead.
...
llvm-svn: 117882
2010-10-31 23:45:59 +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
Anders Carlsson
a2f8e41a0a
Start converting over the RecordLayoutBuilder next.
...
llvm-svn: 117878
2010-10-31 22:20:42 +00:00
Anders Carlsson
28466ab8f4
EmptyObjectMap now uses CharUnits wherever possible.
...
llvm-svn: 117877
2010-10-31 22:13:23 +00:00