summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/nrvo.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Call __cxa_begin_catch with the current exception beforeJohn McCall2013-02-121-2/+3
| | | | | | calling std::terminate(). rdar://11904428 llvm-svn: 174940
* A number of test cases assume that an "int" parameter or return valueUlrich Weigand2012-10-241-2/+2
| | | | | | | | | | | | will be represented in the IR as a plain "i32" type. This causes the tests to spuriously fail on platforms where int is not a 32-bit type, or where the ABI requires attributes like "signext" or "zeroext" to be used. This patch adds -triple or -target parameters to force those tests to use the i386-unknown-unknown target. llvm-svn: 166551
* Make test compatible with ARM hosts.Eli Friedman2011-11-111-3/+3
| | | | llvm-svn: 144428
* Don't apply NRVO to over-aligned variables. The caller onlyJohn McCall2011-11-111-0/+12
| | | | | | guarantees alignment up to the ABI alignment of the return type. llvm-svn: 144364
* Throw the switch to convert clang to the new exception handling model!Bill Wendling2011-09-191-6/+7
| | | | | | | | | | | | | 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
* Whack a bunch of tests in CodeGenCXX to work on ARM (using ARM ABI). Batch ↵Eli Friedman2011-06-141-21/+21
| | | | | | 2 of 3. llvm-svn: 133011
* Convert Clang over to resuming from landing pads with llvm.eh.resume.John McCall2011-05-281-1/+1
| | | | | | 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-1/+1
| | | | llvm-svn: 132219
* Implement a new, much improved version of the cleanup hack. We just needJohn McCall2011-05-271-1/+1
| | | | | | | | 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
* Pass -fexceptions to all tests that use try/catch/throw.Anders Carlsson2011-02-191-0/+2
| | | | llvm-svn: 126037
* Promote the static getNRVOCandidate() function, which computed theDouglas Gregor2011-01-211-0/+13
| | | | | | | | | | | | | NRVO candidate for a return statement, to Sema::getCopyElisionCandidate(), and teach it enough to also determine the NRVO candidate for a throw expression. We still don't use the latter information, however. Along the way, implement core issue 1148, which eliminates copy elision from catch parameters and clarifies that copy elision cannot occur from function parameters (which we already implemented). llvm-svn: 123982
* Teach IR generation how to lazily emit cleanups. This has a lot of advantages,John McCall2010-07-131-16/+16
| | | | | | | | | | | | | | | mostly in avoiding unnecessary work at compile time but also in producing more sensible block orderings. Move the destructor cleanups for local variables over to use lazy cleanups. Eventually all cleanups will do this; for now we have some awkward code duplication. Tell IR generation just to never produce landing pads in -fno-exceptions. This is a much more comprehensive solution to a problem which previously was half-solved by checks in most cleanup-generation spots. llvm-svn: 108270
* Validated by nightly-test runs on x86 and x86-64 darwin, including afterJohn McCall2010-07-061-19/+68
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Ensure that destructors are called for NRVO'd objects when theDouglas Gregor2010-05-171-2/+21
| | | | | | | function does not return. Thanks to Eli for pointing out this corner case. llvm-svn: 103941
* Attempt to satisfy Release-Asserts buildDouglas Gregor2010-05-151-3/+0
| | | | llvm-svn: 103879
* When applying the named return value optimization, we still need toDouglas Gregor2010-05-151-0/+13
| | | | | | | destroy the variable along the exceptional edge; it's only during normal execution that we avoid destroying this variable. llvm-svn: 103872
* Implement a simple form of the C++ named return value optimization forDouglas Gregor2010-05-151-0/+55
return statements. We perform NRVO only when all of the return statements in the function return the same variable. Fixes some link failures in Boost.Interprocess (which is relying on NRVO), and probably improves performance for some C++ applications. llvm-svn: 103867
OpenPOWER on IntegriCloud