Commit Graph

189 Commits

Author SHA1 Message Date
Eli Friedman f4258eb484 Switch CallArgList from an std::pair to a new CallArg struct (which will eventually gain more members). Working towards modifying call emission to avoid unnecessary copies.
llvm-svn: 130700
2011-05-02 18:05:27 +00:00
Eli Friedman 43dca6a8d2 Simplify code a bit by using CallArgList::add. No intended functionality change.
llvm-svn: 130699
2011-05-02 17:57:46 +00:00
Alexis Hunt 61bc173784 Fully implement delegating constructors!
As far as I know, this implementation is complete but might be missing a
few optimizations. Exceptions and virtual bases are handled correctly.

Because I'm an optimist, the web page has appropriately been updated. If
I'm wrong, feel free to downgrade its support categories.

llvm-svn: 130642
2011-05-01 07:04:31 +00:00
Argyrios Kyrtzidis 03535265ef Cut down unnecessary zero'ing when value-initializing arrays of C++ objects.
-C++ objects with user-declared constructor don't need zero'ing.
-We can zero-initialize arrays of C++ objects in "bulk" now, in which case don't zero-initialize each object again.

llvm-svn: 130453
2011-04-28 22:57:55 +00:00
John McCall 0009fcc39e Make yet another placeholder type, this one marking that an expression is a bound
member function, i.e. something of the form 'x.f' where 'f' is a non-static
member function.  Diagnose this in the general case.  Some of the new diagnostics
are probably worse than the old ones, but we now get this right much more
universally, and there's certainly room for improvement in the diagnostics.

llvm-svn: 130239
2011-04-26 20:42:42 +00:00
Anders Carlsson 940f02d248 Clean up code generation of typeid expressions and add C++ standard references.
llvm-svn: 129682
2011-04-18 00:57:03 +00:00
Anders Carlsson bbe277c4a9 Use EmitCallOrInvoke in EmitBadTypeidCall and EmitBadCastCall.
llvm-svn: 129424
2011-04-13 02:35:36 +00:00
Anders Carlsson 0c63350b0b If there's an invoke destination, we should use invoke instead of call when calling the __cxa_bad_typeid function. Fixes PR7400.
llvm-svn: 129273
2011-04-11 14:13:40 +00:00
John McCall 2d2e870745 More __unknown_anytype work.
llvm-svn: 129269
2011-04-11 07:02:50 +00:00
Anders Carlsson c1c9971cab When we know that a dynamic_cast always returns null, we can make
CodeGenFunction::EmitDynamicCast always return null or throw a bad_cast 
exception.

llvm-svn: 129264
2011-04-11 01:45:29 +00:00
Anders Carlsson 882d790f72 Clean up CodeGenFunction::EmitDynamicCast. No functionality change.
llvm-svn: 129262
2011-04-11 00:46:40 +00:00
Anders Carlsson 98981b10c8 Replace a couple of Builder.CreateICmpEQ with Builder.CreateIsNull. No functionality change.
llvm-svn: 129261
2011-04-11 00:30:07 +00:00
Anders Carlsson c53d9e8350 Strip off parens and no-op casts when deciding if an expr can be devirtualized. Fixes the second half of PR9660.
llvm-svn: 129253
2011-04-10 18:20:53 +00:00
Eli Friedman db42a3e876 Make sure we or together the overflow flags of the multiply and add, so the
check is triggered appropriately.  Reported on cfe-dev.

llvm-svn: 129231
2011-04-09 19:54:33 +00:00
Jay Foad 20c0f02cc5 Remove PHINode::reserveOperandSpace(). Instead, add a parameter to
PHINode::Create() giving the (known or expected) number of operands.

llvm-svn: 128538
2011-03-30 11:28:58 +00:00
Sebastian Redl 31ad754c96 Instead of storing an ASTContext* in FunctionProtoTypes with computed noexcept specifiers, unique FunctionProtoTypes with a ContextualFoldingSet, as suggested by John McCall.
llvm-svn: 127568
2011-03-13 17:09:40 +00:00
Sebastian Redl fa453cfdc3 Propagate the new exception information to FunctionProtoType.
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
2011-03-12 11:50:43 +00:00
John McCall 32ea969415 Use a slightly more semantic interface for emitting call arguments.
llvm-svn: 127494
2011-03-11 20:59:21 +00:00
John McCall 75f9498a7c The conditional needs to be pushed before the branch. Make the test less
trivial to check this.  Adjust for style.

