966e934b34 
								
							 
						 
						
							
							
								
								Replace some SmallVectors with arrays.  
							
							... 
							
							
							
							llvm-svn: 98833 
							
						 
						
							2010-03-18 16:59:57 +00:00  
				
					
						
							
							
								 
						
							
								b81884d347 
								
							 
						 
						
							
							
								
								More refactoring around constructor/destructor code generation.  
							
							... 
							
							
							
							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 
							
						 
						
							2010-02-19 09:25:03 +00:00  
				
					
						
							
							
								 
						
							
								3241d400c8 
								
							 
						 
						
							
							
								
								Switch to using -fsjlj-exceptions instead of hard-coding it. Notably, this fixes  
							
							... 
							
							
							
							calls to the UnwindResumeOrRethrow function for C++/Obj-C exception handling,
for Darwin ARM.
llvm-svn: 95787 
							
						 
						
							2010-02-10 18:49:11 +00:00  
				
					
						
							
							
								 
						
							
								ff8cce4395 
								
							 
						 
						
							
							
								
								Make sure to set vtable pointers in the destructors as well.  
							
							... 
							
							
							
							llvm-svn: 95525 
							
						 
						
							2010-02-07 19:45:40 +00:00  
				
					
						
							
							
								 
						
							
								9878f9f73b 
								
							 
						 
						
							
							
								
								Make EmitStartEHSpec and EmitEndEHSpec return early when exceptions are disabled.  
							
							... 
							
							
							
							llvm-svn: 95509 
							
						 
						
							2010-02-06 23:59:05 +00:00  
				
					
						
							
							
								 
						
							
								ab26cfa58d 
								
							 
						 
						
							
							
								
								Standardize the parsing of function type attributes in a way that  
							
							... 
							
							
							
							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 
							
						 
						
							2010-02-05 21:31:56 +00:00  
				
					
						
							
							
								 
						
							
								9d44fdb397 
								
							 
						 
						
							
							
								
								Fix last patch, catch of reference to non-pointer.  
							
							... 
							
							
							
							llvm-svn: 92386 
							
						 
						
							2010-01-01 03:20:32 +00:00  
				
					
						
							
							
								 
						
							
								5ee041873b 
								
							 
						 
						
							
							
								
								Fix catching a reference to a pointer.  
							
							... 
							
							
							
							llvm-svn: 92385 
							
						 
						
							2010-01-01 02:51:52 +00:00  
				
					
						
							
							
								 
						
							
								61a401caec 
								
							 
						 
						
							
							
								
								Pass ReturnValueSlot to EmitCall. No functionality change yet.  
							
							... 
							
							
							
							llvm-svn: 92138 
							
						 
						
							2009-12-24 19:25:24 +00:00  
				
					
						
							
							
								 
						
							
								4a779b93e4 
								
							 
						 
						
							
							
								
								Cleanup some dead code.  
							
							... 
							
							
							
							llvm-svn: 92122 
							
						 
						
							2009-12-24 06:52:05 +00:00  
				
					
						
							
							
								 
						
							
								247894b361 
								
							 
						 
						
							
							
								
								There is no such thing as typeinfo for a cv-qualified type. Assert  
							
							... 
							
							
							
							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 
							
						 
						
							2009-12-23 22:04:40 +00:00  
				
					
						
							
							
								 
						
							
								3f4336cb1f 
								
							 
						 
						
							
							
								
								Rename GetAddrOfRTTI to GetAddrOfRTTIDescriptor. Remove the overload that takes a CXXRecordDecl since we were just creating a QualType from it anyway.  
							
							... 
							
							
							
							llvm-svn: 91590 
							
						 
						
							2009-12-17 07:09:17 +00:00  
				
					
						
							
							
								 
						
							
								cd8faeb0b1 
								
							 
						 
						
							
							
								
								Ensure we run cleanups for CXXTemporaries on the exceptional edge.  WIP.  
							
							... 
							
							
							
							llvm-svn: 91588 
							
						 
						
							2009-12-17 06:08:47 +00:00  
				
					
						
							
							
								 
						
							
								07863b8b6e 
								
							 
						 
						
							
							
								
								Use GetAddrOfRTTI everywhere and remove GenerateRTTI and GenerateRTTIRef. With this change, we can now compile and link TableGen.  
							
							... 
							
							
							
							llvm-svn: 91520 
							
						 
						
							2009-12-16 07:05:41 +00:00  
				
					
						
							
							
								 
						
							
								8abbc657a9 
								
							 
						 
						
							
							
								
								Silence some release build warnings.  
							
							... 
							
							
							
							llvm-svn: 91234 
							
						 
						
							2009-12-13 01:37:04 +00:00  
				
					
						
							
							
								 
						
							
								1615d45daa 
								
							 
						 
						
							
							
								
								Un-namespace-qualify llvm_unreachable. It's a macro, so the qualification gave  
							
							... 
							
							
							
							no extra safety anyway.
