Douglas Gregor
7372248a98
When checking a call to a builtin atomic operation, be sure to
...
consider the _<width> variants as well, which we'll see if we're
performing the type checking in a template instantiation where the
call expression itself was originally not type-dependent. Fixes
PR11411.
llvm-svn: 145248
2011-11-28 16:30:08 +00:00
Peter Collingbourne
fbef4c8657
In Sema::MaybeBindToTemporary, create a CXXBindTemporaryExpr for an
...
array of objects with non-trivial destructors. PR11365.
llvm-svn: 145203
2011-11-27 22:09:28 +00:00
Rafael Espindola
32d8a275b9
Add inreg attributes to reference arguments.
...
llvm-svn: 145189
2011-11-27 18:35:39 +00:00
Sebastian Redl
29526f09ce
Reference initialization with initializer lists.
...
This supports single-element initializer lists for references according to DR1288, as well as creating temporaries and binding to them for other initializer lists.
llvm-svn: 145186
2011-11-27 16:50:07 +00:00
Richard Smith
514f7e9cb9
Don't check alignment, it's irrelevant to this test.
...
llvm-svn: 145093
2011-11-23 02:12:00 +00:00
Richard Smith
2d988f0f05
Use static storage duration for file-scope compound literals, even when they
...
appear in non-constant initializers in C++.
llvm-svn: 145087
2011-11-22 22:48:32 +00:00
Eli Friedman
ee94534662
Simplify code for returning a struct for Darwin x86-32 ABI. Use a better type for a function returning a struct containing only a pointer. Handle the edge case of a struct containing only a float or double plus some dead padding instead of asserting.
...
llvm-svn: 144960
2011-11-18 01:25:50 +00:00
Richard Smith
027bf11eb3
Constant expression evaluation: add support for evaluation of member pointers
...
and base-to-derived casts, and add proper handling of temporaries.
llvm-svn: 144926
2011-11-17 22:56:20 +00:00
Eli Friedman
aa9512c484
Fix test on Release builds.
...
llvm-svn: 144761
2011-11-16 02:19:03 +00:00
Eli Friedman
d20adbdce3
Fix a bunch of really nasty bugs in how we compute alignment for reference lvalues. PR11376.
...
llvm-svn: 144745
2011-11-16 00:42:57 +00:00
Peter Collingbourne
fcc764d140
When reference binding array rvalues, such as those created by compound
...
literals of array type, materialise a temporary.
llvm-svn: 144483
2011-11-13 00:51:30 +00:00
Richard Smith
ce40ad677e
Represent an APValue based on a Decl as that Decl, rather than a DeclRefExpr
...
or MemberExpr which refers to it. As a side-effect, MemberExprs which refer to
static member functions and static data members are now emitted as constant
expressions.
llvm-svn: 144468
2011-11-12 22:28:03 +00:00
Eli Friedman
b29c8d55b9
Make test compatible with ARM hosts.
...
llvm-svn: 144428
2011-11-11 23:36:04 +00:00
John McCall
03318c1dcf
Don't apply NRVO to over-aligned variables. The caller only
...
guarantees alignment up to the ABI alignment of the return type.
llvm-svn: 144364
2011-11-11 03:57:31 +00:00
John McCall
f1a3c2aee1
Be sure to insulate block literals from any cleanups in their
...
enclosing full-expressions. It is somewhat amazing that
this hasn't come up as a problem before.
llvm-svn: 144362
2011-11-11 03:19:12 +00:00
John McCall
f4beacd059
Whenever explicitly activating or deactivating a cleanup, we
...
need to provide a 'dominating IP' which is guaranteed to
dominate the (de)activation point but which cannot be avoided
along any execution path from the (de)activation point to
the push-point of the cleanup. Using the entry block is
bad mojo.
llvm-svn: 144276
2011-11-10 10:43:54 +00:00
John McCall
e63abb5d2b
Fix a subtle bug with cleanups: when activating
...
a previously-inactive cleanup, not only do we need a
flag variable, but we should also force the cleanup to
query the flag variable. However, we only need to do
this when we're activating in a context that's
conditionally executed; otherwise, we may safely
assume that the cleanup is dominated by the activation
point.
llvm-svn: 144271
2011-11-10 09:22:44 +00:00
Benjamin Kramer
3757be395e
Update test.
...
llvm-svn: 144185
2011-11-09 12:43:30 +00:00
Eli Friedman
1307652185
This test isn't portable to non-x86 platforms; specify a triple.
...
llvm-svn: 144112
2011-11-08 19:55:32 +00:00
Daniel Dunbar
b3675dd660
tests: Remove some stray and unused -cc1 flags. These tests appear to be written
...
to go through the driver.
llvm-svn: 143791
2011-11-05 05:41:57 +00:00
Devang Patel
384dfa4f10
Enable -flimit-debug-info by default. Now, clang lazily emits debug info for structs. Original behavior can be restored using -fno-limit-debug-info.
...
llvm-svn: 143733
2011-11-04 20:05:58 +00:00
Douglas Gregor
10f939c3db
Don't build member initializers for zero-length or incomplete arrays,
...
and don't try to destroy them, either. Fixes
<rdar://problem/10228639>.
llvm-svn: 143584
2011-11-02 23:04:16 +00:00
Fariborz Jahanian
10317eaa28
back out changes in r143399 and r143475.
...
rvale-references are captured by reference
in blocks. // rdar://9971124.
llvm-svn: 143583
2011-11-02 22:53:43 +00:00
Fariborz Jahanian
ab92b753d6
Find copy constructor needed to copy an rvalue reference
...
c++ object into block descriptor. // rdar://9971124
llvm-svn: 143475
2011-11-01 18:57:34 +00:00
Eli Friedman
fcec630a57
Fix the representation of wide strings in the AST and IR so that it uses the native representation of integers for the elements. This fixes a bunch of nastiness involving
...
treating wide strings as a series of bytes.
Patch by Seth Cantrell.
llvm-svn: 143417
2011-11-01 02:23:42 +00:00
Fariborz Jahanian
f0cda63975
Adds IRGen support for captured rvalue references in blocks.
...
In this case, temporary value is copied into block descriptor
as their own copy to work on. // rdar://9971124
llvm-svn: 143399
2011-10-31 23:44:33 +00:00
Devang Patel
fa59ac363e
In case of template specialization, do not try to delay emitting debug info for concrete type in -flimit-debug-info mode. This fixes some of the failures from bs15503.exp tests in gdb testsuite.
...
llvm-svn: 143227
2011-10-28 21:12:13 +00:00
Richard Smith
11562c5e10
Reinstate r142844 (reverted in r142872) now that lvalue-to-rvalue conversions
...
are present in all the necessary places:
In constant expression evaluation, evaluate lvalues as lvalues and rvalues as
rvalues. Remove special case for caching reference initialization and fix a
cyclic initialization crash in the process.
llvm-svn: 143204
2011-10-28 17:51:58 +00:00
John McCall
9a43e12117
Be sure to build a dependent expression when we see
...
a binary operator involving a dependently-typed overload set.
llvm-svn: 143172
2011-10-28 01:04:34 +00:00
Nick Lewycky
b25abd1a54
Move these test from checking assembly to checking LLVM IR. Should fix fallout
...
from r143097.
llvm-svn: 143098
2011-10-27 07:11:43 +00:00
Devang Patel
242ce91ecc
Do not drop type qualifiers in -flimit-debug-info mode.
...
llvm-svn: 142873
2011-10-24 23:15:17 +00:00
Eli Friedman
9190e19b66
Don't try to emit CK_LValueBitCast casts as constants. PR9558.
...
llvm-svn: 142863
2011-10-24 22:25:55 +00:00
Eric Christopher
4b4beb2fe7
Fix PR11073 by adding the argument type information to the decl we construct
...
for the function type. Update a testcase accordingly.
Patch initially by Anders Waldenborg!
llvm-svn: 142700
2011-10-21 23:30:10 +00:00
Fariborz Jahanian
47f9a73f51
c++: support gcc's application of weak attribute on
...
class declaration which forces any such class and any
class that inherits from such a class to have their
typeinfo symbols be marked as weak.
// rdar://10246395
A test/CodeGenCXX/weak-extern-typeinfo.cpp
M lib/Sema/SemaDeclCXX.cpp
M lib/Sema/SemaDeclAttr.cpp
M lib/CodeGen/CGRTTI.cpp
llvm-svn: 142693
2011-10-21 22:27:12 +00:00
Eli Friedman
27ef75b0be
Handle an edge case involving the conditional operator and throw expressions. PR10582.
...
llvm-svn: 142047
2011-10-15 02:10:40 +00:00
Anton Korobeynikov
f82017f3fe
Missed tests for half FP support
...
llvm-svn: 142017
2011-10-14 23:32:50 +00:00
Eli Friedman
fde961dbf3
PR11124: Don't overwrite memory outside of a base class when performing zero-initialization before running its constructor.
...
llvm-svn: 141933
2011-10-14 02:27:24 +00:00
Richard Smith
9ca5c42582
Update all tests other than Driver/std.cpp to use -std=c++11 rather than
...
-std=c++0x. Patch by Ahmed Charles!
llvm-svn: 141900
2011-10-13 22:29:44 +00:00
Douglas Gregor
c7a3107baf
When performing a user-defined conversion via a constructor, be sure
...
to check whether the constructor is accessible. Fixes
<rdar://problem/10202900>.
llvm-svn: 141588
2011-10-10 22:41:00 +00:00
John McCall
0710e551ef
Record layout requires not just a definition, but a complete
...
definition. Assert this. Change IR generation to not try to
aggressively emit the IR translation of a record during its
own definition. Fixes PR10912.
llvm-svn: 141350
2011-10-07 02:39:22 +00:00
Eli Friedman
ed47406871
Move test, so it actually tests what it is supposed to (given that we don't have an AST verifier).
...
llvm-svn: 140620
2011-09-27 18:55:06 +00:00
Peter Collingbourne
085095f1ac
Move vtable dumper call to VTableBuilder ctor
...
llvm-svn: 140508
2011-09-26 01:57:00 +00:00
Peter Collingbourne
71c26936a0
Remove CodeGenVTables::ComputeVTableRelatedInformation dependency on CodeGen
...
llvm-svn: 140503
2011-09-26 01:56:36 +00:00
Sebastian Redl
12757ab4cb
Treat list-initialization of scalars as a first-class citizen in C++11.
...
Allow empty initializer lists for scalars, which mean value-initialization.
Constant evaluation for single-element and empty initializer lists for scalars.
Codegen for empty initializer lists for scalars.
Test case comes in next commit.
llvm-svn: 140459
2011-09-24 17:48:14 +00:00
Douglas Gregor
8a556ce512
Explicitly-defaulted copy/move constructors are not "implicit", but
...
they still need the logic to cope with array member
initialization. Fixes PR10720.
llvm-svn: 140302
2011-09-22 15:15:51 +00:00
John McCall
30909031a7
Enforce access control for conversion operators used in contextual
...
conversions (rather than just call-arguments).
llvm-svn: 140244
2011-09-21 08:36:56 +00:00
Bill Wendling
f0724e8e06
Throw the switch to convert clang to the new exception handling model!
...
This model uses the 'landingpad' instruction, which is pinned to the top of the
landing pad. (A landing pad is defined as the destination of the unwind branch
of an invoke instruction.) All of the information needed to generate the correct
exception handling metadata during code generation is encoded into the
landingpad instruction.
The new 'resume' instruction takes the place of the llvm.eh.resume intrinsic
call. It's lowered in much the same way as the intrinsic is.
llvm-svn: 140049
2011-09-19 20:31:14 +00:00
John McCall
28a5b326e1
In apple-kext mode, use external linkage for explicit template instantiations
...
instead of internal linkage.
llvm-svn: 140030
2011-09-19 18:05:26 +00:00
Richard Smith
20104048be
PR10304: Do not call destructors for data members from union destructors. Prior to C++11, this
...
has no effect since any such destructors must be trivial, and in C++11 such destructors must not
be called.
llvm-svn: 139997
2011-09-18 12:11:43 +00:00
Richard Smith
4037235429
Fix PR10531. Attach an initializer to anonymous unions, since the default constructor might not be trivial (if there is an in-class initializer for some member) and might be deleted.
...
llvm-svn: 139991
2011-09-18 00:06:34 +00:00