llvm-svn: 127151
2011-03-07 03:12:35 +00:00
John McCall f7dcf320a7 An operator new with an empty exception specifier returns null on a bad
allocation and therefore requires a null-check.  We were doing that, but
we weren't treating the new-initializer as being conditionally executed,
which means it was possible to get ill-formed IR as in PR9298.

llvm-svn: 127147
2011-03-07 01:52:56 +00:00
Tilmann Scheller 99cc30c371 Revert "Add CC_Win64ThisCall and set it in the necessary places."
This reverts commit 126863.

llvm-svn: 126886
2011-03-02 21:36:49 +00:00
Tilmann Scheller 454464b491 Add CC_Win64ThisCall and set it in the necessary places.
llvm-svn: 126863
2011-03-02 19:36:23 +00:00
John McCall ad7c5c1657 Reorganize CodeGen{Function,Module} to eliminate the unfortunate
Block{Function,Module} base class.  Minor other refactorings.

Fixed a few address-space bugs while I was there.

llvm-svn: 125085
2011-02-08 08:22:06 +00:00
Fariborz Jahanian 7f6f81ba9b Clean up of -fapple-kext abi code. No change otherwise.
llvm-svn: 124807
2011-02-03 19:27:17 +00:00
Fariborz Jahanian 265c325ef3 -fapple-kext support for indirect call to virtuals dtors - wip.
llvm-svn: 124701
2011-02-01 23:22:34 +00:00
Anders Carlsson 6b3afd7df1 When trying to get the most derived class, don't assume that we can ignore all casts. We can only ignore derived-to-base and no-op casts. Fixes selfhost.
llvm-svn: 124528
2011-01-29 05:04:11 +00:00
Anders Carlsson 1ae64c5a9d When calling a virtual member function on a base class and the most derived class is marked 'final', we can devirtualize the call.
llvm-svn: 124524
2011-01-29 03:52:01 +00:00
Fariborz Jahanian 9f9438b314 More work to support -fapple-kext regarding
indirect vf calls and addition of extra entry
at bottom of vtbls.

llvm-svn: 124507
2011-01-28 23:42:29 +00:00
John McCall ed1ae86ac6 Move all the cleanups framework code into a single file.
Pure motion.

llvm-svn: 124484
2011-01-28 11:13:47 +00:00
John McCall cb5f77f046 Reorganize the value-dominance metaprogram and introduce a specialization
for CodeGen's RValue type.

llvm-svn: 124483
2011-01-28 10:53:53 +00:00
John McCall e4df6c8d96 Convert the exception-freeing cleanup over to the conditional cleanups code,
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
2011-01-28 08:37:24 +00:00
John McCall 284c48fff6 Do a proper recursive lookup when deciding whether a class's usual
deallocation function has a two-argument form.  Store the result of this
check in new[] and delete[] nodes.

Fixes rdar://problem/8913519

llvm-svn: 124373
2011-01-27 09:37:56 +00:00
Anders Carlsson 1eb95961d3 Use attributes for all the override control specifiers.
llvm-svn: 124122
2011-01-24 16:26:15 +00:00
Anders Carlsson 19588aa40b Get rid of the [[final]] C++0x attribute.
llvm-svn: 124083
2011-01-23 21:07:30 +00:00
Fariborz Jahanian 252a47f635 Move cheking of kext into canDevirtualizeMemberFunctionCalls().
Improve on test case. Per Doug's comment. wip.

llvm-svn: 123954
2011-01-21 01:04:41 +00:00
Fariborz Jahanian 47609b088c apple kext abi requires all vf calls, including qualified
vf calls, be made indirect. This patch is towards that goal.

llvm-svn: 123922
2011-01-20 17:19:02 +00:00
Ken Dyck 705ba07ef0 Replace calls to getTypeSize() and getTypeAlign() with their 'InChars'
counterparts where char units are needed.

llvm-svn: 123805
2011-01-19 01:58:38 +00:00
Francois Pichet 6422579411 Add support for explicit constructor calls in Microsoft mode.
For example: 

