| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
llvm-svn: 197513
|
| |
|
|
| |
llvm-svn: 197507
|
| |
|
|
|
|
|
|
| |
Tidy up built-in record creation to reduce code duplication.
Continuation of r197336.
llvm-svn: 197452
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
__builtin_va_list and friends have been showing up where they shouldn't for way
to long, making unwanted appearences in -ast-print, tooling and source level
visitors and even the hello world tutorial on the clang website.
This commit factors down the implicit typedef and record creation facilities to
ensure they're marked implicit.
Also fixes a unit test that was testing incorrect behaviour, and removes old
hacks in the DeclPrinter that tried to skip implicit declarations manually.
llvm-svn: 197336
|
| |
|
|
|
|
| |
class templates (a Microsoft extension).
llvm-svn: 197298
|
| |
|
|
| |
llvm-svn: 197274
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There's nothing special about type traits accepting two arguments.
This commit eliminates BinaryTypeTraitExpr and switches all related handling
over to TypeTraitExpr.
Also fixes a CodeGen failure with variadic type traits appearing in a
non-constant expression.
The BTT/TT prefix and evaluation code is retained as-is for now but will soon
be further cleaned up.
This is part of the ongoing work to unify type traits.
llvm-svn: 197273
|
| |
|
|
|
|
| |
No functional change, just a tidying up.
llvm-svn: 197196
|
| |
|
|
|
|
|
|
| |
The old URL hasn't worked for quite some time. While we are here, also
change the link so that it will send us straight to the mangling portion
of the ABI doc.
llvm-svn: 197195
|
| |
|
|
|
|
|
| |
We will need to do some work here if we want to play nice with MSVC2013.
Add a TODO indicating what changed and why this matters.
llvm-svn: 197193
|
| |
|
|
|
|
|
|
|
| |
This reverts commit r197184.
Richard Smith brings up some good points, a proper implementation will
require us to mangle unnameable entities compatibly with MSVC.
llvm-svn: 197192
|
| |
|
|
|
|
|
| |
They are mangled the same as normal references, nothing special is going
on here.
llvm-svn: 197184
|
| |
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Type trait parsing is all over the place at the moment with unary, binary and
n-ary C++11 type traits that were developed independently at different points
in clang's history.
There's no good reason to handle them separately -- there are three parsers,
three AST nodes and lots of duplicated handling code with slightly different
implementations and diags for each kind.
This commit unifies parsing of type traits and sets the stage for further
consolidation.
No change in behaviour other than more consistent error recovery.
llvm-svn: 197179
|
| |
|
|
|
|
|
| |
GCC 4.7 changed the MingW ABI. On the clang side this means that methods now
have the thiscall calling convention by default.
llvm-svn: 197164
|
| |
|
|
|
|
|
|
|
| |
declarations that might lifetime-extend multiple temporaries. In passing, fix a
crasher (PR18217) if an initializer was dependent and exactly the wrong shape,
and remove a bogus function (Expr::findMaterializedTemporary) now its last use
is gone.
llvm-svn: 197103
|
| |
|
|
|
|
|
|
|
| |
printer.
The change isn't completely comprehensive. This can be filled in
lazily as needed. There is one consumer right now.
llvm-svn: 197093
|
| |
|
|
|
|
|
| |
After r196549 there is no need to separate FinalizeCXXLayout and
FinalizeLayout so they were merged and FinalizeCXXLayout was eliminated.
llvm-svn: 197083
|
| |
|
|
|
|
|
|
|
|
| |
With the introduction of explicit address space casts into LLVM, there's
a need to provide a new cast kind the front-end can create for C/OpenCL/CUDA
and code to produce address space casts from those kinds when appropriate.
Patch by Michele Scandale!
llvm-svn: 197036
|
| |
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
'objc_protocol_requires_explicit_implementation'.
That's a mouthful, and not necessarily the final name. This also
reflects a semantic change where this attribute is now on the
protocol itself instead of a class. This attribute will require
that a protocol, when adopted by a class, is explicitly implemented
by the class itself (instead of walking the super class chain).
Note that this attribute is not "done". This should be considered
a WIP.
llvm-svn: 196955
|
| |
|
|
|
|
|
|
| |
instead of lookupMethod().
lookupMethod also goes through categories, which we don't need there.
llvm-svn: 196942
|
| |
|
|
|
|
|
|
|
| |
more than one such initializer in a union, make mem-initializers override
default initializers for other union members, handle anonymous unions with
anonymous struct members better. Fix a couple of semi-related bugs exposed by
the tests for same.
llvm-svn: 196892
|
| |
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Testing has revealed that large integral constants (i.e. > INT64_MAX)
are always mangled as-if they are negative, even in places where it
would not make sense for them to be negative (like non-type template
parameters of type unsigned long long).
To address this, we change the way we model number mangling: always
mangle as-if our number is an int64_t. This should result in correct
results when we have large unsigned numbers.
N.B. Bizarrely, things that are 32-bit displacements like vbptr offsets
are mangled as-if they are unsigned 32-bit numbers. This is a pretty
egregious waste of space, it would be a 4x savings if we could mangle it
like a signed 32-bit number. Instead, we explicitly cast these
displacements to uint32_t and let the mangler proceed.
llvm-svn: 196771
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
While testing our ability to mangle large constants (PR18175), I
incidentally discovered that we did not properly mangle enums correctly.
Previously, we would append the width of the enum in bytes after the
type-tag differentiator.
This would mean "enum : short" would be mangled as 'W2' while "enum :
char" would be mangled as 'W1'. Upon testing this with several versions
of MSVC, I found that this did not match their behavior: they always use
'W4'.
N.B. Quick testing uncovered that undname allows different numbers to
follow the 'W' in the following way:
'W0' -> "enum char"
'W1' -> "enum unsigned char"
'W2' -> "enum short"
'W3' -> "enum unsigned short"
'W4' -> "enum"
'W5' -> "enum unsigned int"
'W6' -> "enum long"
'W7' -> "enum unsigned long"
However this scheme appears abandoned, I cannot get MSVC to trigger it.
Furthermore, it's incomplete: it doesn't handle "bool" or "long long".
llvm-svn: 196752
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Clang outputs LLVM one top level decl at a time. This combined with the
visibility computation code looking for the newest NamespaceDecl would cause
it to produce different results for nested namespaces.
The two options for producing consistent results are
* Delay codegen of anything inside a namespace until the end of the file.
* Don't look for the newest NamespaceDecl.
This patch implements the second option.
This matches the gcc behavior too.
llvm-svn: 196712
|
| |
|
|
|
|
| |
assert(sanity()) reads so much better than preprocessor conditional blocks.
llvm-svn: 196657
|
| |
|
|
|
|
| |
Code in headers shouldn't be conditional on the build configuration.
llvm-svn: 196656
|
| |
|
|
|
|
| |
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
|
| |
|
|
| |
llvm-svn: 196587
|
| |
|
|
|
|
| |
of whether the initializer list is dependent.
llvm-svn: 196558
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
__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
|
| |
|
|
|
|
|
|
|
|
|
| |
introduces at least one new initializer,
don't assume that it inherits the designated initializers from the super class.
If the assumption was wrong because a new initializer was a designated one that was not marked as such,
we will emit misleading warnings for subclasses of the interface.
llvm-svn: 196476
|
| |
|
|
|
|
|
| |
This patch tries to avoid unrelated changes other than fixing a few
hyphen-related ambiguities in nearby lines.
llvm-svn: 196466
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
In general, this type node can be used to represent any type adjustment
that occurs implicitly without losing type sugar. The immediate use of
this is to adjust the calling conventions of member function pointer
types without breaking template instantiation.
Fixes PR17996.
Reviewers: rsmith
Differential Revision: http://llvm-reviews.chandlerc.com/D2332
llvm-svn: 196451
|
| |
|
|
|
|
|
|
|
|
|
| |
super another initializer and when the implementation does not delegate to
another initializer via a call on 'self'.
A secondary initializer is an initializer method not marked as a designated
initializer within a class that has at least one initializer marked as a
designated initializer.
llvm-svn: 196318
|
| |
|
|
|
|
|
|
| |
calls on
super an initializer that is not a designated one or any initializer on self.
llvm-svn: 196317
|
| |
|
|
|
|
|
|
| |
does not chain to
an init method that is a designated initializer for the superclass.
llvm-svn: 196316
|
| |
|
|
|
|
|
|
|
|
| |
designated initializers of an interface.
If the interface declaration does not have methods marked as designated
initializers then the interface inherits the designated initializers of
its super class.
llvm-svn: 196315
|
| |
|
|
|
|
|
|
| |
token.
This would crash if the token is used in another diagnostic. PR18051.
llvm-svn: 196048
|
| |
|
|
|
|
| |
On a Release build this takes the testcase in pr18055 from 0m3.892s to 0m1.452s.
llvm-svn: 195768
|
| |
|
|
| |
llvm-svn: 195767
|
| |
|
|
| |
llvm-svn: 195714
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It wasn't possible for an anonymous type to show up inside of function arguments.
However, decltype (which MSVC added support for in 2010) makes this
possible. Further, backrefs to these anonymous types can now be formed.
This fixes PR18022.
N.B. We do not, and very likely _will not_, support MSVC's bug where
subsequent typedefs of anonymous types leak into the linkage name; this
is a gross violation of the ABI. A warning should be introduced to
inform our users of this particular shortcoming.
llvm-svn: 195669
|
| |
|
|
|
|
| |
whether a defaulted special member function should be deleted.
llvm-svn: 195620
|
| |
|
|
| |
llvm-svn: 195561
|