summaryrefslogtreecommitdiffstats
path: root/clang/test/Layout
Commit message (Collapse)AuthorAgeFilesLines
...
* [ms-abi] Change the way alignment is trackedWarren Hunt2014-01-111-2/+34
| | | | | | | | | | | | This patch more cleanly seperates the concepts of Preferred Alignment and Required Alignment. Most notable that changes to Required Alignment do *not* impact preferred alignment until late in struct layout. This is observable when using pragma pack and non-virtual bases and the use of tail padding when laying them out. Test cases included. llvm-svn: 198988
* [ms-abi] Adjusting Rules for Padding Between BasesWarren Hunt2014-01-101-7/+69
| | | | | | | | | | | The presence of a VBPtr suppresses the presence of zero sized sub-objects in the non-virtual portion of the object in the context of determining if two base objects need alias-avoidance padding placed between them. Test cases included. llvm-svn: 198975
* [ms-abi] Handle __declspec(align) on bitfields "properly"Warren Hunt2014-01-101-1/+116
| | | | | | | | | | __declspec(align), when applied to bitfields affects their perferred alignment instead of their required alignment. We don't know why. Also, #pragma pack(n) turns packing *off* if n is greater than the pointer size. This is now observable because of the impact of declspec(align) on bitfields. llvm-svn: 198907
* [ms-abi] Refactor Microsoft Record LayoutWarren Hunt2014-01-0915-2632/+2849
| | | | | | | | | This patch refactors microsoft record layout to be more "natural". The most dominant change is that vbptrs and vfptrs are injected after the fact. This simplifies the implementation and the math for the offest for the first base/field after the vbptr. llvm-svn: 198818
* [ms-abi] unix-line endings in lit test, no functional changeWarren Hunt2013-12-261-18/+18
| | | | llvm-svn: 198060
* [ms-abi] Fixes improperly sized vfptrs with pragma packWarren Hunt2013-12-261-1/+35
| | | | | | | | With pragma pack, the layout engine would produce vfptrs that were packed width rather than pointer width. This patch addresses the issue and adds a test case. llvm-svn: 198059
* [ms-abi] Update Alignment for VtorDispsWarren Hunt2013-12-191-1/+39
| | | | | | | | The alignment impact of the virtual bases apperas to be applied in order, rather than up front. This patch adds the new behavior and provides a test case. llvm-svn: 197639
* [ms-abi] Refactoring Non-virtual base layout in record layoutWarren Hunt2013-12-122-531/+572
| | | | | | | | | This refactor addresses bugzilla bug 18167 and simplifies the code at the same time. Also I add a test case for the bug. Also I make a non-functional change to the basic layout lit tests to make them more reliable (using CHECK-NEXT instead of CHECK). llvm-svn: 197183
* [ms-abi] Makes Virtual Base Alignment Look at All Virtual BasesWarren Hunt2013-12-111-1/+26
| | | | | | | | Prior to this patch, the alignment imposed by virtual bases only included direct virtual bases. This patch fixes it to look at all virtual bases. llvm-svn: 196997
* [ms-abi] 64-bit fixes for r196549Warren Hunt2013-12-102-4/+30
| | | | | | | | In order to address latent bugs that were easier to expose in 64-bit mode, we move the application of __declspec(align) to before the layout of vbases rather than after. llvm-svn: 196861
* [MS-ABI] adds padding before all vbases after a bitfieldWarren Hunt2013-12-061-60/+92
| | | | | | | | | | MS-ABI adds padding before *every* vbase if the last field in a record is a bit-field. This changes clangs behavior to match. I also fix some windows-style line endings in the test file. Differential Revision: http://llvm-reviews.chandlerc.com/D2277 llvm-svn: 196605
* [MS-ABI] Fix alias-avoidance padding between basesWarren Hunt2013-12-061-0/+178
| | | | | | | | | | | Adds padding between bases or virtual bases in an attempt to avoid aliasing of zero-sized sub-objects. The approach used by the ABI adds two more bits of state. Detailed comments are in the code. Test cases included. Differential Revision: http://llvm-reviews.chandlerc.com/D2258 llvm-svn: 196602
* Support MS-ABI's concept of "Required Alignment" imposed by Warren Hunt2013-12-061-0/+120
| | | | | | | | | | | | | | | | | | __declspec(align()) This patch implements required alignment in a way that makes __declspec(align()) and #pragma pack play correctly together. In the MS-ABI, __declspec(align()) is a hard rule and cannot be overridden by #pragma pack. This cases each record to have two interesting alignments "preferred alignment" (which matches Itanium's concept of alignment) and "required alignment" which is an alignment that must never be violated, even in the case of #pragma pack. This patch introduces the concept of Required Alignment to the record builder and tracks/uses it appropriately. Test cases are included. Differential Revision: http://llvm-reviews.chandlerc.com/D2283 llvm-svn: 196549
* Microsoft Record Layout: zero sized base after base with vbtbl fixWarren Hunt2013-11-191-0/+216
| | | | | | | | | | Microsoft adds an extra byte of padding before laying out zero sized non-virtual bases if the non-virtual base before it contains a vbptr. This patch adds the same behavior to clang. Differential Revision: http://llvm-reviews.chandlerc.com/D2106 llvm-svn: 195158
* Makes A Microsoft Layout CodeGen Test ExplicitWarren Hunt2013-11-141-1/+1
| | | | | | | | | | This patch tests introduces a proper codegen test in place of the "codegen no longer crashes" test introduced in r193664. The test is also moved from layout to CodeGenCXX. Differential Revision: http://llvm-reviews.chandlerc.com/D2174 llvm-svn: 194739
* Microsoft adds weird padding before virtual bases if the last field was a ↵Warren Hunt2013-11-061-0/+84
| | | | | | | | | | bitfield This patch adds the same behavior to clang. Differential Revision: http://llvm-reviews.chandlerc.com/D2103 llvm-svn: 194115
* Improves compatibility with cl.exe when laying out array fieldsWarren Hunt2013-11-011-0/+23
| | | | | | | | | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D2090 Clang was "improperly" over-aligning arrays with sizes are not a multiple of their alignment. This behavior was removed in microsoft 32 bit mode. In addition, after examination of ASTContext::getTypeInfoImpl, a redundant code block in MicrosoftRecordLayoutBuilder::getAdjustedFieldInfo was deleted. llvm-svn: 193898
* Activating latent test case for r193661.Warren Hunt2013-10-301-3/+3
| | | | llvm-svn: 193664
* Implements 64 bit microsoft record layout and adds lit tests to cover Warren Hunt2013-10-2310-66/+1466
| | | | | | | | | it. Also removes all of the microsoft C++ ABI related code from the itanium layout builder. Differential Revision: http://llvm-reviews.chandlerc.com/D2003 llvm-svn: 193290
* PR17576: Fix assertion on polymorphic classes with small alignmentReid Kleckner2013-10-141-2/+12
| | | | | | | | We have to reserve at least the width of a pointer for the vfptr. For classes with small alignment, we weren't reserving enough space, and were overlapping the first field with the vfptr. llvm-svn: 192626
* Fixing stdout/stderr interleaving in lit test.Warren Hunt2013-10-141-1/+1
| | | | llvm-svn: 192625
* Correctly check for distructors when realizing vtordispsWarren Hunt2013-10-141-1/+18
| | | | | | | | | | This patch fixes the distructor test when checking for vtordisp requirements in microsoft record layout. A test case is also included. Addresses: http://llvm.org/bugs/show_bug.cgi?id=16406#c7 llvm-svn: 192616
* Lit tests for Microsoft C++ record layout.Warren Hunt2013-10-1410-0/+2589
They weren't added with the rest of the microsoft record layout patch due me not doing svn add. llvm-svn: 192612
OpenPOWER on IntegriCloud