class A{ 
public:
  A& operator=(const A& that) {
      if (this != &that) {
          this->A::~A();
          this->A::A(that);  // <=== explicit constructor call.
      }
      return *this;
  }
};

More work will be needed to support an explicit call to a template constructor.

llvm-svn: 123735
2011-01-18 05:04:39 +00:00
Benjamin Kramer acc6b4e2fd Simplify mem{cpy, move, set} creation with IRBuilder.
llvm-svn: 122634
2010-12-30 00:13:21 +00:00
Jay Foad 6d4db0c885 PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() and
zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method
trunc(), to be const and to return a new value instead of modifying the
object in place.

llvm-svn: 121121
2010-12-07 08:25:34 +00:00
John McCall 5d41378146 Rename CXXExprWithTemporaries -> ExprWithCleanups; there's no theoretical
reason this is limited to C++, and it's certainly not limited to temporaries.

llvm-svn: 120996
2010-12-06 08:20:24 +00:00
John McCall e26a872b02 Remove some defensive calls to EmitLoadOfPropertyRefLValue that shouldn't
be required, and then fix up some missing loads on overloaded-operator
paths which that exposed.

llvm-svn: 120896
2010-12-04 08:14:53 +00:00
John McCall f3eb96fccf Kill the KVC l-value kind and calculate the base expression when emitting
the l-value.

llvm-svn: 120884
2010-12-04 02:32:38 +00:00
Fariborz Jahanian 50198098b9 IR Gen. part of API support for __block cxx
objects imported into blocks. //rdar://8594790.
Will have a test case coming (as well as one
sent to llvm test suite).

llvm-svn: 120713
2010-12-02 17:02:11 +00:00
Chandler Carruth 99da11cf04 Silence an unused variable warning during release builds by folding the
expression into the assert.

llvm-svn: 119143
2010-11-15 13:54:43 +00:00
Fariborz Jahanian e988bdac44 Block API patch to do copy ctor of copied-in cxx objects in
copy helper function and dtor of copied cxx objects
in dispose helper functions. __block variables
TBD next.

llvm-svn: 119011
2010-11-13 21:53:34 +00:00
Anders Carlsson b00c2144b3 Also devirtualize calls to a member functions where the containing class has been marked final.
llvm-svn: 117445
2010-10-27 13:34:43 +00:00
Anders Carlsson a7911fa3d7 If a virtual member function has the 'final' attribute, we can devirtualize calls to it.
llvm-svn: 117444
2010-10-27 13:28:46 +00:00
Dan Gohman 8fc50c296a Factor out the code for emitting code to load vtable pointer members
so that it's done in one place.

llvm-svn: 117386
2010-10-26 18:44:08 +00:00
Fariborz Jahanian c123623d28 After discussion with Doug and John, I am reverting
the patch. 

llvm-svn: 117159
2010-10-22 22:05:03 +00:00
Fariborz Jahanian 0196aa28ec Patch fixes miscompile with non-trivial copy constructors and
statement expressions, //rdar: //8540501

llvm-svn: 117146
2010-10-22 21:01:02 +00:00
Devang Patel 401c916c8a Delay record type's debug info emission, in -flimit-debug-info mode, if member expression's base is call expr.
llvm-svn: 117127
2010-10-22 18:56:27 +00:00
Benjamin Kramer fb5e584151 More class anonymization.
llvm-svn: 117106
2010-10-22 16:48:22 +00:00
Devang Patel 91bbb5547d Introduce -flimit-debug-info.
In this experimental mode try avoiding debug info emission for classes as much as possible. The goal is to reduce size of produced debuginfo without reducing quality of debug info in general. This is a work in progress.

llvm-svn: 115188
2010-09-30 19:05:55 +00:00
Douglas Gregor ec3bec0c7a Kill FunctionDecl's IsCopyAssignment bit; it duplicated what could
already be determined by isCopyAssignmentOperator(), and was set too
late in the process for all clients to see the appropriate
value. Cleanup only; no functionality change.

llvm-svn: 114916
2010-09-27 22:37:28 +00:00
John McCall 8ea46b6654 Fix a bug with binding l-values to elided temporaries, and leave a couple
helpful asserts behind.

