[cfe-commits] r138624 - in /cfe/trunk: lib/CodeGen/CGExpr.cpp test/CodeGenCXX/exceptions.cpp

John McCall rjmccall at apple.com
Thu Aug 25 22:38:08 PDT 2011


Author: rjmccall
Date: Fri Aug 26 00:38:08 2011
New Revision: 138624

URL: http://llvm.org/viewvc/llvm-project?rev=138624&view=rev
Log:
An initialization does not alias.


Modified:
    cfe/trunk/lib/CodeGen/CGExpr.cpp
    cfe/trunk/test/CodeGenCXX/exceptions.cpp

Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=138624&r1=138623&r2=138624&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Fri Aug 26 00:38:08 2011
@@ -138,7 +138,8 @@
   else if (hasAggregateLLVMType(E->getType()))
     EmitAggExpr(E, AggValueSlot::forAddr(Location, Quals,
                                          AggValueSlot::IsDestructed_t(IsInit),
-                                         AggValueSlot::DoesNotNeedGCBarriers));
+                                         AggValueSlot::DoesNotNeedGCBarriers,
+                                         AggValueSlot::IsAliased_t(!IsInit)));
   else {
     RValue RV = RValue::get(EmitScalarExpr(E, /*Ignore*/ false));
     LValue LV = MakeAddrLValue(Location, E->getType());

Modified: cfe/trunk/test/CodeGenCXX/exceptions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/exceptions.cpp?rev=138624&r1=138623&r2=138624&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/exceptions.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/exceptions.cpp Fri Aug 26 00:38:08 2011
@@ -394,7 +394,11 @@
 // Just don't crash.
 namespace test8 {
   struct A {
+    // Having both of these is required to trigger the assert we're
+    // trying to avoid.
     A(const A&);
+    A&operator=(const A&);
+
     ~A();
   };
 





More information about the cfe-commits mailing list