summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/constructors.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Revert "[CodeGenCXX] Treat 'this' as noalias in constructors"Sean Fertile2018-10-151-16/+16
| | | | | | | This reverts commit https://reviews.llvm.org/rL344150 which causes MachineOutliner related failures on the ppc64le multistage buildbot. llvm-svn: 344526
* [CodeGenCXX] Treat 'this' as noalias in constructorsAnton Bikineev2018-10-101-16/+16
| | | | | | | | | This is currently a clang extension and a resolution of the defect report in the C++ Standard. Differential Revision: https://reviews.llvm.org/D46441 llvm-svn: 344150
* [clang]: Add support for "-fno-delete-null-pointer-checks"Manoj Gupta2018-07-191-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Support for this option is needed for building Linux kernel. This is a very frequently requested feature by kernel developers. More details : https://lkml.org/lkml/2018/4/4/601 GCC option description for -fdelete-null-pointer-checks: This Assume that programs cannot safely dereference null pointers, and that no code or data element resides at address zero. -fno-delete-null-pointer-checks is the inverse of this implying that null pointer dereferencing is not undefined. This feature is implemented in as the function attribute "null-pointer-is-valid"="true". This CL only adds the attribute on the function. It also strips "nonnull" attributes from function arguments but keeps the related warnings unchanged. Corresponding LLVM change rL336613 already updated the optimizations to not treat null pointer dereferencing as undefined if the attribute is present. Reviewers: t.p.northover, efriedma, jyknight, chandlerc, rnk, srhines, void, george.burgess.iv Reviewed By: jyknight Subscribers: drinkcat, xbolva00, cfe-commits Differential Revision: https://reviews.llvm.org/D47894 llvm-svn: 337433
* C++ DR1611, 1658, 2180: implement "potentially constructed subobject" rules ↵Richard Smith2017-02-251-1/+55
| | | | | | | | | | | | | | | | | | | | | | for special member functions. Essentially, as a base class constructor does not construct virtual bases, such a constructor for an abstract class does not need the corresponding base class construction to be valid, and likewise for destructors. This creates an awkward situation: clang will sometimes generate references to the complete object and deleting destructors for an abstract class (it puts them in the construction vtable for a derived class). But we can't generate a "correct" version of these because we can't generate references to base class constructors any more (if they're template specializations, say, we might not have instantiated them and can't assume any other TU will emit a copy). Fortunately, we don't need to, since no correct program can ever invoke them, so instead emit symbols that just trap. We should stop emitting references to these symbols, but still need to emit definitions for compatibility. llvm-svn: 296275
* Update Clang tests to handle explicitly typed load changes in LLVM.David Blaikie2015-02-271-1/+1
| | | | llvm-svn: 230795
* Add 'nonnull' parameter or return attribute when producing an llvm pointer ↵Nick Lewycky2014-05-281-4/+4
| | | | | | type in a function type where the C++ type is a reference. Update the tests. llvm-svn: 209723
* Output destructors and constructors in a more natural order.Rafael Espindola2013-12-091-16/+12
| | | | | | | | | | | | | | | | 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. llvm-svn: 196784
* CHECK-LABEL-ify some code gen tests to improve diagnostic experience when ↵Stephen Lin2013-08-151-11/+11
| | | | | | tests fail. llvm-svn: 188447
* Don't build member initializers for zero-length or incomplete arrays,Douglas Gregor2011-11-021-2/+0
| | | | | | | and don't try to destroy them, either. Fixes <rdar://problem/10228639>. llvm-svn: 143584
* Arrays are permitted to be zero-length in some situations.John McCall2011-07-131-0/+11
| | | | llvm-svn: 135036
* clang side to match the LLVM IR type system rewrite patch.Chris Lattner2011-07-091-2/+2
| | | | llvm-svn: 134831
* Move unnamed_addr after the function arguments on Sabre's request.Rafael Espindola2011-01-251-10/+10
| | | | llvm-svn: 124210
* Add unnamed_addr to constructors and destructors.Rafael Espindola2011-01-111-10/+10
| | | | llvm-svn: 123197
* Account for the VTT argument when making an implicit copy constructor forJohn McCall2010-04-301-0/+12
| | | | | | | | | a class with virtual bases. Just a patch until Sema starts (correctly) doing most of this analysis. Fixes PR 6622. llvm-svn: 102692
* Turn access control on by default in -cc1.John McCall2010-04-091-1/+1
| | | | | | | | Remove -faccess-control from -cc1; add -fno-access-control. Make the driver pass -fno-access-control by default. Update a bunch of tests to be correct under access control. llvm-svn: 100880
* Perform two more constructor/destructor code-size optimizations:John McCall2010-02-231-0/+94
1) emit base destructors as aliases to their unique base class destructors under some careful conditions. This is enabled for the same targets that can support complete-to-base aliases, i.e. not darwin. 2) Emit non-variadic complete constructors for classes with no virtual bases as calls to the base constructor. This is enabled on all targets and in theory can trigger in situations that the alias optimization can't (mostly involving virtual bases, mostly not yet supported). These are bundled together because I didn't think it worthwhile to split them, not because they really need to be. llvm-svn: 96842
OpenPOWER on IntegriCloud