summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/virtual-bases.cpp
Commit message (Collapse)AuthorAgeFilesLines
* IRgen: Mark aliases of ctors and dtors as unnamed_addr.Peter Collingbourne2018-06-181-1/+1
| | | | | | | | | This is not only semantically correct but ensures that they will not be marked as address-significant once D48155 lands. Differential Revision: https://reviews.llvm.org/D48206 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@334982 91177308-0d34-0410-b5e6-96231b3b80d8
* [CodeGen] Use the non-virtual alignment when emitting the baseAkira Hatanaka2018-01-271-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | constructor. Previously, clang would emit an over-aligned (16-byte) store to initialize B::x in B's base constructor when compiling the following code: struct A { __attribute__((aligned(16))) double data1; }; struct B : public virtual A { B() : x(123) {} double a; int x; }; struct C : public virtual B {}; void test() { B b; C c; } This was happening because the code in IRGen that does member initialization was using the alignment of a complete object instead of the non-virtual alignment. This commit fixes the bug. rdar://problem/36382481 Differential Revision: https://reviews.llvm.org/D42521 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@323578 91177308-0d34-0410-b5e6-96231b3b80d8
* Output destructors and constructors in a more natural order.Rafael Espindola2013-12-091-2/+2
| | | | | | | | | | | | | | | | With this patch we output the in the order C2 C1 D2 D1 D0 Which means that a destructor or constructor that call another is output after the callee. This is a bit easier to read IHMO and a tiny bit more efficient as we don't put a decl in DeferredDeclsToEmit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196784 91177308-0d34-0410-b5e6-96231b3b80d8
* CHECK-LABEL-ify some code gen tests to improve diagnostic experience when ↵Stephen Lin2013-08-151-6/+6
| | | | | | tests fail. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188447 91177308-0d34-0410-b5e6-96231b3b80d8
* clang side to match the LLVM IR type system rewrite patch.Chris Lattner2011-07-091-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134831 91177308-0d34-0410-b5e6-96231b3b80d8
* Move unnamed_addr after the function arguments on Sabre's request.Rafael Espindola2011-01-251-6/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124210 91177308-0d34-0410-b5e6-96231b3b80d8
* Add unnamed_addr to constructors and destructors.Rafael Espindola2011-01-111-6/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123197 91177308-0d34-0410-b5e6-96231b3b80d8
* When collecting virtual bases it's very important to use the canonical type ↵Anders Carlsson2010-03-291-0/+23
| | | | | | of the base class. Otherwise, we might add the same virtual base class twice if the virtual base is an instantiated template. Fixes PR6251. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99829 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-introduce the ctor/dtor alias optimization, this time hidden behind aJohn McCall2010-02-191-2/+2
| | | | | | | | command-line option which defaults off. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96649 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert the ctor/dtor alias optimization for now; the buildbots can detectJohn McCall2010-02-181-3/+3
| | | | | | | | some failure here that I can't. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96612 91177308-0d34-0410-b5e6-96231b3b80d8
* Emit complete constructors and destructors as aliases to base constructorsJohn McCall2010-02-171-3/+3
| | | | | | | | | | and destructors when the two entities are semantically identical, i.e. when the class has no virtual base classes. We only do this for linkage types for which aliases are supported, i.e. internal and external, i.e. not linkonce. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96451 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the correct function info for constructors when applying function ↵Anders Carlsson2010-02-061-0/+8
| | | | | | attributes. Fixes PR6245. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95474 91177308-0d34-0410-b5e6-96231b3b80d8
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-151-1/+1
| | | | | | | | | - This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91446 91177308-0d34-0410-b5e6-96231b3b80d8
* Add VTT parameter to base ctors/dtors with virtual bases. (They aren't used ↵Anders Carlsson2009-11-251-0/+17
yet). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89835 91177308-0d34-0410-b5e6-96231b3b80d8