llvm-svn: 114250
2010-09-18 00:58:34 +00:00
John McCall 7f9c92a9a0 When emitting a new-expression inside a conditional expression,
the cleanup might not be dominated by the allocation code.
In this case, we have to store aside all the delete arguments
in case we need them later.  There's room for optimization here
in cases where we end up not actually needing the cleanup in
different branches (or being able to pop it after the
initialization code).

Also make sure we only call this operator delete along the path
where we actually allocated something.

Fixes rdar://problem/8439196.

llvm-svn: 114145
2010-09-17 00:50:28 +00:00
John McCall 7a626f63f7 one piece of code is responsible for the lifetime of every aggregate
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
2010-09-15 10:14:12 +00:00
John McCall d441b1e637 Tweak this assert.
llvm-svn: 113863
2010-09-14 21:45:42 +00:00
John McCall 824c2f537c Implement the EH cleanup to call 'operator delete' if a new-expression throws
(but not if destructors associated with the full-expression throw).

llvm-svn: 113836
2010-09-14 07:57:04 +00:00
Fariborz Jahanian f93ac89414 IRGen fix for using property-dot syntax to pass
reference object to a c++ member function.
fixes radar 8409336.

llvm-svn: 113602
2010-09-10 18:56:35 +00:00
John McCall 0d635f53a8 Re-commit r112916 with an additional fix for the self-host failures.
I've audited the remaining getFunctionInfo call sites.

llvm-svn: 112936
2010-09-03 01:26:39 +00:00
John McCall c32f94b4ce Revert r112916, it's breaking selfhost pretty badly.
llvm-svn: 112925
2010-09-03 00:40:45 +00:00
John McCall 12d3891a27 It's not safe to use the generic CXXMethodDecl overload of CGT::getFunctionInfo
to set up a destructor call, because ABIs can tweak these conventions.
Fixes rdar://problem/8386802.

llvm-svn: 112916
2010-09-03 00:01:57 +00:00
Douglas Gregor 040ad500c4 Fix a few more ConvertTypes that should be ConvertTypeForMems, fixing
two regressions in Boost.Config.

llvm-svn: 112908
2010-09-02 23:24:14 +00:00
Douglas Gregor 04f3621860 Revert my two IRgen fixes for "bool", then use a far simpler approach
based on ConvertTypeForMem. Thanks to John for pointing out the right
solution.

llvm-svn: 112838
2010-09-02 17:38:50 +00:00
Douglas Gregor 262e4e2ab5 Fix more i1/i8 pointer madness. Here, an overactive assertion
complains when the element type of a C++ "delete" expression is
different from what we would expect from the pointer type. When
deleting a bool*, we end up with an i1 on one side (where we compute
the LLVM type from the Clang bool type) and i8 on the other (where we
grab the LLVM type from the LLVM pointer type). I've weakened the
assertion appropriately, and the Boost Parallel Graph Library now
passes its regression tests.

llvm-svn: 112821
2010-09-02 15:34:35 +00:00
John McCall 8ed55a54fd Abstract IR generation of array cookies into the C++ ABI class and
implement ARM array cookies.  Also fix a few unfortunate bugs:
  - throwing dtors in deletes prevented the allocation from being deleted
  - adding the cookie to the new[] size was not being considered for
    overflow (and, more seriously, was screwing up the earlier checks)
  - deleting an array via a pointer to array of class type was not
    causing any destructors to be run and was passing the unadjusted
    pointer to the deallocator
  - lots of address-space problems, in case anyone wants to support
    free store in a variant address space :)

llvm-svn: 112814
2010-09-02 09:58:18 +00:00
Fariborz Jahanian 61a312413c Fix IRGen when property-dot syntax used to access
a c++ class object 'ivar'. Fixes radar 8366604.

llvm-svn: 112729
2010-09-01 19:36:41 +00:00
John McCall 5d865c3292 Teach IR generation to return 'this' from constructors and destructors
under the ARM ABI.

llvm-svn: 112588
2010-08-31 07:33:07 +00:00
Sebastian Redl 50c682585f Rename DeclContext::getLookupContext to getRedeclContext and change its semantics slightly. No functionality change in the absence of inline namespaces. Also, change a few places where inline namespaces actually make a difference to be prepared for them.
llvm-svn: 112563
2010-08-31 00:36:30 +00:00
Argyrios Kyrtzidis 7648fb464b Fix miscompilation. The cookie was not used when new'ing arrays with multiple dimensions.
llvm-svn: 112188
2010-08-26 15:23:38 +00:00
John McCall e302792b61 GCC didn't care for my attempt at API compatibility, so brute-force everything
to the new constants.

