summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/destructors.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Simplify EH control flow by observing that EH scopes form a simpleJohn McCall2011-08-111-1/+0
| | | | | | | | | | | | | | | hierarchy of delegation, and that EH selector values are meaningful function-wide (good thing, too, or inlining wouldn't work). 2,3d 1a hierarchy of delegation and that EH selector values have the same meaning everywhere in the function instead of being meaningful only in the context of a specific selector. This removes the need for routing edges through EH cleanups, since a cleanup simply always branches to its enclosing scope. llvm-svn: 137293
* Be sure to destroy the normal entry block of a cleanup that weJohn McCall2011-08-061-0/+25
| | | | | | | | | | | | | | | aren't actually going to make a normal cleanup for. Sometimes we optimistically create branches to such blocks for fixups, and then we resolve the fixup to somewhere within the cleanup's scope, and then the cleanup is actually not reachable for some reason. The process of resolving the fixup leaves us with switches whose default edge leads to the cleanup; we can replace that with unreachable, then (in many cases) turn the switch into an unconditional branch. Fixes PR10467. llvm-svn: 137011
* Fix a lot of problems with the partial destruction of arrays:John McCall2011-07-111-2/+13
| | | | | | | | | | | - an off-by-one error in emission of irregular array limits for InitListExprs - use an EH partial-destruction cleanup within the normal array-destruction cleanup - get the branch destinations right for the empty check Also some refactoring which unfortunately obscures these changes. llvm-svn: 134890
* clang side to match the LLVM IR type system rewrite patch.Chris Lattner2011-07-091-5/+5
| | | | llvm-svn: 134831
* A number of array-related IR-gen cleanups.John McCall2011-07-091-18/+7
| | | | | | | | | | | | - Emit default-initialization of arrays that were partially initialized with initializer lists with a loop, rather than emitting the default initializer N times; - support destroying VLAs of non-trivial type, although this is not yet exposed to users; and - support the partial destruction of arrays initialized with initializer lists when an initializer throws an exception. llvm-svn: 134784
* Convert Clang over to resuming from landing pads with llvm.eh.resume.John McCall2011-05-281-2/+2
| | | | | | It's quite likely that this will explode, but I need to know how. :) llvm-svn: 132269
* Back out r132209; it's breaking nightly tests.Eli Friedman2011-05-271-2/+2
| | | | llvm-svn: 132219
* Implement a new, much improved version of the cleanup hack. We just needJohn McCall2011-05-271-2/+2
| | | | | | | | to be careful to emit landing pads that are always prepared to handle a cleanup path. This is correct mostly because of the fix to the LLVM inliner, r132200. llvm-svn: 132209
* Add -fcxx-exceptions to all tests that use C++ exceptions.Anders Carlsson2011-02-281-1/+1
| | | | llvm-svn: 126599
* Look through array types when deciding whether a field requires non-trivialJohn McCall2011-02-131-0/+20
| | | | | | destruction in the destructor-aliases logic. Fixes PR 9197. llvm-svn: 125447
* Move unnamed_addr after the function arguments on Sabre's request.Rafael Espindola2011-01-251-17/+17
| | | | llvm-svn: 124210
* Add unnamed_addr to constructors and destructors.Rafael Espindola2011-01-111-17/+17
| | | | llvm-svn: 123197
* Implement proper base/member destructor EH chaining.John McCall2010-07-211-1/+47
| | | | llvm-svn: 108989
* Convert the EH cleanups for base and member destructors in a constructor intoJohn McCall2010-07-211-5/+5
| | | | | | lazy cleanups. llvm-svn: 108978
* Mark calls to 'throw()' functions as nounwind, and mark the functions nounwindJohn McCall2010-07-081-9/+6
| | | | | | as well. llvm-svn: 107858
* When destroying a cleanup, kill any references to instructions in the entryJohn McCall2010-07-061-0/+31
| | | | | | | | block before deleting it. Fixes PR7575. This really just a short-term fix before implementing lazy cleanups. llvm-svn: 107676
* Validated by nightly-test runs on x86 and x86-64 darwin, including afterJohn McCall2010-07-061-3/+55
| | | | | | | | | | | | | | | | | | | | | | | | self-host. Hopefully these results hold up on different platforms. I tried to keep the GNU ObjC runtime happy, but it's hard for me to test. Reimplement how clang generates IR for exceptions. Instead of creating new invoke destinations which sequentially chain to the previous destination, push a more semantic representation of *why* we need the cleanup/catch/filter behavior, then collect that information into a single landing pad upon request. Also reorganizes how normal cleanups (i.e. cleanups triggered by non-exceptional control flow) are generated, since it's actually fairly closely tied in with the former. Remove the need to track which cleanup scope a block is associated with. Document a lot of previously poorly-understood (by me, at least) behavior. The new framework implements the Horrible Hack (tm), which requires every landing pad to have a catch-all so that inlining will work. Clang no longer requires the Horrible Hack just to make exceptions flow correctly within a function, however. The HH is an unfortunate requirement of LLVM's EH IR. llvm-svn: 107631
* Reinstate fix for PR7526, which was failing because, now that weDouglas Gregor2010-07-011-0/+19
| | | | | | | | | | | | | | | aren't dropping all exception specifications on destructors, the exception specifications on implicitly-declared destructors were detected as being wrong (which they were). Introduce logic to provide a proper exception-specification for implicitly-declared destructors. This also fixes PR6972. Note that the other implicitly-declared special member functions also need to get exception-specifications. I'll deal with that in a subsequent commit. llvm-svn: 107385
* Revert r107374, which broke bootstrap.Douglas Gregor2010-07-011-11/+0
| | | | llvm-svn: 107378
* When building the type of a destructor, make sure to keep theDouglas Gregor2010-07-011-0/+11
| | | | | | exception specification. Fixes PR7526. llvm-svn: 107374
* Give this test a triple.John McCall2010-05-271-1/+1
| | | | llvm-svn: 104798
* When deciding whether a deferred declaration has already been emitted,John McCall2010-05-271-1/+64
| | | | | | | aliases count as definitions regardless of whether their target has been emitted yet. Fixes PR 7142. llvm-svn: 104796
* Don't emit derived-to-base destructor aliases if we don't have a definitionJohn McCall2010-03-031-0/+14
| | | | | | | | for the base destructor, because aliases to declarations aren't legal. Fixes PR 6471. llvm-svn: 97637
* Perform two more constructor/destructor code-size optimizations:John McCall2010-02-231-1/+45
| | | | | | | | | | | | | | | | 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
* More refactoring around constructor/destructor code generation.John McCall2010-02-191-1/+48
| | | | | | | | | | | | Fix some bugs with function-try-blocks and simplify normal try-block code generation. This implementation excludes a deleting destructor's call to operator delete() from the function-try-block, which I believe is correct but which I can't find straightforward support for at a moment's glance. llvm-svn: 96670
* 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). llvm-svn: 91446
* Unify the way destructor epilogues are generated for synthesized and regular ↵Anders Carlsson2009-11-171-0/+14
| | | | | | destructors. Also fix PR5529. llvm-svn: 89034
* CodeGen may see out-of-line declarations of the various special memberDouglas Gregor2009-10-011-1/+9
| | | | | | | | | | | functions when they are explicitly declared, e.g., via a function template specialization or explicit template instantiation declaration. Don't try to synthesize bodies for the special member functions in this case; rather, check whether we have an implicit declaration and, if so, synthesize the appropriate function body. Fixes PR5084. llvm-svn: 83212
* We can generate constructors/destructors with base classes and non-trivial ↵Anders Carlsson2009-09-011-0/+22
fields just fine now. llvm-svn: 80701
OpenPOWER on IntegriCloud