From 410ffb2bc5f072d58a73c14560345bcf77dec1cc Mon Sep 17 00:00:00 2001 From: John McCall Date: Thu, 25 Aug 2011 23:04:34 +0000 Subject: Track whether an AggValueSlot is potentially aliased, and do not emit call results into potentially aliased slots. This allows us to properly mark indirect return slots as noalias, at the cost of requiring an extra memcpy when assigning an aggregate call result into a l-value. It also brings us into compliance with the x86-64 ABI. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138599 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGClass.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lib/CodeGen/CGClass.cpp') diff --git a/lib/CodeGen/CGClass.cpp b/lib/CodeGen/CGClass.cpp index 8e46fcd3ed..8bdfbf1231 100644 --- a/lib/CodeGen/CGClass.cpp +++ b/lib/CodeGen/CGClass.cpp @@ -401,7 +401,8 @@ static void EmitBaseInitializer(CodeGenFunction &CGF, AggValueSlot AggSlot = AggValueSlot::forAddr(V, Qualifiers(), AggValueSlot::IsDestructed, - AggValueSlot::DoesNotNeedGCBarriers); + AggValueSlot::DoesNotNeedGCBarriers, + AggValueSlot::IsNotAliased); CGF.EmitAggExpr(BaseInit->getInit(), AggSlot); @@ -441,7 +442,8 @@ static void EmitAggMemberInitializer(CodeGenFunction &CGF, AggValueSlot Slot = AggValueSlot::forAddr(Dest, LHS.getQuals(), AggValueSlot::IsDestructed, - AggValueSlot::DoesNotNeedGCBarriers); + AggValueSlot::DoesNotNeedGCBarriers, + AggValueSlot::IsNotAliased); CGF.EmitAggExpr(MemberInit->getInit(), Slot); } @@ -1330,7 +1332,8 @@ CodeGenFunction::EmitDelegatingCXXConstructorCall(const CXXConstructorDecl *Ctor AggValueSlot AggSlot = AggValueSlot::forAddr(ThisPtr, Qualifiers(), AggValueSlot::IsDestructed, - AggValueSlot::DoesNotNeedGCBarriers); + AggValueSlot::DoesNotNeedGCBarriers, + AggValueSlot::IsNotAliased); EmitAggExpr(Ctor->init_begin()[0]->getInit(), AggSlot); -- cgit v1.2.3-70-g09d2