summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGException.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Emit @finally blocks completely lazily instead of forcing theirJohn McCall2011-06-221-56/+54
| | | | | | | | | | | | | existence by always threading an edge from the catchall. Not doing this was previously causing a crash in the very extreme case where neither the normal cleanup nor the EH catchall was actually reachable: we would delete the catchall entry block, which would cause us to delete the entry block of the finally cleanup as well because the cleanup logic would merge the blocks, which in turn triggered an assert because later blocks in the finally would still be using values from the entry. Laziness turns out to be the most elegant solution to the problem. llvm-svn: 133601
* Automatic Reference Counting.John McCall2011-06-151-2/+4
| | | | | | | | | | Language-design credit goes to a lot of people, but I particularly want to single out Blaine Garst and Patrick Beard for their contributions. Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself, in no particular order. llvm-svn: 133103
* Convert Clang over to resuming from landing pads with llvm.eh.resume.John McCall2011-05-281-69/+119
| | | | | | 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-80/+51
| | | | llvm-svn: 132219
* Implement a new, much improved version of the cleanup hack. We just needJohn McCall2011-05-271-51/+80
| | | | | | | | 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
* IRgen/Darwin: Fix refacto introduced in Triple changes.Daniel Dunbar2011-04-261-1/+1
| | | | llvm-svn: 130233
* ADT/Triple: Switch to using .isOSDarwin() predicate.Daniel Dunbar2011-04-191-1/+1
| | | | llvm-svn: 129823
* Get rid of std::vector usage when getting function types in CGException.cppAnders Carlsson2011-04-181-30/+22
| | | | llvm-svn: 129698
* fix a bunch of comment typos found by codespell. Patch byChris Lattner2011-04-151-1/+1
| | | | | | Luis Felipe Strano Moraes! llvm-svn: 129559
* Fix Objective-C++ exceptions (GNU runtime).David Chisnall2011-03-201-1/+2
| | | | llvm-svn: 127980
* Reintroduce r127617: "Code generation for noexcept." with fixes.Sebastian Redl2011-03-151-17/+25
| | | | llvm-svn: 127685
* Revert r127617: "Code generation for noexcept."Jakob Stoklund Olesen2011-03-151-25/+17
| | | | | | The tests fail in a -Asserts build. llvm-svn: 127635
* Code generation for noexcept.Sebastian Redl2011-03-141-17/+25
| | | | llvm-svn: 127617
* Propagate the new exception information to FunctionProtoType.Sebastian Redl2011-03-121-4/+3
| | | | | | | | Change the interface to expose the new information and deal with the enormous fallout. Introduce the new ExceptionSpecificationType value EST_DynamicNone to more easily deal with empty throw specifications. Update the tests for noexcept and fix the various bugs uncovered, such as lack of tentative parsing support. llvm-svn: 127537
* Add a -fcxx-exceptions flag to the frontend, which can be used to enableAnders Carlsson2011-02-281-2/+2
| | | | | | | | | | C++ exceptions, even when exceptions have been turned off using -fno-exceptions. Make the -fobjc-exceptions flag do the same thing, but for Objective-C exceptions. C++ and Objective-C exceptions can also be disabled using -fno-cxx-excptions and -fno-objc-exceptions. llvm-svn: 126630
* Get rid of the areExceptionsEnabled() getter from LangOptions.Anders Carlsson2011-02-281-3/+3
| | | | llvm-svn: 126598
* Reorganize the emission of local variables.John McCall2011-02-221-7/+9
| | | | llvm-svn: 126189
* Add a LangOptions::areExceptionsEnabled and start using it.Anders Carlsson2011-02-201-3/+3
| | | | llvm-svn: 126062
* Change the representation of GNU ?: expressions to use a different expressionJohn McCall2011-02-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | class and to bind the shared value using OpaqueValueExpr. This fixes an unnoticed problem with deserialization of these expressions where the deserialized form would lose the vital pointer-equality trait; or rather, it fixes it because this patch also does the right thing for deserializing OVEs. Change OVEs to not be a "temporary object" in the sense that copy elision is permitted. This new representation is not totally unawkward to work with, but I think that's really part and parcel with the semantics we're modelling here. In particular, it's much easier to fix things like the copy elision bug and to make the CFG look right. I've tried to update the analyzer to deal with this in at least some obvious cases, and I think we get a much better CFG out, but the printing of OpaqueValueExprs probably needs some work. llvm-svn: 125744
* Remove this FIXME; clear up an unused variable; style.John McCall2011-02-161-8/+6
| | | | llvm-svn: 125662
* Save a copy expression for non-trivial copy constructions of catch variables.John McCall2011-02-161-19/+19
| | | | llvm-svn: 125661
* Reorganize CodeGen{Function,Module} to eliminate the unfortunateJohn McCall2011-02-081-12/+11
| | | | | | | | Block{Function,Module} base class. Minor other refactorings. Fixed a few address-space bugs while I was there. llvm-svn: 125085
* Move all the cleanups framework code into a single file.John McCall2011-01-281-172/+1
| | | | | | Pure motion. llvm-svn: 124484
* Convert the exception-freeing cleanup over to the conditional cleanups code,John McCall2011-01-281-89/+25
| | | | | | | | | fixing a crash which probably nobody was ever going to see. In doing so, fix a horrendous number of problems with the conditional-cleanups code. Also, make conditional cleanups re-use the cleanup's activation variable, which avoids some unfortunate repetitiveness. llvm-svn: 124481
* Fix some obvious bugs in the conditional-cleanup code and then make theJohn McCall2011-01-261-2/+1
| | | | | | dtor cleanup use it. llvm-svn: 124309
* Better framework for conditional cleanups; untested as yet.John McCall2011-01-261-0/+36
| | | | | | | | 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
* "Name" a bool parameter.Anders Carlsson2011-01-241-3/+5
| | | | llvm-svn: 124094
* Fix a latent bug where, after emitting an expression statement, we wouldJohn McCall2011-01-121-8/+7
| | | | | | | | | | | | | | delete the block we began emitting into if it had no predecessors. We never want to do this, because there are several valid cases during statement emission where an existing block has no known predecessors but will acquire some later. The case in my test case doesn't inherently fall into this category, because we could safely emit the case-range code before the statement body, but there are examples with labels that can't be fallen into that would also demonstrate this bug. rdar://problem/8837067 llvm-svn: 123303
* Rename CXXExprWithTemporaries -> ExprWithCleanups; there's no theoreticalJohn McCall2010-12-061-1/+1
| | | | | | reason this is limited to C++, and it's certainly not limited to temporaries. llvm-svn: 120996
* ARM EH uses a different personality function in C.John McCall2010-11-071-0/+3
| | | | llvm-svn: 118366
* Don't assert on attempts to throw 'bool'. I wonder if in the history of C++John McCall2010-10-291-1/+1
| | | | | | anyone has ever intentionally done this outside of a compiler test case. llvm-svn: 117645
* Death to blocks, or at least the word "block" in one particular obnoxiouslyJohn McCall2010-10-151-1/+1
| | | | | | ambiguous context. llvm-svn: 116567
* Opportunistically use the C++ personality function in ObjC++John McCall2010-09-161-13/+93
| | | | | | translation units that don't catch ObjC types. rdar://problem/8434851 llvm-svn: 114070
* one piece of code is responsible for the lifetime of every aggregateJohn McCall2010-09-151-1/+1
| | | | | | | | | | | | | 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
* IRgen: Change Emit{Load,Store}OfScalar to take a required Alignment argument andDaniel Dunbar2010-08-211-1/+4
| | | | | | | | update callers as best I can. - This is a work in progress, our alignment handling is very horrible / sketchy -- I am just aiming for monotonic improvement. - Serious review appreciated. llvm-svn: 111707
* Sketch out a framework for delaying the activation of a cleanup.John McCall2010-08-131-2/+4
| | | | | | Not yet complete or used. llvm-svn: 111044
* When re-raising an exception after a cleanup, we need to call ↵John McCall2010-08-111-1/+1
| | | | | | | | | | | | | | | | | | _Unwind_Resume_or_Rethrow instead of _Unwind_Resume. With SJLJ exceptions, this is spelled "_Unwind_SjLj_Resume_or_Rethrow", not "_Unwind_SjLj_Resume", which has significantly different semantics. We should actually never be generating a call to _Unwind_SjLj_Resume directly; even if we were generating true cleanups (which we aren't because of the horrible hack), we should be calling __cxa_end_cleanup() on ARM. I haven't implemented this because there's little point as long as the HH is present. I believe this fixes <rdar://problem/8281377>. llvm-svn: 110851
* Fix a bug in @finally emission in both the fragile and non-fragile EH schemesJohn McCall2010-08-111-0/+10
| | | | | | | | | where we weren't accounting for the possibility that a @finally block might have internal cleanups and therefore might write to the cleanup destination slot. Fixes <rdar://problem/8293901>. llvm-svn: 110760
* Support catching Objective C pointers in C++ under the non-fragile NeXT runtime.John McCall2010-07-241-1/+7
| | | | | | Diagnose attempts to do this under the GNU or fragile NeXT runtimes. llvm-svn: 109298
* Revise cleanup IR generation to fix a major bug with cleanups (PR7686)John McCall2010-07-231-57/+68
| | | | | | | as well as some significant asymptotic inefficiencies with threading multiple jumps through deep cleanups. llvm-svn: 109274
* Rename LazyCleanup -> Cleanup. No functionality change for these last threeJohn McCall2010-07-211-36/+36
| | | | | | commits. llvm-svn: 109000
* Rip out EHCleanupScope.John McCall2010-07-211-45/+6
| | | | llvm-svn: 108999
* Kill the CleanupBlock API.John McCall2010-07-211-63/+0
| | | | llvm-svn: 108998
* Switch finally cleanups over to being lazy cleanups. We get basically nothingJohn McCall2010-07-211-46/+62
| | | | | | | from the laziness features here except better block ordering, but it removes yet another CleanupBlock use. llvm-svn: 108990
* Convert the end-catch call for finally blocks to a lazy cleanup. This kills offJohn McCall2010-07-211-13/+25
| | | | | | the last of the shared-code cleanups. llvm-svn: 108975
* Fix the IR generation for catching pointers by references.John McCall2010-07-201-2/+49
| | | | | | Fixes <rdar://problem/8212123>. llvm-svn: 108944
* The GNU-runtime ObjC personality function doesn't let us rethrow with URR forJohn McCall2010-07-171-43/+66
| | | | | | multiple reasons. Rethrow with _objc_exception_throw instead. Fixes PR7656. llvm-svn: 108595
* Work around an obnoxious GCC warning by changing semantics in a hopefully-John McCall2010-07-131-1/+3
| | | | | | harmless way. llvm-svn: 108295
* Switch the __cxa_rethrow cleanup to be lazy.John McCall2010-07-131-6/+12
| | | | llvm-svn: 108288
* Allow for the possibility that __cxa_end_catch might throw for a catch-all blockJohn McCall2010-07-131-13/+43
| | | | | | | or a catch of a record type by value or reference. Also convert this to a lazy cleanup. llvm-svn: 108287
OpenPOWER on IntegriCloud