llvm-svn: 91207 
							
						 
						
							2009-12-12 05:05:38 +00:00  
				
					
						
							
							
								 
						
							
								afd1edb52e 
								
							 
						 
						
							
							
								
								When an exception needs to be freed by calling __cxa_exception_free, make 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 
							
						 
						
							2009-12-11 00:32:37 +00:00  
				
					
						
							
							
								 
						
							
								37077bf651 
								
							 
						 
						
							
							
								
								Fix spacing.  
							
							... 
							
							
							
							llvm-svn: 91078 
							
						 
						
							2009-12-11 00:02:10 +00:00  
				
					
						
							
							
								 
						
							
								3c6a12ca65 
								
							 
						 
						
							
							
								
								Setup cleanup on eh edge out of the construction of the cleanup object  
							
							... 
							
							
							
							during throw to deallocate the exception object.  WIP.
llvm-svn: 91035 
							
						 
						
							2009-12-10 01:52:30 +00:00  
				
					
						
							
							
								 
						
							
								75546b8c88 
								
							 
						 
						
							
							
								
								Fixup spacing.  
							
							... 
							
							
							
							llvm-svn: 91001 
							
						 
						
							2009-12-10 00:06:18 +00:00  
				
					
						
							
							
								 
						
							
								f5cbb08c4b 
								
							 
						 
						
							
							
								
								Ensure we only generate one terminate handler.  
							
							... 
							
							
							
							llvm-svn: 90998 
							
						 
						
							2009-12-10 00:02:42 +00:00  
				
					
						
							
							
								 
						
							
								3b60f034f9 
								
							 
						 
						
							
							
								
								Remove obsolete FIXME and some dead fallback code.  
							
							... 
							
							
							
							llvm-svn: 90997 
							
						 
						
							2009-12-09 23:52:09 +00:00  
				
					
						
							
							
								 
						
							
								25b20fc2ae 
								
							 
						 
						
							
							
								
								Add terminate handler for copy constructors for thrown objects.  WIP.  
							
							... 
							
							
							
							llvm-svn: 90994 
							
						 
						
							2009-12-09 23:31:35 +00:00  
				
					
						
							
							
								 
						
							
								2b488873bf 
								
							 
						 
						
							
							
								
								Break out code for reuse.  WIP.  
							
							... 
							
							
							
							llvm-svn: 90991 
							
						 
						
							2009-12-09 22:59:31 +00:00  
				
					
						
							
							
								 
						
							
								aff69af918 
								
							 
						 
						
							
							
								
								Add cleanups for exceptional edges.  WIP.  
							
							... 
							
							
							
							llvm-svn: 90940 
							
						 
						
							2009-12-09 03:35:49 +00:00  
				
					
						
							
							
								 
						
							
								4a6b337cfd 
								
							 
						 
						
							
							
								
								Add fixme.  
							
							... 
							
							
							
							llvm-svn: 90884 
							
						 
						
							2009-12-08 22:12:48 +00:00  
				
					
						
							
							
								 
						
							
								e6d54ca553 
								
							 
						 
						
							
							
								
								Remove some old code.  WIP.  
							
							... 
							
							
							
							llvm-svn: 90882 
							
						 
						
							2009-12-08 21:46:41 +00:00  
				
					
						
							
							
								 
						
							
								02c23d68cb 
								
							 
						 
						
							
							
								
								Fixup catch parameters with class reference type.  WIP.  
							
							... 
							
							
							
							llvm-svn: 90821 
							
						 
						
							2009-12-08 01:29:31 +00:00  
				
					
						
							
							
								 
						
							
								1d849219a5 
								
							 
						 
						
							
							
								
								Add codegen support for exception specifications.  WIP.  
							
							... 
							
							
							
							llvm-svn: 90817 
							
						 
						
							2009-12-07 23:38:24 +00:00  
				
					
						
							
							
								 
						
							
								62afe99814 
								
							 
						 
						
							
							
								
								Work around emitters that can't deal with dead code contexts yet.  
							
							... 
							
							
							
							llvm-svn: 90796 
							
						 
						
							2009-12-07 20:12:14 +00:00  
				
					
						
							
							
								 
						
							
								bee78dd31b 
								
							 
						 
						
							
							
								
								Add support for function try blocks.  
							
							... 
							
							
							
							llvm-svn: 90622 
							
						 
						
							2009-12-04 23:26:17 +00:00  
				
					
						
							
							
								 
						
							
								875912ac13 
								
							 
						 
						
							
							
								
								Fixup nested try blocks.  
							
							... 
							
							
							
							llvm-svn: 90576 
							
						 
						
							2009-12-04 19:21:57 +00:00  
				
					
						
							
							
								 
						
							
								5c820758f5 
								
							 
						 
						
							
							
								
								Fix warning and be sure to set up the rethrow pointer if we fall off  
							
							... 
							
							
							
							the end of all the catches.
