summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGException.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Don't get the exception obj from the slot more than once.Bill Wendling2011-12-081-4/+3
| | | | llvm-svn: 146202
* Switch the Alignment argument on AggValueSlot over to CharUnits, per John's ↵Eli Friedman2011-12-031-1/+1
| | | | | | review comment. llvm-svn: 145741
* Track alignment in AggValueSlot. No functional change in this patch, but ↵Eli Friedman2011-12-031-4/+6
| | | | | | I'll be introducing uses of the specified alignment soon. llvm-svn: 145736
* Whenever explicitly activating or deactivating a cleanup, weJohn McCall2011-11-101-1/+1
| | | | | | | | | | 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
* Don't remove filters.Bill Wendling2011-09-221-7/+3
| | | | | | | | | It's not valid to remove filters from landingpad instructions, even if we catch the type. The metadata won't be set up correctly. Testcase is projects/llvm-test/SingleSource/UnitTests/EH/filter-2.cpp. llvm-svn: 140335
* Don't assume that the clause is a GlobalVariable. It could be a constant.Bill Wendling2011-09-201-13/+11
| | | | llvm-svn: 140123
* The eh.selector intrinsic isn't used anymore. Replace the check here with aBill Wendling2011-09-191-16/+30
| | | | | | | | | check for the landingpad instruction instead. This check looks at each of the clauses in the landingpad instruction. If it's a catch clause, it compares the name directly with the global. If it's a filter clause, it has to look through each value in the filer to see if any have the prefix. llvm-svn: 140075
* Throw the switch to convert clang to the new exception handling model!Bill Wendling2011-09-191-59/+54
| | | | | | | | | | | | | 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. llvm-svn: 140049
* Refactor the load of the exception pointer and the exception selector from theirBill Wendling2011-09-151-13/+18
| | | | | | storage slot into helper functions. llvm-svn: 139826
* Extend the ASTContext constructor to delay the initialization ofDouglas Gregor2011-09-021-1/+1
| | | | | | | | builtin types (When requested). This is another step toward making ASTUnit build the ASTContext as needed when loading an AST file, rather than doing so after the fact. No actual functionality change (yet). llvm-svn: 138985
* Remove unused variables noticed by GCC.Benjamin Kramer2011-08-271-1/+0
| | | | llvm-svn: 138707
* The allocated exception slot does not alias anything; should fix self-host.John McCall2011-08-261-1/+2
| | | | llvm-svn: 138615
* Use stronger typing for the flags on AggValueSlot and requireJohn McCall2011-08-251-2/+3
| | | | | | | creators to tell us whether something needs GC barriers. No functionality change. llvm-svn: 138581
* Simplify EH control flow by observing that EH scopes form a simpleJohn McCall2011-08-111-211/+268
| | | | | | | | | | | | | | | 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
* Remove some unnecessary single element array temporaries.Jay Foad2011-07-291-16/+8
| | | | llvm-svn: 136461
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-6/+6
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* de-constify llvm::Type, patch by David Blaikie!Chris Lattner2011-07-181-19/+19
| | | | llvm-svn: 135370
* Convert CallInst and InvokeInst APIs to use ArrayRef.Jay Foad2011-07-151-8/+7
| | | | llvm-svn: 135265
* Generalize Cleanup::Emit's "isForEH" parameter into a setJohn McCall2011-07-121-5/+5
| | | | | | 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/+4
| | | | | | people write useful cleanup classes. llvm-svn: 134942
* Use cached types; no functionality change.John McCall2011-07-101-35/+18
| | | | llvm-svn: 134880
* clang side to match the LLVM IR type system rewrite patch.Chris Lattner2011-07-091-16/+24
| | | | llvm-svn: 134831
* Call objc_terminate() instead of abort() when a cleanup throws anJohn McCall2011-07-061-2/+11
| | | | | | | exception in Objective-C; in Objective-C++ we still use std::terminate(). This is only available in very recent runtimes. llvm-svn: 134456
* Support for catching objc pointer objects in c++ catch-statementFariborz Jahanian2011-06-231-1/+1
| | | | | | in fragile abi mode and some other cleanups. // rdar://8940528 llvm-svn: 133747
* Alloa catching Objective-C id's being thrown with C++ throwFariborz Jahanian2011-06-221-1/+1
| | | | | | in Darwin's fragile abi mode. // rdar://8940528 llvm-svn: 133639
* 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
OpenPOWER on IntegriCloud