llvm-svn: 112047
2010-08-25 11:45:40 +00:00
John McCall aa4149a2aa Extract a method to check whether a function is the global placement
operator new[].

llvm-svn: 111788
2010-08-23 01:17:59 +00:00
John McCall 614dbdcd55 Go back to asking CodeGenTypes whether a type is zero-initializable.
Make CGT defer to the ABI on all member pointer types.
This requires giving CGT a handle to the ABI.
It's way easier to make that work if we avoid lazily creating the ABI.
Make it so.

llvm-svn: 111786
2010-08-22 21:01:12 +00:00
Douglas Gregor 630c76efb0 When performing value-initialization for a class with a non-trivial,
implicitly-defined default constructor, zero-initialize the memory
before calling the default constructor. Previously, we would only
zero-initialize in the case of a trivial default constructor.

Also, simplify the hideous logic that determines when we have a
trivial default constructor and, therefore, don't need to emit any
call at all.

llvm-svn: 111779
2010-08-22 16:15:35 +00:00
John McCall a1dee5300b Experiment with using first-class aggregates to represent member function
pointers.  I find the resulting code to be substantially cleaner, and it
makes it very easy to use the same APIs for data member pointers (which I have
conscientiously avoided here), and it avoids a plethora of potential
inefficiencies due to excessive memory copying, but we'll have to see if it
actually works.

llvm-svn: 111776
2010-08-22 10:59:02 +00:00
John McCall 84fa510aa9 Abstract more member-pointerness out.
llvm-svn: 111771
2010-08-22 04:16:24 +00:00
John McCall 475999dcf9 Extract calls to method pointers out as an ABI routine.
No functionality change.

llvm-svn: 111752
2010-08-22 00:05:51 +00:00
Daniel Dunbar 0381634a61 IRgen: Change Emit{Load,Store}OfScalar to take a required Alignment argument and
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
2010-08-21 02:24:36 +00:00
Douglas Gregor e3b3464d4e Fix a major regression with value-initialization of class types with
trivial default constructors. We're weren't zero-initializing them,
which manifested as <rdar://problem/8320532> (a regression in the GCC
test suite) and is likely to have caused significant other breakage.

llvm-svn: 111650
2010-08-20 16:57:37 +00:00
Douglas Gregor 05fc5be32f Implement zero-initialization for array new when there is an
initializer of (). Make sure to use a simple memset() when we can, or
fall back to generating a loop when a simple memset will not
suffice. Fixes <rdar://problem/8212208>, a regression due to my work
in r107857.

llvm-svn: 108977
2010-07-21 01:10:17 +00:00
Chris Lattner 32ac583d91 in 'new int[4]', constant fold the 4*4=16 instead of
doing an overflow check.

llvm-svn: 108943
2010-07-20 21:55:52 +00:00
Chris Lattner f2f3870189 Follow the implementation approach suggested by PR6687,
which generates more efficient and more obviously conformant
code.  We now test for overflow of the multiply then force
the result to -1 if so.  On X86, this generates nice code
like this:

__Z4testl:                              ## @_Z4testl
## BB#0:                                ## %entry
	subl	$12, %esp
	movl	$4, %eax
	mull	16(%esp)
	testl	%edx, %edx
	movl	$-1, %ecx
	cmovel	%eax, %ecx
	movl	%ecx, (%esp)
	call	__Znam
	addl	$12, %esp
	ret

llvm-svn: 108927
2010-07-20 21:07:09 +00:00
Chris Lattner 26008e07de implement rdar://5739832 - operator new should check for overflow in multiply,
causing clang to compile this code into something that correctly throws a
length error, fixing a potential integer overflow security attack:

void *test(long N) {
  return new int[N];
}

int main() {
  test(1L << 62);
}

We do this even when exceptions are disabled, because it is better for the
code to abort than for the attack to succeed.

This is heavily based on a patch that Fariborz wrote.