llvm-svn: 90574 
							
						 
						
							2009-12-04 19:03:47 +00:00  
				
					
						
							
							
								 
						
							
								8c1253b4c2 
								
							 
						 
						
							
							
								
								Try/catch statements seem to be working well enough to turn on.  
							
							... 
							
							
							
							llvm-svn: 90538 
							
						 
						
							2009-12-04 03:57:07 +00:00  
				
					
						
							
							
								 
						
							
								2ab55765f7 
								
							 
						 
						
							
							
								
								Disable for now, doesn't play nice with the temporary code.  
							
							... 
							
							
							
							llvm-svn: 90537 
							
						 
						
							2009-12-04 03:55:53 +00:00  
				
					
						
							
							
								 
						
							
								114ab9f695 
								
							 
						 
						
							
							
								
								Fixup reference binding for catch parameters.  
							
							... 
							
							
							
							Fixup throws and rethrows to use invoke as appropriate.
llvm-svn: 90513 
							
						 
						
							2009-12-04 01:51:45 +00:00  
				
					
						
							
							
								 
						
							
								5f141b75f9 
								
							 
						 
						
							
							
								
								These are done.  
							
							... 
							
							
							
							llvm-svn: 90494 
							
						 
						
							2009-12-03 22:55:42 +00:00  
				
					
						
							
							
								 
						
							
								7398ff0f07 
								
							 
						 
						
							
							
								
								Improve catch parameter bindings for scalar non-pointers.  WIP.  
							
							... 
							
							
							
							llvm-svn: 90492 
							
						 
						
							2009-12-03 22:38:15 +00:00  
				
					
						
							
							
								 
						
							
								2842b4cf86 
								
							 
						 
						
							
							
								
								Reflow.  
							
							... 
							
							
							
							llvm-svn: 90407 
							
						 
						
							2009-12-03 03:40:14 +00:00  
				
					
						
							
							
								 
						
							
								26ada867ba 
								
							 
						 
						
							
							
								
								Remove untrue statement.  
							
							... 
							
							
							
							llvm-svn: 90377 
							
						 
						
							2009-12-03 01:34:13 +00:00  
				
					
						
							
							
								 
						
							
								2d52ce5f94 
								
							 
						 
						
							
							
								
								Cleanups on exceptional edges don't work at all, yet.  This doesn't  
							
							... 
							
							
							
							catch very many of them and if we caught all of them, the errors would
be annoying.  I'm working on this next.  WIP.
llvm-svn: 90358 
							
						 
						
							2009-12-02 23:46:02 +00:00  
				
					
						
							
							
								 
						
							
								90990965e0 
								
							 
						 
						
							
							
								
								Add a cleanup scope for each catch clause.  
							
							... 
							
							
							
							llvm-svn: 90357 
							
						 
						
							2009-12-02 23:37:16 +00:00  
				
					
						
							
							
								 
						
							
								9732915bf9 
								
							 
						 
						
							
							
								
								Pull the terminate handler up so that we can use it for the catch  
							
							... 
							
							
							
							parameter setup code and set up the catch parameter setup code to
