summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/exceptions.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [Lit Test] Make tests C++11 compatible - nothrow destructorsCharles Li2017-01-091-28/+76
| | | | | | | | | In C++11, a destructor's implicit exception-spec is nothrow. The IR for the destructor's invocation changed from invoke to call. Differential Revision: https://reviews.llvm.org/D28425 llvm-svn: 291458
* Replace Sema-level implementation of -fassume-sane-operator-new with aRichard Smith2016-04-071-7/+7
| | | | | | | | | | | | | | CodeGen-level implementation. Instead of adding an attribute to clang's FunctionDecl, add the IR attribute directly. This means a module built with this flag is now compatible with code built without it and vice versa. This change also results in the 'noalias' attribute no longer being added to calls to operator new in the IR; it's now only added to the declaration. It also fixes a bug where we failed to add the attribute to the 'nothrow' versions (because we didn't implicitly declare them, there was no good time to inject a fake attribute). llvm-svn: 265728
* Don't crash when a reserved global placement operator new is pairedJohn McCall2015-09-291-0/+20
| | | | | | with a non-reserved operator delete in a new-expression. llvm-svn: 248862
* Use the reserved keyword spelling of 'typeof'David Majnemer2015-08-011-1/+1
| | | | | | No functional change intended, just a drive-by cleanup. llvm-svn: 243826
* Update Clang tests to handle explicitly typed load changes in LLVM.David Blaikie2015-02-271-14/+14
| | | | llvm-svn: 230795
* Update Clang tests to handle explicitly typed gep changes in LLVM.David Blaikie2015-02-271-10/+10
| | | | llvm-svn: 230783
* Add a comdat to __clang_call_terminateReid Kleckner2015-02-111-2/+2
| | | | llvm-svn: 228863
* Mark C++ reference parameters as dereferenceableHal Finkel2014-07-181-1/+1
| | | | | | | | | | | | | | Because references must be initialized using some evaluated expression, they must point to something, and a callee can assume the reference parameter is dereferenceable. Taking advantage of a new attribute just added to LLVM, mark them as such. Because dereferenceability in addrspace(0) implies nonnull in the backend, we don't need both attributes. However, we need to know the size of the object to use the dereferenceable attribute, so for incomplete types we still emit only nonnull. llvm-svn: 213386
* Add 'nonnull' parameter or return attribute when producing an llvm pointer ↵Nick Lewycky2014-05-281-1/+1
| | | | | | type in a function type where the C++ type is a reference. Update the tests. llvm-svn: 209723
* CHECK-LABEL-ify some code gen tests to improve diagnostic experience when ↵Stephen Lin2013-08-151-6/+6
| | | | | | tests fail. llvm-svn: 188447
* Add more of the command line options as attribute flags.Bill Wendling2013-02-281-2/+0
| | | | | | These can be easily queried by the back-end. llvm-svn: 176304
* Reapply r176133 with testcase fixes.Bill Wendling2013-02-271-6/+2
| | | | llvm-svn: 176145
* Revert "Add more attributes from the command line to functions."Anna Zaks2013-02-251-2/+5
| | | | | | | | This reverts commit 176009. The commit is a likely cause of several buildbot failures. llvm-svn: 176044
* Add more attributes from the command line to functions.Bill Wendling2013-02-251-5/+2
| | | | | | | This is an ongoing process. Any command line option which a back-end cares about should be added here. llvm-svn: 176009
* Update to use references to attribute groups instead of listing the ↵Bill Wendling2013-02-221-5/+8
| | | | | | attributes on the call/invoke instructions. llvm-svn: 175878
* Modify the tests to use attribute group references instead of listing theBill Wendling2013-02-201-1/+6
| | | | | | function attributes. llvm-svn: 175606
* Call __cxa_begin_catch with the current exception beforeJohn McCall2013-02-121-2/+9
| | | | | | calling std::terminate(). rdar://11904428 llvm-svn: 174940
* Destroy arrays and ARC fields when throwing out of ctors.John McCall2013-02-011-0/+67
| | | | | | | | Previously we were only handling non-array fields of class type. Testcases derived from a patch by WenHan Gu. llvm-svn: 174146
* During jump-scope checking, build an ExprWithCleanups immediatelyJohn McCall2012-09-251-0/+1
| | | | | | | | | | | | into the enclosing scope; this is a more accurate model but is (I believe) unnecessary in my test case due to other flaws. However, one of those flaws is now intentional: blocks which appear in return statements can be trivially observed to not extend in lifetime past the return, and so we can allow a jump past them. Do the necessary magic in IR-generation to make this work. llvm-svn: 164589
* It turns out that implementing the rethrow-on-fallthroughJohn McCall2012-06-151-0/+36
| | | | | | | | | | semantics of a ctor/dtor function-try-block catch handler by pushing a normal cleanup is not just overkill but actually actively wrong when the handler contains an explicit return (which is only legal in a dtor). Just emit the rethrow as ordinary code at the fallthrough point. Fixes PR13102. llvm-svn: 158488
* Elide copy construction in new expressions. PR11757.Eli Friedman2012-02-161-12/+3
| | | | llvm-svn: 150738
* Whenever explicitly activating or deactivating a cleanup, weJohn McCall2011-11-101-10/+8
| | | | | | | | | | need to provide a 'dominating IP' which is guaranteed to dominate the (de)activation point but which cannot be avoided along any execution path from the (de)activation point to the push-point of the cleanup. Using the entry block is bad mojo. llvm-svn: 144276
* Rearrange code so that we pass the right pointer to delete[] when an ↵Eli Friedman2011-09-061-0/+18
| | | | | | exception is thrown constructing the array elements in an array new expression. Fixes PR10870. llvm-svn: 139158
* An initialization does not alias.John McCall2011-08-261-0/+4
| | | | llvm-svn: 138624
* The allocated exception slot does not alias anything; should fix self-host.John McCall2011-08-261-0/+13
| | | | llvm-svn: 138615
* Simplify EH control flow by observing that EH scopes form a simpleJohn McCall2011-08-111-2/+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
* Convert Clang over to resuming from landing pads with llvm.eh.resume.John McCall2011-05-281-0/+2
| | | | | | It's quite likely that this will explode, but I need to know how. :) llvm-svn: 132269
* The conditional needs to be pushed before the branch. Make the test lessJohn McCall2011-03-071-1/+68
| | | | | | trivial to check this. Adjust for style. llvm-svn: 127151
* An operator new with an empty exception specifier returns null on a badJohn McCall2011-03-071-0/+18
| | | | | | | | allocation and therefore requires a null-check. We were doing that, but we weren't treating the new-initializer as being conditionally executed, which means it was possible to get ill-formed IR as in PR9298. llvm-svn: 127147
* Add -fcxx-exceptions to all tests that use C++ exceptions.Anders Carlsson2011-02-281-1/+1
| | | | llvm-svn: 126599
* Tame an assert; the scope depth of a jump destination does notJohn McCall2011-02-251-0/+12
| | | | | | | | necessarily enclose the innermost normal cleanup depth, because the top of the jump scope stack might be an EH cleanup or EH scope. Fixes PR9303. llvm-svn: 126472
* Save a copy expression for non-trivial copy constructions of catch variables.John McCall2011-02-161-0/+34
| | | | llvm-svn: 125661
* Fix some obvious bugs in the conditional-cleanup code and then make theJohn McCall2011-01-261-1/+1
| | | | | | dtor cleanup use it. llvm-svn: 124309
* When emitting a new-expression inside a conditional expression,John McCall2010-09-171-9/+60
| | | | | | | | | | | | | | | | the cleanup might not be dominated by the allocation code. In this case, we have to store aside all the delete arguments in case we need them later. There's room for optimization here in cases where we end up not actually needing the cleanup in different branches (or being able to pop it after the initialization code). Also make sure we only call this operator delete along the path where we actually allocated something. Fixes rdar://problem/8439196. llvm-svn: 114145
* Implement the EH cleanup to call 'operator delete' if a new-expression throwsJohn McCall2010-09-141-13/+205
| | | | | | (but not if destructors associated with the full-expression throw). llvm-svn: 113836
* 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
* When an exception needs to be freed by calling __cxa_exception_free, make ↵Anders Carlsson2009-12-111-0/+18
sure to stash away the exception pointer somewhere. This fixes an "Instruction does not dominate all uses!" verification error when compiling TableGen. llvm-svn: 91084
OpenPOWER on IntegriCloud