Commit Graph

9 Commits

Author SHA1 Message Date
John McCall bd30929e4d Validated by nightly-test runs on x86 and x86-64 darwin, including after
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
2010-07-06 01:34:17 +00:00
Anders Carlsson f8a71f08d1 Add the same 'ForVirtualBase' parameter to EmitCXXDestructorCall.
llvm-svn: 102882
2010-05-02 23:29:11 +00:00
John McCall 2e6567ae60 Call PerformCopyInitialization to properly initialize the exception temporary
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
2010-04-22 01:10:34 +00:00
Anders Carlsson b9fd57f198 Introduce a CXXTemporariesCleanupScope RAII object and use it to cleanup the temporaries code.
llvm-svn: 99865
2010-03-30 03:14:41 +00:00
Douglas Gregor 5c13090bd4 Fix double-destruction assertion to account for temporaries in conditionals
llvm-svn: 92134
2009-12-24 18:16:21 +00:00
Douglas Gregor 4cd5d53ebf Assert that we aren't trying to push the same C++ temporary onto the live temporary stack twice. A little insurance against PR5867 surprising us again
llvm-svn: 92132
2009-12-24 17:48:05 +00:00
Mike Stump cd8faeb0b1 Ensure we run cleanups for CXXTemporaries on the exceptional edge. WIP.
llvm-svn: 91588
2009-12-17 06:08:47 +00:00
Anders Carlsson 6e997b2993 ShouldDestroyTemporaries? I don't think so.
llvm-svn: 91450
2009-12-15 20:51:39 +00:00
Anders Carlsson 59486a2ddb Get rid of the ugly CGCXX names and replace them with CGClass, CGExprCXX and CGTemporaries.
llvm-svn: 89742
2009-11-24 05:51:11 +00:00