summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/RecordLayoutBuilder.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Additional comments and whitespace.Chad Rosier2011-08-041-3/+3
| | | | llvm-svn: 136892
* Add partial support for using anonymous bitfields (e.g., int : 0) to enforce Chad Rosier2011-08-041-11/+30
| | | | | | | | | | | | | | | | alignment. This fixes cases where the anonymous bitfield is followed by a non-bitfield member. E.g., struct t4 { int foo : 1; long : 0; char bar; }; Part of rdar://9859156 llvm-svn: 136858
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-6/+6
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Add a const overload for ObjCInterfaceDecl::all_declared_ivar_begin.Jordy Rose2011-07-221-3/+2
| | | | | | | | | This was previously not-const only because it has to lazily construct a chain of ivars the first time it is called (and after the chain is invalidated). In practice, all the clients were just const_casting their const Decls; all those now-unnecessary const_casts have been removed. llvm-svn: 135741
* Eliminate most uses of ShallowCollectObjCIvars which requiresFariborz Jahanian2011-06-281-5/+4
| | | | | | | a vector for collection. Use iterators where needed instead. // rdar://6817577 llvm-svn: 134015
* PR10120: Make CodeGenModule::getVTableLinkage use NamedDecl::getLinkage to ↵Eli Friedman2011-06-101-2/+2
| | | | | | | | determine whether the vtable should be externally visible, instead of a rough approximation of it which messes up with templates. While I'm here, zap the other user of isInAnonymousNamespace outside of Decl.cpp. llvm-svn: 132861
* Implenment #pack pragma and ms_struct attribute layout.Fariborz Jahanian2011-05-111-1/+47
| | | | | | Concludes // radar://8823265. llvm-svn: 131188
* Support pack pragma and ms_struct attributes. // rdar://8823265Fariborz Jahanian2011-05-101-0/+7
| | | | llvm-svn: 131142
* 'long long' requires special treatment in ms_structFariborz Jahanian2011-05-091-0/+10
| | | | | | structs (impacts 32-bit only though). llvm-svn: 131103
* In ms_struct structs, Establish a new alignment for a Fariborz Jahanian2011-05-061-3/+7
| | | | | | non-bitfield following a bitfield if size of their types differ. llvm-svn: 131032
* Establish a new alignment for an ms_struct bitfield followingFariborz Jahanian2011-05-061-1/+4
| | | | | | a non-bitfield if size of their types differ. llvm-svn: 131023
* More ms_struct bitfield stuff:Fariborz Jahanian2011-05-041-1/+26
| | | | | | | | 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
* Only the first zero-length bitfield decides alignment ofFariborz Jahanian2011-05-031-2/+4
| | | | | | | the followup data member in an ms_struct struct. // rdar:// 8823265 llvm-svn: 130795
* Finish off rules for z-length bitfields in ms_structFariborz Jahanian2011-05-031-16/+35
| | | | | | structs. // rdar://8823265 llvm-svn: 130783
* More rule enforcement of zero bitfields for ms_struct.Fariborz Jahanian2011-05-021-2/+17
| | | | llvm-svn: 130696
* Some refactoring of my ms_struct patch.Fariborz Jahanian2011-04-271-3/+1
| | | | | | // rdar://8823265 related. llvm-svn: 130311
* With ms_struct attribut, Zero-length bitfields following Fariborz Jahanian2011-04-261-2/+19
| | | | | | non-bitfield members are ignore. // rdar://8823265 wip llvm-svn: 130257
* Simplify crash recovery cleanup registration.Ted Kremenek2011-03-221-3/+2
| | | | llvm-svn: 128057
* Recover memory from RecordLayoutBuilders during crashes.Ted Kremenek2011-03-191-1/+6
| | | | llvm-svn: 127931
* Instead of round up sizes to '8', round them up to the alignment of the charKen Dyck2011-03-101-2/+4
| | | | | | type. llvm-svn: 127391
* Round up the non-virtual size to the next char instead of rounding down.Ken Dyck2011-03-101-2/+3
| | | | llvm-svn: 127390
* Use CharUnits for TypeAlign variable in LayoutWideBitField(). No change inKen Dyck2011-03-011-4/+5
| | | | | | functionality intended. llvm-svn: 126730
* Change the return type of GetVirtualPointersSize() to CharUnits. No changeKen Dyck2011-03-011-8/+10
| | | | | | in functionality intended. llvm-svn: 126727
* Retry r126357. Use CharUnits for the Size and DataSize calculations whenKen Dyck2011-02-281-36/+27
| | | | | | | | 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
* Revert "Use CharUnits values for Size and DataSize outside of the bitfieldDaniel Dunbar2011-02-241-19/+23
| | | | | | layout", it broke some GCC tests. llvm-svn: 126386
* Use CharUnits values for Size and DataSize outside of the bitfield layoutKen Dyck2011-02-241-23/+19
| | | | | | | methods, when they are known to be exact multiples of the width of the char type. llvm-svn: 126357
* Use Context.getCharWidth() in place of literal '8's in assertions.Ken Dyck2011-02-241-2/+2
| | | | llvm-svn: 126356
* Make the Size and DataSize members more CharUnits-friendly by wrapping themKen Dyck2011-02-241-35/+58
| | | | | | | | | | | 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
* Expand use of CharUnits in LayoutField(). No change in functionalityKen Dyck2011-02-201-29/+34
| | | | | | intended. llvm-svn: 126066
* Expand use of CharUnits for alignments further. No change in functionalityKen Dyck2011-02-191-30/+30
| | | | | | intended. llvm-svn: 126034
* Convert MaxFieldAlignment to CharUnits from bits. No change in functionalityKen Dyck2011-02-171-18/+23
| | | | | | intended. llvm-svn: 125704
* Convert the UnpackedAlignment field to CharUnits from bits. No change inKen Dyck2011-02-161-6/+9
| | | | | | functionality intended. llvm-svn: 125643
* Convert Alignment member to CharUnits from bits. No change in functionalityKen Dyck2011-02-161-15/+16
| | | | | | intended. llvm-svn: 125641
* Convert NonVirtualSize to CharUnits from bits. No change in functionalityKen Dyck2011-02-161-7/+9
| | | | | | intended. llvm-svn: 125639
* Convert NonVirtualAlignment to CharUnits. No change in functionalityKen Dyck2011-02-161-6/+5
| | | | | | intended. llvm-svn: 125638
* Convert RecordLayout::Alignment to CharUnits from bit units. No change inKen Dyck2011-02-151-6/+9
| | | | | | functionality intended. llvm-svn: 125549
* Convert RecordLayout::DataSize to CharUnits from bits, eliminating twoKen Dyck2011-02-111-6/+7
| | | | | | | unnecessary calls to RoundUpToAlignment. No changes to functionality intended. llvm-svn: 125356
* Add a helper function, ASTContext::toBits(), that converts sizes inKen Dyck2011-02-111-14/+6
| | | | | | | CharUnits to sizes in bits, and use it to tidy up the places where the conversion was done explicitly. llvm-svn: 125332
* Convert RecordLayout::Size to CharUnits from bits. No changes toKen Dyck2011-02-091-11/+18
| | | | | | functionality intended. llvm-svn: 125156
* Convert RecordLayout::NonVirtualAlign to CharUnits. No change inKen Dyck2011-02-081-3/+5
| | | | | | functionality intended. llvm-svn: 125069
* For gcc compatibility, size of a class which is zeroFariborz Jahanian2011-02-021-2/+11
| | | | | | | | but has non-empty data fields, such as array of zero length, remains zero. // rdar://8945175 llvm-svn: 124741
* Basic support for -mms-bitfields, from Carl Norum!Douglas Gregor2011-02-011-0/+14
| | | | llvm-svn: 124661
* Convert RecordLayout::NonVirtualSize from bit units to CharUnits.Ken Dyck2011-02-011-3/+4
| | | | llvm-svn: 124646
* Remove private toCharUnits() helper method, replacing with calls toKen Dyck2011-01-241-17/+10
| | | | | | ASTContext::toCharUnitsFromBits(). llvm-svn: 124092
* Replace calls to CharUnits::fromQuantity() with onesKen Dyck2011-01-181-4/+3
| | | | | | ASTContext::toCharUnitsFromBits() when converting from bit sizes to char units. llvm-svn: 123715
* PR3558: mark "logically const" accessor methods in ASTContext as const,Jay Foad2011-01-121-9/+12
| | | | | | | and mark the fields they use as mutable. This allows us to remove a few const_casts. llvm-svn: 123314
* Fix PR8796.Rafael Espindola2010-12-291-3/+5
| | | | | | | | 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
* Fix another unnecessary-struct-padding issue.Argyrios Kyrtzidis2010-12-091-1/+10
| | | | llvm-svn: 121352
* Before determining the effect the alignment of base struct will have in the ↵Argyrios Kyrtzidis2010-12-091-2/+9
| | | | | | | | | | 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
* Move isNearlyEmpty out into the ASTContext so it can be called from CodeGen ↵Anders Carlsson2010-11-251-28/+1
| | | | | | as well. llvm-svn: 120137
OpenPOWER on IntegriCloud