llvm-svn: 108915
2010-07-20 20:19:24 +00:00
Chris Lattner b7a95cf165 delete a loop that just generates dead code. In an example
like this:

void *test(long N) {
  return new int[N][42][42];
}

the loop generates two dead mul instructions:

  %tmp = load i64* %N.addr                        ; <i64> [#uses=2]
  %0 = mul i64 %tmp, 7056                         ; <i64> [#uses=1]
  %1 = mul i64 %tmp, 42                           ; <i64> [#uses=1]
  %2 = mul i64 %1, 42                             ; <i64> [#uses=0]
  %call = call noalias i8* @_Znam(i64 %0)         ; <i8*> [#uses=1]

The scale of these multiplies is already handled by the typesize stuff.

llvm-svn: 108884
2010-07-20 18:49:33 +00:00
Chris Lattner cb46bdc34f remove the special case for constant array sizes from
EmitCXXNewAllocSize.  This code uses IRBuilder, which does
constant folding already.

llvm-svn: 108882
2010-07-20 18:45:57 +00:00
Douglas Gregor 747eb7840a Reinstate the fix for PR7556. A silly use of isTrivial() was
suppressing copies of objects with trivial copy constructors.

llvm-svn: 107857
2010-07-08 06:14:04 +00:00
Douglas Gregor e182370eda Revert r107828 and r107827, the fix for PR7556, which seems to be
breaking bootstrap on Linux.

llvm-svn: 107837
2010-07-07 23:37:33 +00:00
Douglas Gregor 442612c285 Do not use CXXZeroValueInitExpr for class types. Instead, use
CXXConstructExpr/CXXTemporaryObjectExpr/CXXNewExpr as
appropriate. Fixes PR7556, and provides a slide codegen improvement
when copy-initializing a POD class type from a value-initialized
temporary. Previously, we weren't eliding the copy.

llvm-svn: 107827
2010-07-07 22:35:13 +00:00
Douglas Gregor bac7490ffc Remove unnecessary ASTContext parameter from
CXXRecordDecl::getDestructor(); no functionality change.

llvm-svn: 107394
2010-07-01 14:13:13 +00:00
Fariborz Jahanian b66b08ef01 Minor change to my last patch to fix PR7490.
llvm-svn: 106875
2010-06-25 20:01:13 +00:00
Fariborz Jahanian d5202e0926 IRGen for trivial initialization of dynamiccaly allocated
array of other done c++ objects. Fixes PR7490.

llvm-svn: 106869
2010-06-25 18:26:07 +00:00
Fariborz Jahanian 021510e96f Patch adds support for copying of those
objective-c++ class objects which have GC'able objc object
pointers and need to use ObjC's objc_memmove_collectable
API (radar 8070772). 

llvm-svn: 106061
2010-06-15 22:44:06 +00:00
Fariborz Jahanian 60d215b6fd Adds support for generation of objc_memmove_collectable API
in Objective-C++ mode.

llvm-svn: 104281
2010-05-20 21:38:57 +00:00
Fariborz Jahanian 6855ba2c95 Copy construction of non-trivial properties must not
be turned into a setter call (fixes radar 8008649).

llvm-svn: 104235
2010-05-20 16:46:55 +00:00
Fariborz Jahanian 1b8b8bf25f Minor twik to my last patch. (for radar 7986354).
llvm-svn: 103889
2010-05-16 00:10:46 +00:00
Fariborz Jahanian e1b45a5e6b Fix API gen for objc_msgSend property of aggregate types
in Objective-c++ mode. Fixes radar 7986354.

llvm-svn: 103887
2010-05-15 23:05:52 +00:00
Douglas Gregor 222cf0efbc Recognize when the named return value optimization applies in a
"return" statement and mark the corresponding CXXConstructExpr as
elidable. Teach CodeGen that eliding a temporary is different from
eliding an object construction.

This is just a baby step toward NRVO.

llvm-svn: 103849
2010-05-15 00:13:29 +00:00
Douglas Gregor fa8b4955bb When a failed dynamic_cast<T&> (which is an lvalue) results in a
throw, it should use invoke when needed. The fixes the
Boost.Statechrt failures that motivated PR7132, but there are a few
side issues to tackle as well.

llvm-svn: 103803
2010-05-14 21:14:41 +00:00