| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The vtable takes its DLL storage class from the class, not the key
function. When they disagree, the vtable won't be exported by the DLL
that defines the key function. The easiest way to ensure that importers
of the class emit their own vtable is to say that the class has no key
function.
Reviewers: hans, majnemer
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D11913
llvm-svn: 244488
|
| |
|
|
|
|
|
| |
RecordLayoutBuilder is an inaccruate name because it does not build all
records. It only builds layouts for targets using the Itanium C++ ABI.
llvm-svn: 243225
|
| |
|
|
| |
llvm-svn: 242649
|
| |
|
|
| |
llvm-svn: 240110
|
| |
|
|
|
|
|
|
| |
MSVC 2015 appears to be unable to find the correct operator== here. I
haven't yet filed a bug with Microsoft as I've been unable to create a
reduced test case.
llvm-svn: 237862
|
| |
|
|
|
|
| |
No functional change intended.
llvm-svn: 235680
|
| |
|
|
| |
llvm-svn: 233138
|
| |
|
|
|
|
|
|
|
| |
It broke test/PCH/headersearch.cpp because it was using -Wpadding, which
only works for Itanium layout. Before this commit, we would use Itanium
record layout when using PCH, which is crazy. Now that the test uses an
explicit Itanium triple, we can reland.
llvm-svn: 230525
|
| |
|
|
| |
llvm-svn: 230475
|
| |
|
|
|
|
| |
It fails on Clang::PCH/headersearch.cpp for targeting msvc.
llvm-svn: 230474
|
| |
|
|
|
|
|
|
| |
Covered by existing tests in test/CodeGen/override-layout.c and
test/CodeGenCXX/override-layout.cpp. Seriously, they found real bugs in
my code. :)
llvm-svn: 230446
|
| |
|
|
|
|
| |
requiring the macro. NFC; Clang edition.
llvm-svn: 229339
|
| |
|
|
|
|
| |
pair<iterator, bool> as per the C++ standard's associative container concept.
llvm-svn: 222335
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
We should avoid a tail padding not only if the last field
has zero size but also if the last field is a struct with a flexible array.
If/when http://reviews.llvm.org/D5478 is committed,
this will also handle the case of structs with zero-sized arrays.
Reviewers: majnemer, rsmith
Reviewed By: rsmith
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D5924
llvm-svn: 220708
|
| |
|
|
|
|
| |
Patch by Evgeny Astigeevich!
llvm-svn: 220031
|
| |
|
|
|
|
| |
No functionality change intended.
llvm-svn: 220005
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
AddressSanitizer can find intra-object-overflow bugs
Summary:
The general approach is to add extra paddings after every field
in AST/RecordLayoutBuilder.cpp, then add code to CTORs/DTORs that poisons the paddings
(CodeGen/CGClass.cpp).
Everything is done under the flag -fsanitize-address-field-padding.
The blacklist file (-fsanitize-blacklist) allows to avoid the transformation
for given classes or source files.
See also https://code.google.com/p/address-sanitizer/wiki/IntraObjectOverflow
Test Plan: run SPEC2006 and some of the Chromium tests with -fsanitize-address-field-padding
Reviewers: samsonov, rnk, rsmith
Reviewed By: rsmith
Subscribers: majnemer, cfe-commits
Differential Revision: http://reviews.llvm.org/D5687
llvm-svn: 219961
|
| |
|
|
| |
llvm-svn: 219279
|
| |
|
|
|
|
|
|
| |
Empty records do not always have size equivalent to their alignment.
They only do so when their alignment is at least as large as the minimum
empty struct size: 1 byte in C++ and 4 bytes in C.
llvm-svn: 218661
|
| |
|
|
|
|
| |
No functional change intended.
llvm-svn: 218628
|
| |
|
|
|
|
|
|
|
|
|
| |
Usually, overriding a virtual function defined in a virtual base
required emission of a vtordisp slot in the record. However no vtordisp
is needed if the overriding function is pure; it should be impossible to
observe the pure virtual method.
This fixes PR21046.
llvm-svn: 218340
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The MS ABI has a notion of 'required alignment' for fields; this
alignment supercedes pragma pack directives.
MSVC takes into account alignment attributes on typedefs when
determining whether or not a field has a certain required alignment.
Do the same in clang by tracking whether or not we saw such an attribute
when calculating the type's bitwidth and alignment.
This fixes PR20418.
Reviewers: rnk
Differential Revision: http://reviews.llvm.org/D4714
llvm-svn: 214274
|
| |
|
|
|
|
| |
Only alignment is changed, not required alignment.
llvm-svn: 213217
|
| |
|
|
|
|
|
|
|
|
| |
We would correctly insert sufficiently aligned padding between vbases
when our leading base was empty, however we would neglect to increase
the required alignment of the most derived class.
This fixes PR20315.
llvm-svn: 213123
|
| |
|
|
|
|
| |
No functionality changed, it just makes the code a little less brittle.
llvm-svn: 213122
|
| |
|
|
|
|
|
|
|
|
|
| |
No functionality changed, just some cleanups:
- Switch some loops to range-based for.
- Name some iterators with a more creative name than "I".
- Reduce dependence on auto. Does RD->bases() give you a list of
CXXBaseSpecifiers or CXXRecordDecls? It's more clear to just say which
upfront.
llvm-svn: 213121
|
| |
|
|
|
|
|
| |
the key functions table. Don't hold references to anything within that table
across such an access.
llvm-svn: 212437
|
| |
|
|
| |
llvm-svn: 208517
|
| |
|
|
| |
llvm-svn: 207994
|
| |
|
|
|
|
| |
That's exactly what TinyPtrVector was designed for. No functionality change.
llvm-svn: 207919
|
| |
|
|
|
|
|
|
|
| |
Don't consider a __declspec(align) on a bitfield's declaration if it didn't
allocate any underlying storage.
This fixes PR19414.
llvm-svn: 206132
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
llvm-svn: 206124
|
| |
|
|
|
|
| |
No functional change.
llvm-svn: 206090
|
| |
|
|
|
|
|
| |
If a vtordisp exists between two bases, then there is no need for
additional alias avoidance padding. Test case included.
llvm-svn: 206087
|
| |
|
|
|
|
|
|
|
|
| |
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.
llvm-svn: 206077
|
| |
|
|
|
|
| |
No functionality change.
llvm-svn: 206038
|
| |
|
|
|
|
|
|
| |
This patch updates the comments in RecordLayoutBuilder about record
layout in the MS-ABI. Also, I added a section about known
incompatibilities.
llvm-svn: 206010
|
| |
|
|
|
|
|
|
|
|
| |
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.
llvm-svn: 206004
|
| |
|
|
|
|
|
|
| |
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.
llvm-svn: 206000
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
llvm-svn: 205994
|
| |
|
|
|
|
|
|
|
|
| |
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.
llvm-svn: 205933
|
| |
|
|
|
|
| |
specialization would make us think it might have a key function.
llvm-svn: 204686
|
| |
|
|
|
|
|
|
|
| |
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.
llvm-svn: 204674
|
| |
|
|
|
|
| |
with iterator_range methods(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203812
|
| |
|
|
|
|
| |
with iterator_range vbases(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203808
|
| |
|
|
|
|
| |
iterator_range bases(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203803
|
| |
|
|
|
|
| |
iterator_range fields(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203355
|
| |
|
|
|
|
| |
Smith.
llvm-svn: 203262
|
| |
|
|
|
|
| |
with iterator_range chains(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203261
|
| |
|
|
| |
llvm-svn: 202639
|