protect that code with terminate.
llvm-svn: 90340 
							
						 
						
							2009-12-02 19:53:57 +00:00  
				
					
						
							
							
								 
						
							
								c01c2b87e8 
								
							 
						 
						
							
							
								
								Change rtti/Rtti to RTTI, as it is an acronym.  
							
							... 
							
							
							
							llvm-svn: 90334 
							
						 
						
							2009-12-02 18:57:08 +00:00  
				
					
						
							
							
								 
						
							
								a9a590cd12 
								
							 
						 
						
							
							
								
								Avoid warning for getTerminateFn defined but not used.  
							
							... 
							
							
							
							llvm-svn: 90330 
							
						 
						
							2009-12-02 18:20:18 +00:00  
				
					
						
							
							
								 
						
							
								a510597ef9 
								
							 
						 
						
							
							
								
								terminate doesn't throw.  
							
							... 
							
							
							
							llvm-svn: 90308 
							
						 
						
							2009-12-02 08:18:09 +00:00  
				
					
						
							
							
								 
						
							
								33270211a0 
								
							 
						 
						
							
							
								
								More exception handling improvements...  WIP.  
							
							... 
							
							
							
							Highlights include:
  Add a helper to generate __cxa_free_exception and _ZSt9terminatev.
  Add a region to handle EH object deallocation for ctor failures for throw.
  Add a terminate handler for __cxa_end_catch.
  A framework for adding cleanup actions for the exceptional edges only.
llvm-svn: 90305 
							
						 
						
							2009-12-02 07:41:41 +00:00  
				
					
						
							
							
								 
						
							
								5406614be9 
								
							 
						 
						
							
							
								
								Much work on try/catch statement.  WIP.  
							
							... 
							
							
							
							Highlights include:
  Fix __cxa_begin_catch so it now returns a value.
  Added getUnwindResumeOrRethrowFn helper to build up calls to
  _Unwind_Resume_or_Rethrow.
  Broke out object copying code into CopyObject from EmitCXXThrowExpr.
  Built up another version of CopyObject that can copy from memory for
  use in the catch parameter code.
  RTTI generation for type matching for catch.
  Code to check for the type match for catch.
  Code to generate the catch parameter, WIP, need make sure references
  and pointers and copy ctors work.
llvm-svn: 90205 
							
						 
						
							2009-12-01 03:41:18 +00:00  
				
					
						
							
							
								 
						
							
								58ef18b38c 
								
							 
						 
						
							
							
								
								Checkpoint current work.  WIP.  
							
							... 
							
							
							
							llvm-svn: 89513 
							
						 
						
							2009-11-20 23:44:51 +00:00  
				
					
						
							
							
								 
						
							
								d8d26d06a5 
								
							 
						 
						
							
							
								
								Implement throw d, where d is a class type that requires copy  
							
							... 
							
							
							
							construction.  WIP.
llvm-svn: 89442 
							
						 
						
							2009-11-20 02:31:07 +00:00  
				
					
						
							
							
								 
						
							
								4d7a07bdaf 
								
							 
						 
						
							
							
								
								Handle throw d, where d is a class type but only has a trivial copy  
							
							... 
							
							
							
							constructor.  WIP.
llvm-svn: 89438 
							
						 
						
							2009-11-20 01:57:39 +00:00  
				
					
						
							
							
								 
						
							
								d1782cc478 
								
							 
						 
						
							
							
								
								Add suport for throw;.  WIP.  
							
							... 
							
							
							
							llvm-svn: 89424 
							
						 
						
							2009-11-20 00:56:31 +00:00  
				
					
						
							
							
								 
						
							
								18fc44dfd3 
								
							 
						 
						
							
							
								
								Fix rtti generation for throws.  WIP.  
							
							... 
							
							
							
							llvm-svn: 89420 
							
						 
						
							2009-11-20 00:43:57 +00:00  
				
					
						
							
							
								 
						
							
								32e1b1c169 
								
							 
						 
						
							
							
								
								Get throws limping along, still a bunch of FIXMEs. Too bad we don't support catching anything yet :)  
							
							... 
							
							
							
							llvm-svn: 85574 
							
						 
						
							2009-10-30 02:27:02 +00:00  
				
					
						
							
							
								 
						
							
								4b08db7a62 
								
							 
						 
						
							
							
								
								Add CGException.cpp, to be used for exception related code generation.  
							
							... 
							
							
							
							llvm-svn: 85560 
							
						 
						
							2009-10-30 01:42:31 +00:00