Граф коммитов

19 Коммитов

Автор SHA1 Сообщение Дата
Bill Wendling 4e1125f630 Update to use references to attribute groups instead of listing the attributes on the call/invoke instructions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175878 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-22 09:10:20 +00:00
John McCall 66b22771fc Call __cxa_begin_catch with the current exception before
calling std::terminate().  rdar://11904428

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174940 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-12 03:51:46 +00:00
Ulrich Weigand 923099773f A number of test cases assume that an "int" parameter or return value
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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166551 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-24 12:22:56 +00:00
Eli Friedman 194428cc83 Make test compatible with ARM hosts.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144428 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-11 23:36:04 +00:00
John McCall 1cd76e8ca8 Don't apply NRVO to over-aligned variables. The caller only
guarantees alignment up to the ABI alignment of the return type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144364 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-11 03:57:31 +00:00
Bill Wendling 285cfd8953 Throw the switch to convert clang to the new exception handling model!
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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140049 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-19 20:31:14 +00:00
Eli Friedman 12e9f8edcf Whack a bunch of tests in CodeGenCXX to work on ARM (using ARM ABI). Batch 2 of 3.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133011 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-14 21:20:53 +00:00
John McCall 93c332a8ba Convert Clang over to resuming from landing pads with llvm.eh.resume.
It's quite likely that this will explode, but I need to know how. :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132269 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-28 21:13:02 +00:00
Eli Friedman addd80d1c8 Back out r132209; it's breaking nightly tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132219 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-27 21:32:17 +00:00
John McCall 0903421e36 Implement a new, much improved version of the cleanup hack. We just need
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132209 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-27 20:01:14 +00:00
Anders Carlsson abea951c34 Add -fcxx-exceptions to all tests that use C++ exceptions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126599 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-28 00:40:07 +00:00
Anders Carlsson e41721e7df Pass -fexceptions to all tests that use try/catch/throw.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126037 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-19 19:23:03 +00:00
Douglas Gregor f5d8f466c3 Promote the static getNRVOCandidate() function, which computed the
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).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123982 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-21 18:05:27 +00:00
John McCall da65ea8648 Teach IR generation how to lazily emit cleanups. This has a lot of advantages,
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108270 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-13 20:32:21 +00:00
John McCall f1549f66a8 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.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107631 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-06 01:34:17 +00:00
Douglas Gregor 3d91bbcdab Ensure that destructors are called for NRVO'd objects when the
function does not return. Thanks to Eli for pointing out this corner
case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103941 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-17 15:52:46 +00:00
Douglas Gregor 72bf425fab Attempt to satisfy Release-Asserts build
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103879 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-15 17:28:53 +00:00
Douglas Gregor b5b30b96e0 When applying the named return value optimization, we still need to
destroy the variable along the exceptional edge; it's only during
normal execution that we avoid destroying this variable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103872 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-15 16:39:56 +00:00
Douglas Gregor d86c477fb5 Implement a simple form of the C++ named return value optimization for
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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103867 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-15 06:46:45 +00:00