summaryrefslogtreecommitdiff
path: root/test/Layout
Commit message (Collapse)AuthorAge
* Fix warning in ms-x86-vtordisp test caseReid Kleckner2014-04-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206224 91177308-0d34-0410-b5e6-96231b3b80d8
* MS ABI: #pragma vtordisp(0) only disables new vtordispsDavid Majnemer2014-04-13
| | | | | | | | | | | Previously, it was believed that #pragma vtordisp(0) would prohibit the generation of any and all vtordisps. In actuality, it only disables the generation of additional vtordisps. This fixes PR19413. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206124 91177308-0d34-0410-b5e6-96231b3b80d8
* [MS-ABI] Fixed alias-avoidance padding in the presence of vtordispsWarren Hunt2014-04-11
| | | | | | | | If a vtordisp exists between two bases, then there is no need for additional alias avoidance padding. Test case included. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206087 91177308-0d34-0410-b5e6-96231b3b80d8
* [MS-ABI] Update to vtordisp computationWarren Hunt2014-04-11
| | | | | | | | | | | A portion of the vtordisp computation that was previously unguarded by a test for the declaration of user defined constructors/destructors was erroniously adding vtordisps to things that shouldn't have them. This patch correctly guards that codepath. In addition, it updates the comments to make them more clear. Test case is included. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206077 91177308-0d34-0410-b5e6-96231b3b80d8
* [MS-ABI] Update virtual base padding rules to match MSVC 10+Warren Hunt2014-04-11
| | | | | | | | | | | | In version 9 (VS2010) (and prior)? versions of msvc, if the last field in a record was a bitfield padding equal to the size of the storage class of that bitfield was added before each vbase and vtordisp. This patch removes that feature from clang and updates the lit tests to reflect it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206004 91177308-0d34-0410-b5e6-96231b3b80d8
* [MS-ABI] Fix to vbptr injection site calculation.Warren Hunt2014-04-10
| | | | | | | | | | The vbptr is injected after the last non-virtual base lexographically rather than the last non-virtual base in layout order. Test case included. Also, some line ending fixes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206000 91177308-0d34-0410-b5e6-96231b3b80d8
* [MS-ABI] Fixed __declspec(align()) on bitfields under #pragma pack.Warren Hunt2014-04-10
| | | | | | | | | | | | | | | | When __declspec(align()) is applied to a bitfield it affects the alignment rather than the required alignment of the struct. The major feature that this patch adds is that the alignment of the structure obeys the alignment of __declspec(align()) from the bitfield over the value specified in pragma pack. Test cases are included. The patch also includes some small cleanups in recordlayoutbuilder and some cleanups to some lit tests, including line endings (but no functionality change to lit tests) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205994 91177308-0d34-0410-b5e6-96231b3b80d8
* [MS-ABI] Update to alias-avoidance paddingWarren Hunt2014-04-09
| | | | | | | | | | | This patch changes how we determine if padding is needed between two bases in msvc compatibility mode. Test cases included. In addition, a very minor change to the printing of structures to ease lit testing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205933 91177308-0d34-0410-b5e6-96231b3b80d8
* Render anonymous entities as '(anonymous <thing>)' (and lambdas as '(lambda ↵David Blaikie2014-04-02
| | | | | | | | | | | | at ... )') For namespaces, this is consistent with mangling and GCC's debug info behavior. For structs, GCC uses <anonymous struct> but we prefer consistency between all anonymous entities but don't want to confuse them with template arguments, etc, so we'll just go with parens in all cases. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205398 91177308-0d34-0410-b5e6-96231b3b80d8
* [MS-ABI] Drop Special Layout in 64-bit mode.Warren Hunt2014-03-24
| | | | | | | | | | | As of cl.exe version 18, the special layout rules for structs with alignment 16 or greater has been dropped. This patch drops the behavior from clang. This patch also updates the lit tests to reflect the change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204674 91177308-0d34-0410-b5e6-96231b3b80d8
* -fdump-record-layouts: Sort nvbases by offset before printing themReid Kleckner2014-02-28
| | | | | | It makes our -fdump-record-layouts a little more sane. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202457 91177308-0d34-0410-b5e6-96231b3b80d8
* MS ABI: Just use getTypeInfoInChars to get the field sizeReid Kleckner2014-02-25
| | | | | | | | | | | | This was changed to use manual desugaring and multiplication in r201832 and fixed for multi-dimensional arrays in r201917. However, it breaks down in the presence of typedefs. Rather than attempting to handle all the desugaring, just go back to calling the generic type info code. This was discovered while compiling SIInstrWaits.cpp in the R600 backend. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202175 91177308-0d34-0410-b5e6-96231b3b80d8
* [MS-ABI] Fix MSRecordLayout to handel MultiDimensionalArraysWarren Hunt2014-02-22
| | | | | | | | | | A recent change caused multi-dimensional arrays not to be handled correctly, this patch fixes that. Also, it adds a lit test for multi-dimensional arrays. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201917 91177308-0d34-0410-b5e6-96231b3b80d8
* [MS-ABI] Update to zero-sized padding algorithmWarren Hunt2014-02-21
| | | | | | | | | | | | Slight change to the way zero-sized sub-objects are tracked in the presence of virtual bases. In addition we correctly distinguish between dsize and nvsize. addresses http://llvm.org/bugs/show_bug.cgi?id=18826 Unit tests are included. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201832 91177308-0d34-0410-b5e6-96231b3b80d8
* MS ABI: Fix some layout testsDavid Majnemer2014-02-15
| | | | | | | | | Some lines intended to be used for testing x86_64 ABI compatibility were not firing because lines were annotated with the wrong FileCheck prefix: X64 vs 64 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201454 91177308-0d34-0410-b5e6-96231b3b80d8
* MS ABI: Fix some layout testsDavid Majnemer2014-02-15
| | | | | | | | | Some lines intended to be used for testing x86_64 ABI compatibility were not firing because lines were annotated with the wrong FileCheck prefix: X64 vs C64 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201453 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix some -Wdocumentation warnings in Sema.h and try to fix test for win64Reid Kleckner2014-02-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201278 91177308-0d34-0410-b5e6-96231b3b80d8
* MS ABI: Implement #pragma vtordisp() and clang-cl /vdNReid Kleckner2014-02-12
| | | | | | | | | | | | | | | | | These features are new in VS 2013 and are necessary in order to layout std::ostream correctly. Currently we have an ABI incompatibility when self-hosting with the 2013 stdlib in our convertible_fwd_ostream wrapper in gtest. This change adds another implicit attribute, MSVtorDispAttr, because implicit attributes are currently the best way to make sure the information stays on class templates through instantiation. Reviewers: majnemer Differential Revision: http://llvm-reviews.chandlerc.com/D2746 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201274 91177308-0d34-0410-b5e6-96231b3b80d8
* MS ABI: vptr injection should obey alignment requirementsDavid Majnemer2014-02-12
| | | | | | | | | | | | | | vptr injection must inject padding equivalent to the alignment of the most aligned non-virtual subobject, not the alignment of the enclosing record. To fascilitate this change, don't let record layout observe the alignment of the record until we've injected our vptrs. Also, do not allow the alignment of vbases to affect required alignment until just before we insert the vtordisp field. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201199 91177308-0d34-0410-b5e6-96231b3b80d8
* MS ABI: Fix some layout testsDavid Majnemer2014-02-03
| | | | | | | | | | | | | Some lines intended to be used for testing x86_64 ABI compatibility were not firing because lines were annotated with the wrong FileCheck prefix: X64 vs x64 N.B. Changes beyond just changing x64 to X64 were made, presumably because other parts of the layout engine have changed. I've verified the changes to make sure that MSVC creates a compatible layout. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200670 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-cxxabi] Raise aggregate memptr alignment to 8 for x86_32Reid Kleckner2014-01-31
| | | | | | | | | | | | | | | | With this change, we give different results for __alignof than MSVC, but our record layout is compatible. Some data member pointers also now have a size that is not a multiple of their alignment. Fixes PR18618. Reviewers: majnemer Differential Revision: http://llvm-reviews.chandlerc.com/D2669 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200585 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the -cxx-abi command-line flag.Hans Wennborg2014-01-14
| | | | | | | | | | | | | | | This makes the C++ ABI depend entirely on the target: MS ABI for -win32 triples, Itanium otherwise. It's no longer possible to do weird combinations. To be able to run a test with a specific ABI without constraining it to a specific triple, new substitutions are added to lit: %itanium_abi_triple and %ms_abi_triple can be used to get the current target triple adjusted to the desired ABI. For example, if the test suite is running with the i686-pc-win32 target, %itanium_abi_triple will expand to i686-pc-mingw32. Differential Revision: http://llvm-reviews.chandlerc.com/D2545 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199250 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-abi] Small Change to pack+alignment interaction.Warren Hunt2014-01-14
| | | | | | | | | | | This patch makes a small behavioral change to the interaction between pack and alignment. Specifically it makes __declspec(align()) on a field change that field's alignment without respect to pack but the alignment change to the record alignment as a whole still obeys pack. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199172 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-abi] Reordering __declspec(align) pragma pack handlingWarren Hunt2014-01-13
| | | | | | | | | This patch moves the check for pragma pack until after the application of __declspec align to before pragma pack. This causes observable changes in the use of tail padding for bases. A test case is included. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199154 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-abi] Leading VFPtrs don't suppress the leading zero sized flagWarren Hunt2014-01-13
| | | | | | | | | | | | The MS-ABI tracks a bit that asserts that the first sub-object is zero sized. This bit is used to add padding between objects if there's the potential for zero sized objects to alias. The bit is still true even if the zero sized base is lead by a VFPtr. This patch makes clang mimic that behavior. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199132 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-abi] Quick fix layout of an array of recordsReid Kleckner2014-01-13
| | | | | | | This fixes llvm::SmallVector, which fixes lots of TUs in the MS ABI self host. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199129 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-abi] Change the way alignment is trackedWarren Hunt2014-01-11
| | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198988 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-abi] Adjusting Rules for Padding Between BasesWarren Hunt2014-01-10
| | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198975 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-abi] Handle __declspec(align) on bitfields "properly"Warren Hunt2014-01-10
| | | | | | | | | | | | __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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198907 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-abi] Refactor Microsoft Record LayoutWarren Hunt2014-01-09
| | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198818 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-abi] unix-line endings in lit test, no functional changeWarren Hunt2013-12-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198060 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-abi] Fixes improperly sized vfptrs with pragma packWarren Hunt2013-12-26
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198059 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-abi] Update Alignment for VtorDispsWarren Hunt2013-12-19
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197639 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-abi] Refactoring Non-virtual base layout in record layoutWarren Hunt2013-12-12
| | | | | | | | | | | 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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197183 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-abi] Makes Virtual Base Alignment Look at All Virtual BasesWarren Hunt2013-12-11
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196997 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-abi] 64-bit fixes for r196549Warren Hunt2013-12-10
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196861 91177308-0d34-0410-b5e6-96231b3b80d8
* [MS-ABI] adds padding before all vbases after a bitfieldWarren Hunt2013-12-06
| | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196605 91177308-0d34-0410-b5e6-96231b3b80d8
* [MS-ABI] Fix alias-avoidance padding between basesWarren Hunt2013-12-06
| | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196602 91177308-0d34-0410-b5e6-96231b3b80d8
* Support MS-ABI's concept of "Required Alignment" imposed by Warren Hunt2013-12-06
| | | | | | | | | | | | | | | | | | | | __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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196549 91177308-0d34-0410-b5e6-96231b3b80d8
* Microsoft Record Layout: zero sized base after base with vbtbl fixWarren Hunt2013-11-19
| | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195158 91177308-0d34-0410-b5e6-96231b3b80d8
* Makes A Microsoft Layout CodeGen Test ExplicitWarren Hunt2013-11-14
| | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194739 91177308-0d34-0410-b5e6-96231b3b80d8
* Microsoft adds weird padding before virtual bases if the last field was a ↵Warren Hunt2013-11-06
| | | | | | | | | | | | bitfield This patch adds the same behavior to clang. Differential Revision: http://llvm-reviews.chandlerc.com/D2103 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194115 91177308-0d34-0410-b5e6-96231b3b80d8
* Improves compatibility with cl.exe when laying out array fieldsWarren Hunt2013-11-01
| | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193898 91177308-0d34-0410-b5e6-96231b3b80d8
* Activating latent test case for r193661.Warren Hunt2013-10-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193664 91177308-0d34-0410-b5e6-96231b3b80d8
* Implements 64 bit microsoft record layout and adds lit tests to cover Warren Hunt2013-10-23
| | | | | | | | | | | it. Also removes all of the microsoft C++ ABI related code from the itanium layout builder. Differential Revision: http://llvm-reviews.chandlerc.com/D2003 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193290 91177308-0d34-0410-b5e6-96231b3b80d8
* PR17576: Fix assertion on polymorphic classes with small alignmentReid Kleckner2013-10-14
| | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192626 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixing stdout/stderr interleaving in lit test.Warren Hunt2013-10-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192625 91177308-0d34-0410-b5e6-96231b3b80d8
* Correctly check for distructors when realizing vtordispsWarren Hunt2013-10-14
| | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192616 91177308-0d34-0410-b5e6-96231b3b80d8
* Lit tests for Microsoft C++ record layout.Warren Hunt2013-10-14
They weren't added with the rest of the microsoft record layout patch due me not doing svn add. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192612 91177308-0d34-0410-b5e6-96231b3b80d8