summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGException.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Switch the __cxa_free_exception cleanup to be lazy.John McCall2010-07-131-16/+32
| | | | llvm-svn: 108276
* Teach IR generation how to lazily emit cleanups. This has a lot of advantages,John McCall2010-07-131-14/+69
| | | | | | | | | | | | | | | 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. llvm-svn: 108270
* Teach function-try-blocks on constructors and destructors to implicitlyJohn McCall2010-07-071-8/+18
| | | | | | rethrow. Fixes rdar://problem/7696603 llvm-svn: 107757
* Validated by nightly-test runs on x86 and x86-64 darwin, including afterJohn McCall2010-07-061-409/+1084
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Remove unnecessary ASTContext parameter fromDouglas Gregor2010-07-011-1/+1
| | | | | | CXXRecordDecl::getDestructor(); no functionality change. llvm-svn: 107394
* finally get around to doing a significant cleanup to irgen:Chris Lattner2010-06-271-7/+4
| | | | | | | | have CGF create and make accessible standard int32,int64 and intptr types. This fixes a ton of 80 column violations introduced by LLVMContextification and cleans up stuff a lot. llvm-svn: 106977
* Fix personality function name when using SjLj exceptions.Daniel Dunbar2010-05-281-2/+5
| | | | llvm-svn: 104999
* Fix an ambiguous else warning from GCC by adding some much needed curlies.Chandler Carruth2010-05-171-2/+3
| | | | llvm-svn: 103972
* Pick the correct personality function based on the language. This prevents ↵David Chisnall2010-05-171-25/+26
| | | | | | | | link failures when C/ObjC code uses __attribute__((cleanup())) (previously this was inserting references to two libstc++ symbols; the personality function and the __terminate() function). This is still probably wrong for Objective-C++ and adds a couple of lines in CGException that should probably be in the CGObjCRuntime subclass. The personality function is now only looked up in one place in CGException though, so this should be easier to fix in the future. llvm-svn: 103938
* When initializing thread-safe statics, put the call toDouglas Gregor2010-05-161-11/+11
| | | | | | | | | | | | | __cxa_guard_abort along the exceptional edge into (in effect) a nested "try" that rethrows after aborting. Fixes PR7144 and the remaining Boost.ProgramOptions failures, along with the regressions that r103880 caused. The crucial difference between this and r103880 is that we now follow LLVM's little dance with the llvm.eh.exception and llvm.eh.selector calls, then use _Unwind_Resume_or_Rethrow to rethrow. llvm-svn: 103892
* Revert r103880 (thread-safe static initialization w/ exceptions),Douglas Gregor2010-05-161-16/+11
| | | | | | because it's causing strange linker errors. Unfixes PR7144. llvm-svn: 103890
* When initializing thread-safe statics, put the call toDouglas Gregor2010-05-151-11/+16
| | | | | | | | __cxa_guard_abort along the exceptional edge into (in effect) a nested "try" that rethrows after aborting. Fixes PR7144 and the remaining Boost.ProgramOptions failures. llvm-svn: 103880
* Fix -fno-rtti -fexceptions by forcing the emission of (non-"builtin") RTTIJohn McCall2010-04-301-3/+3
| | | | | | when used by the exceptions routines. Fixes PR 6974. llvm-svn: 102684
* Teach EHCleanupBlock to deal appropriately with the possibility that thereJohn McCall2010-04-301-1/+5
| | | | | | might not have been an insertion block set at start. Fixes PR6975. llvm-svn: 102677
* Call PerformCopyInitialization to properly initialize the exception temporaryJohn McCall2010-04-221-82/+78
| | | | | | | | | 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
* Miscellaneous codegen cleanups. Mostly, don't create new basic blocksJohn McCall2010-04-211-30/+35
| | | | | | | just to save the current insertion state! This change significantly simplifies the IR CFG in exceptions code. llvm-svn: 101996
* Replace some SmallVectors with arrays.Benjamin Kramer2010-03-181-21/+13
| | | | llvm-svn: 98833
* More refactoring around constructor/destructor code generation.John McCall2010-02-191-45/+23
| | | | | | | | | | | | Fix some bugs with function-try-blocks and simplify normal try-block code generation. This implementation excludes a deleting destructor's call to operator delete() from the function-try-block, which I believe is correct but which I can't find straightforward support for at a moment's glance. llvm-svn: 96670
* Switch to using -fsjlj-exceptions instead of hard-coding it. Notably, this fixesDaniel Dunbar2010-02-101-5/+1
| | | | | | | calls to the UnwindResumeOrRethrow function for C++/Obj-C exception handling, for Darwin ARM. llvm-svn: 95787
* Make sure to set vtable pointers in the destructors as well.Anders Carlsson2010-02-071-0/+1
| | | | llvm-svn: 95525
* Make EmitStartEHSpec and EmitEndEHSpec return early when exceptions are ↵Anders Carlsson2010-02-061-0/+6
| | | | | | disabled. llvm-svn: 95509
* Standardize the parsing of function type attributes in a way thatJohn McCall2010-02-051-6/+7
| | | | | | | | | | | | follows (as conservatively as possible) gcc's current behavior: attributes written on return types that don't apply there are applied to the function instead, etc. Only parse CC attributes as type attributes, not as decl attributes; don't accepet noreturn as a decl attribute on ValueDecls, either (it still needs to apply to other decls, like blocks). Consistently consume CC/noreturn information throughout codegen; enforce this by removing their default values in CodeGenTypes::getFunctionInfo(). llvm-svn: 95436
* Fix last patch, catch of reference to non-pointer.Mike Stump2010-01-011-10/+12
| | | | llvm-svn: 92386
* Fix catching a reference to a pointer.Mike Stump2010-01-011-3/+15
| | | | llvm-svn: 92385
* Pass ReturnValueSlot to EmitCall. No functionality change yet.Anders Carlsson2009-12-241-2/+2
| | | | llvm-svn: 92138
* Cleanup some dead code.Mike Stump2009-12-241-3/+1
| | | | llvm-svn: 92122
* There is no such thing as typeinfo for a cv-qualified type. AssertDouglas Gregor2009-12-231-2/+7
| | | | | | | | that this is true when mangling, then fix up the various places in Sema and/or CodeGen that need to remove qualifiers. Addresses a linking issue when building LLVM with Clang. llvm-svn: 92064
* Rename GetAddrOfRTTI to GetAddrOfRTTIDescriptor. Remove the overload that ↵Anders Carlsson2009-12-171-5/+5
| | | | | | takes a CXXRecordDecl since we were just creating a QualType from it anyway. llvm-svn: 91590
* Ensure we run cleanups for CXXTemporaries on the exceptional edge. WIP.Mike Stump2009-12-171-1/+21
| | | | llvm-svn: 91588
* Use GetAddrOfRTTI everywhere and remove GenerateRTTI and GenerateRTTIRef. ↵Anders Carlsson2009-12-161-5/+4
| | | | | | With this change, we can now compile and link TableGen. llvm-svn: 91520
* Silence some release build warnings.Chandler Carruth2009-12-131-0/+1
| | | | llvm-svn: 91234
* Un-namespace-qualify llvm_unreachable. It's a macro, so the qualification gaveJeffrey Yasskin2009-12-121-2/+2
| | | | | | no extra safety anyway. llvm-svn: 91207
* When an exception needs to be freed by calling __cxa_exception_free, make ↵Anders Carlsson2009-12-111-12/+20
| | | | | | | | 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
* Fix spacing.Mike Stump2009-12-111-1/+1
| | | | llvm-svn: 91078
* Setup cleanup on eh edge out of the construction of the cleanup objectMike Stump2009-12-101-12/+6
| | | | | | during throw to deallocate the exception object. WIP. llvm-svn: 91035
* Fixup spacing.Mike Stump2009-12-101-41/+41
| | | | llvm-svn: 91001
* Ensure we only generate one terminate handler.Mike Stump2009-12-101-1/+4
| | | | llvm-svn: 90998
* Remove obsolete FIXME and some dead fallback code.Mike Stump2009-12-091-6/+0
| | | | llvm-svn: 90997
* Add terminate handler for copy constructors for thrown objects. WIP.Mike Stump2009-12-091-2/+16
| | | | llvm-svn: 90994
* Break out code for reuse. WIP.Mike Stump2009-12-091-22/+39
| | | | llvm-svn: 90991
* Add cleanups for exceptional edges. WIP.Mike Stump2009-12-091-0/+52
| | | | llvm-svn: 90940
* Add fixme.Mike Stump2009-12-081-0/+1
| | | | llvm-svn: 90884
* Remove some old code. WIP.Mike Stump2009-12-081-5/+0
| | | | llvm-svn: 90882
* Fixup catch parameters with class reference type. WIP.Mike Stump2009-12-081-1/+1
| | | | llvm-svn: 90821
* Add codegen support for exception specifications. WIP.Mike Stump2009-12-071-0/+119
| | | | llvm-svn: 90817
* Work around emitters that can't deal with dead code contexts yet.Mike Stump2009-12-071-0/+4
| | | | llvm-svn: 90796
* Add support for function try blocks.Mike Stump2009-12-041-1/+35
| | | | llvm-svn: 90622
* Fixup nested try blocks.Mike Stump2009-12-041-2/+12
| | | | llvm-svn: 90576
* Fix warning and be sure to set up the rethrow pointer if we fall offMike Stump2009-12-041-3/+5
| | | | | | the end of all the catches. llvm-svn: 90574
* Try/catch statements seem to be working well enough to turn on.Mike Stump2009-12-041-1/+1
| | | | llvm-svn: 90538
OpenPOWER on IntegriCloud