History log of /external/clang/test/CodeGenCXX/implicit-copy-constructor.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
b77115d7b988f55f961e24129a62f20dfd066a94 17-Jun-2011 John McCall <rjmccall@apple.com> When synthesizing implicit copy/move constructors and copy/move assignment
operators, don't make an initializer or sub-operation for zero-width
bitfields.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133221 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/implicit-copy-constructor.cpp
0691a5c83246604a89654e0dfc25870e742035b4 25-Jan-2011 Rafael Espindola <rafael.espindola@gmail.com> Move unnamed_addr after the function arguments on Sabre's request.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124210 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/implicit-copy-constructor.cpp
c5f657fe308f22243f674fc1dfbe24915944d8bf 11-Jan-2011 Rafael Espindola <rafael.espindola@gmail.com> Add unnamed_addr to constructors and destructors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123197 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/implicit-copy-constructor.cpp
fb8cc253420e93cee33d29df5a2bdae6aaf16e39 05-May-2010 Douglas Gregor <dgregor@apple.com> Reimplement code generation for copying fields in the
implicitly-generated copy constructor. Previously, Sema would perform
some checking and instantiation to determine which copy constructors,
etc., would be called, then CodeGen would attempt to figure out which
copy constructor to call... but would get it wrong, or poke at an
uninstantiated default argument, or fail in other ways.

The new scheme is similar to what we now do for the implicit
copy-assignment operator, where Sema performs all of the semantic
analysis and builds specific ASTs that look similar to the ASTs we'd
get from explicitly writing the copy constructor, so that CodeGen need
only do a direct translation.

However, it's not quite that simple because one cannot explicit write
elementwise copy-construction of an array. So, I've extended
CXXBaseOrMemberInitializer to contain a list of indexing variables
used to copy-construct the elements. For example, if we have:

struct A { A(const A&); };

struct B {
A array[2][3];
};

then we generate an implicit copy assignment operator for B that looks
something like this:

B::B(const B &other) : array[i0][i1](other.array[i0][i1]) { }

CodeGen will loop over the invented variables i0 and i1 to visit all
elements in the array, so that each element in the destination array
will be copy-constructed from the corresponding element in the source
array. Of course, if we're dealing with arrays of scalars or class
types with trivial copy-assignment operators, we just generate a
memcpy rather than a loop.

Fixes PR6928, PR5989, and PR6887. Boost.Regex now compiles and passes
all of its regression tests.

Conspicuously missing from this patch is handling for the exceptional
case, where we need to destruct those objects that we have
constructed. I'll address that case separately.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103079 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/CodeGenCXX/implicit-copy-constructor.cpp