Commit Graph

49 Commits

Author SHA1 Message Date
Mike Stump 9d44fdb397 Fix last patch, catch of reference to non-pointer.
llvm-svn: 92386
2010-01-01 03:20:32 +00:00
Mike Stump 5ee041873b Fix catching a reference to a pointer.
llvm-svn: 92385
2010-01-01 02:51:52 +00:00
Anders Carlsson 61a401caec Pass ReturnValueSlot to EmitCall. No functionality change yet.
llvm-svn: 92138
2009-12-24 19:25:24 +00:00
Mike Stump 4a779b93e4 Cleanup some dead code.
llvm-svn: 92122
2009-12-24 06:52:05 +00:00
Douglas Gregor 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
Anders Carlsson 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
Mike Stump cd8faeb0b1 Ensure we run cleanups for CXXTemporaries on the exceptional edge. WIP.
llvm-svn: 91588
2009-12-17 06:08:47 +00:00
Anders Carlsson 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
Chandler Carruth 8abbc657a9 Silence some release build warnings.
llvm-svn: 91234
2009-12-13 01:37:04 +00:00
Jeffrey Yasskin 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
Anders Carlsson 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
Mike Stump 37077bf651 Fix spacing.
llvm-svn: 91078
2009-12-11 00:02:10 +00:00
Mike Stump 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
Mike Stump 75546b8c88 Fixup spacing.
llvm-svn: 91001
2009-12-10 00:06:18 +00:00
Mike Stump f5cbb08c4b Ensure we only generate one terminate handler.
llvm-svn: 90998
2009-12-10 00:02:42 +00:00
Mike Stump 3b60f034f9 Remove obsolete FIXME and some dead fallback code.
llvm-svn: 90997
2009-12-09 23:52:09 +00:00
Mike Stump 25b20fc2ae Add terminate handler for copy constructors for thrown objects. WIP.
llvm-svn: 90994
2009-12-09 23:31:35 +00:00
Mike Stump 2b488873bf Break out code for reuse. WIP.
llvm-svn: 90991
2009-12-09 22:59:31 +00:00
Mike Stump aff69af918 Add cleanups for exceptional edges. WIP.
llvm-svn: 90940
2009-12-09 03:35:49 +00:00
Mike Stump 4a6b337cfd Add fixme.
llvm-svn: 90884
2009-12-08 22:12:48 +00:00
Mike Stump e6d54ca553 Remove some old code. WIP.
llvm-svn: 90882
2009-12-08 21:46:41 +00:00
Mike Stump 02c23d68cb Fixup catch parameters with class reference type. WIP.
llvm-svn: 90821
2009-12-08 01:29:31 +00:00
Mike Stump 1d849219a5 Add codegen support for exception specifications. WIP.
llvm-svn: 90817
2009-12-07 23:38:24 +00:00
Mike Stump 62afe99814 Work around emitters that can't deal with dead code contexts yet.
llvm-svn: 90796
2009-12-07 20:12:14 +00:00
Mike Stump bee78dd31b Add support for function try blocks.
llvm-svn: 90622
2009-12-04 23:26:17 +00:00
Mike Stump 875912ac13 Fixup nested try blocks.
llvm-svn: 90576
2009-12-04 19:21:57 +00:00
Mike Stump 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
Mike Stump 8c1253b4c2 Try/catch statements seem to be working well enough to turn on.
llvm-svn: 90538
2009-12-04 03:57:07 +00:00
Mike Stump 2ab55765f7 Disable for now, doesn't play nice with the temporary code.
llvm-svn: 90537
2009-12-04 03:55:53 +00:00
Mike Stump 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
Mike Stump 5f141b75f9 These are done.
llvm-svn: 90494
2009-12-03 22:55:42 +00:00
Mike Stump 7398ff0f07 Improve catch parameter bindings for scalar non-pointers. WIP.
llvm-svn: 90492
2009-12-03 22:38:15 +00:00
Mike Stump 2842b4cf86 Reflow.
llvm-svn: 90407
2009-12-03 03:40:14 +00:00
Mike Stump 26ada867ba Remove untrue statement.
llvm-svn: 90377
2009-12-03 01:34:13 +00:00
Mike Stump 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
Mike Stump 90990965e0 Add a cleanup scope for each catch clause.
llvm-svn: 90357
2009-12-02 23:37:16 +00:00
Mike Stump 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
Mike Stump c01c2b87e8 Change rtti/Rtti to RTTI, as it is an acronym.
llvm-svn: 90334
2009-12-02 18:57:08 +00:00
Mike Stump a9a590cd12 Avoid warning for getTerminateFn defined but not used.
llvm-svn: 90330
2009-12-02 18:20:18 +00:00
Mike Stump a510597ef9 terminate doesn't throw.
llvm-svn: 90308
2009-12-02 08:18:09 +00:00
Mike Stump 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
Mike Stump 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
Mike Stump 58ef18b38c Checkpoint current work. WIP.
llvm-svn: 89513
2009-11-20 23:44:51 +00:00
Mike Stump 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
Mike Stump 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
Mike Stump d1782cc478 Add suport for throw;. WIP.
llvm-svn: 89424
2009-11-20 00:56:31 +00:00
Mike Stump 18fc44dfd3 Fix rtti generation for throws. WIP.
llvm-svn: 89420
2009-11-20 00:43:57 +00:00
Anders Carlsson 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
Anders Carlsson 4b08db7a62 Add CGException.cpp, to be used for exception related code generation.
llvm-svn: 85560
2009-10-30 01:42:31 +00:00