| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
llvm-svn: 197507
|
| |
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
| |
After r196549 there is no need to separate FinalizeCXXLayout and
FinalizeLayout so they were merged and FinalizeCXXLayout was eliminated.
llvm-svn: 197083
|
| |
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
| |
Also includes a minor refactor with no functional change.
llvm-svn: 196627
|
| |
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
__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
|
| |
|
|
| |
llvm-svn: 196510
|
| |
|
|
|
|
|
| |
This patch tries to avoid unrelated changes other than fixing a few
hyphen-related ambiguities in nearby lines.
llvm-svn: 196466
|
| |
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
| |
improving comments to make documentation more accurate.
Differential Revision:http://llvm-reviews.chandlerc.com/D2172
llvm-svn: 194609
|
| |
|
|
|
|
| |
Reviewed at http://llvm-reviews.chandlerc.com/D2120
llvm-svn: 194256
|
| |
|
|
|
|
|
|
|
|
| |
bitfield
This patch adds the same behavior to clang.
Differential Revision: http://llvm-reviews.chandlerc.com/D2103
llvm-svn: 194115
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
| |
llvm-svn: 193395
|
| |
|
|
| |
llvm-svn: 193313
|
| |
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
| |
Every other function in Redeclarable.h was using Decl instead of Declaration.
llvm-svn: 192900
|
| |
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
| |
We're not ready to use it everywhere we use a win32 triple yet.
llvm-svn: 192502
|
| |
|
|
| |
llvm-svn: 192495
|
| |
|
|
| |
llvm-svn: 192494
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
these in eagerly if we're not actually processing a translation unit. The added
laziness here also avoids us loading in parts of a CXXRecordDecl earlier than an
upcoming class template specialization merging patch would like.
Ideally, we should mark the vtable as used when we see a definition for the key
function, rather than having a separate pass over dynamic classes at the end of
the TU. The existing approach is pretty bad for PCH/modules, since it forcibly
loads the declarations of all key functions in all imported modules, whether or
not those key functions are defined.
llvm-svn: 189627
|
| |
|
|
|
|
|
|
|
| |
The record layout code didn't properly take into account that
an empty class at offset 0 can have an alignment greater than 1.
Patch by Andrea Di Biagio.
llvm-svn: 186370
|
| |
|
|
|
|
|
| |
Guarded malloc emits some messages at the beginning in stderr when enabled.
These messages caused a few tests to fail.
llvm-svn: 186219
|
| |
|
|
| |
llvm-svn: 185042
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The old implementation of ms_struct in RecordLayoutBuilder was a
complete mess: it depended on complicated conditionals which didn't
really reflect the underlying logic, and placed a burden on users of
the resulting RecordLayout. This commit rips out almost all of the
old code, and replaces it with simple checks in
RecordLayoutBuilder::LayoutBitField.
This commit also fixes <rdar://problem/14252115>, a bug where class
inheritance would cause us to lay out bitfields incorrectly.
llvm-svn: 185018
|
| |
|
|
|
|
|
|
|
|
|
| |
When the decl that we're getting alignment for is a FieldDecl, and the field's
parent record is invalid, skip the actual field alignment calculation (and
return 1-byte alignment in the general case).
Also, assert in in getASTRecordLayout that the decl is valid. This was
inspired by PR16292; see also r184581 and r184751.
llvm-svn: 184883
|
| |
|
|
|
|
|
|
|
|
|
| |
MSVC's class data is always comdat, so clang's should always be
linkonce_odr in LLVM IR.
Reviewers: pcc
Differential Revision: http://llvm-reviews.chandlerc.com/D838
llvm-svn: 182865
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Most of the complexity of this patch is figuring out which types get the
qualifier and which don't. If we implement __ptr32/64, then we should
check the qualifier instead of assuming all pointers are 64-bit.
This fixes PR13792.
Patch by Warren Hunt!
llvm-svn: 181825
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This patch renames getLinkage to getLinkageInternal. Only code that
needs to handle UniqueExternalLinkage specially should call this.
Linkage, as defined in the c++ standard, is provided by
getFormalLinkage. It maps UniqueExternalLinkage to ExternalLinkage.
Most places in the compiler actually want isExternallyVisible, which
handles UniqueExternalLinkage as internal.
llvm-svn: 181677
|
| |
|
|
|
|
|
| |
For fun, I added a comedy "actually obey the C++11 POD rules" option
which nobody is allowed to use.
llvm-svn: 173744
|
| |
|
|
|
|
|
|
| |
never key functions. We did not implement that rule for the
iOS ABI, which was driven by what was implemented in gcc-4.2.
However, implement it now for other ARM-based platforms.
llvm-svn: 173515
|
| |
|
|
| |
llvm-svn: 173514
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
following:
sizeof=132, dsize=132, align=4
nvsize=132, nvalign=4
Is not indented, so when classes are nested there is no way to know to
which class it belongs.
Fix this problem by indenting the size summary properly for each class.
llvm-svn: 169654
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
uncovered.
This required manually correcting all of the incorrect main-module
headers I could find, and running the new llvm/utils/sort_includes.py
script over the files.
I also manually added quite a few missing headers that were uncovered by
shuffling the order or moving headers up to be main-module-headers.
llvm-svn: 169237
|
| |
|
|
|
|
|
|
|
|
|
| |
doesn't include padding up to the alignment of the record, take this
as a cue that the alignment of the record should (conservatively) be
set to 1. This is similar to other the other cues we use to determine
that the record has a lower alignment, e.g., that the
externally-supplied layout places fields at lower offsets than we
would. Fixes <rdar://problem/12582052>; test case in LLDB.
llvm-svn: 166824
|
| |
|
|
|
|
| |
Patch by Jeremiah Zanin.
llvm-svn: 165849
|
| |
|
|
| |
llvm-svn: 163983
|
| |
|
|
| |
llvm-svn: 163325
|
| |
|
|
|
|
| |
While there fix a dead assert.
llvm-svn: 163031
|
| |
|
|
|
|
| |
instead of aliasing to "struct" which had some incorrect behaviour. Patch by David Robins.
llvm-svn: 163013
|
| |
|
|
| |
llvm-svn: 161243
|
| |
|
|
|
|
|
|
|
|
|
| |
By C++ standard, the vtable should be generated if the first non-inline
virtual function is defined in the TU. Current version of clang doesn't
generate vtable if the first virtual function is defaulted, because the
key function is regarded as the defaulted function.
Patch by Li Kan!
llvm-svn: 161236
|
| |
|
|
|
|
|
|
| |
instead.
No functionality change.
llvm-svn: 159719
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
value_type
In addition, I've made the pointer and reference typedef 'void' rather than T*
just so they can't get misused. I would've omitted them entirely but
std::distance likes them to be there even if it doesn't use them.
This rolls back r155808 and r155869.
Review by Doug Gregor incorporating feedback from Chandler Carruth.
llvm-svn: 158104
|
| |
|
|
|
|
|
| |
working knowledge of the Microsoft ABI. Based on a patch by
Dmitry Sokolov.
llvm-svn: 155905
|