summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGTemporaries.cpp
Commit message (Collapse)AuthorAgeFilesLines
* When destroying temporaries, instead of a custom cleanup use thePeter Collingbourne2011-11-271-37/+0
| | | | | | | | | | | generic pushDestroy function. This would reduce the number of useful declarations in CGTemporaries.cpp to one. Since CodeGenFunction::EmitCXXTemporary does not deserve its own file, move it to CGCleanup.cpp and delete CGTemporaries.cpp. llvm-svn: 145202
* Enter the cleanups for a block outside the enclosingJohn McCall2011-11-101-12/+0
| | | | | | | | | | | | full-expression. Naturally they're inactive before we enter the block literal expression. This restores the intended behavior that blocks belong to their enclosing scope. There's a useful -O0 / compile-time optimization that we're missing here with activating cleanups following straight-line code from their inactive beginnings. llvm-svn: 144268
* Generalize Cleanup::Emit's "isForEH" parameter into a setJohn McCall2011-07-121-1/+1
| | | | | | of flags. No functionality change. llvm-svn: 134997
* Do full-expression cleanups in a much more sensible way that still letsJohn McCall2011-07-121-3/+6
| | | | | | people write useful cleanup classes. llvm-svn: 134942
* Fix some obvious bugs in the conditional-cleanup code and then make theJohn McCall2011-01-261-50/+8
| | | | | | dtor cleanup use it. llvm-svn: 124309
* Better framework for conditional cleanups; untested as yet.John McCall2011-01-261-1/+1
| | | | | | | | I'm separately committing this because it incidentally changes some block orderings and minor IR issues, like using a phi instead of an unnecessary alloca. llvm-svn: 124277
* Rename CXXExprWithTemporaries -> ExprWithCleanups; there's no theoreticalJohn McCall2010-12-061-4/+3
| | | | | | reason this is limited to C++, and it's certainly not limited to temporaries. llvm-svn: 120996
* one piece of code is responsible for the lifetime of every aggregateJohn McCall2010-09-151-5/+2
| | | | | | | | | | | | | slot. The easiest way to do that was to bundle up the information we care about for aggregate slots into a new structure which demands that its creators at least consider the question. I could probably be convinced that the ObjC 'needs GC' bit should be rolled into this structure. Implement generalized copy elision. The main obstacle here is that IR-generation must be much more careful about making sure that exactly llvm-svn: 113962
* Rename LazyCleanup -> Cleanup. No functionality change for these last threeJohn McCall2010-07-211-3/+3
| | | | | | commits. llvm-svn: 109000
* Code simplification.John McCall2010-07-211-14/+4
| | | | llvm-svn: 108996
* Switch the main possibly-conditional temporary cleanup over to being lazy.John McCall2010-07-211-33/+37
| | | | llvm-svn: 108995
* Validated by nightly-test runs on x86 and x86-64 darwin, including afterJohn McCall2010-07-061-103/+41
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Add the same 'ForVirtualBase' parameter to EmitCXXDestructorCall.Anders Carlsson2010-05-021-2/+3
| | | | llvm-svn: 102882
* Call PerformCopyInitialization to properly initialize the exception temporaryJohn McCall2010-04-221-5/+2
| | | | | | | | | in a throw expression. Use EmitAnyExprToMem to emit the throw expression, which magically elides the final copy-constructor call (which raises a new strict-compliance bug, but baby steps). Give __cxa_throw a destructor pointer if the exception type has a non-trivial destructor. llvm-svn: 102039
* Introduce a CXXTemporariesCleanupScope RAII object and use it to cleanup the ↵Anders Carlsson2010-03-301-8/+7
| | | | | | temporaries code. llvm-svn: 99865
* Fix double-destruction assertion to account for temporaries in conditionalsDouglas Gregor2009-12-241-1/+2
| | | | llvm-svn: 92134
* Assert that we aren't trying to push the same C++ temporary onto the live ↵Douglas Gregor2009-12-241-0/+3
| | | | | | temporary stack twice. A little insurance against PR5867 surprising us again llvm-svn: 92132
* Ensure we run cleanups for CXXTemporaries on the exceptional edge. WIP.Mike Stump2009-12-171-0/+27
| | | | llvm-svn: 91588
* ShouldDestroyTemporaries? I don't think so.Anders Carlsson2009-12-151-11/+0
| | | | llvm-svn: 91450
* Get rid of the ugly CGCXX names and replace them with CGClass, CGExprCXX and ↵Anders Carlsson2009-11-241-0/+143
CGTemporaries. llvm-svn: 89742
OpenPOWER on IntegriCloud