From c1d85b931ef9de9ca6e9a840e6c345bc19689b4e Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Sat, 3 Dec 2011 00:54:26 +0000 Subject: Track alignment in AggValueSlot. No functional change in this patch, but I'll be introducing uses of the specified alignment soon. llvm-svn: 145736 --- clang/lib/CodeGen/CGStmt.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'clang/lib/CodeGen/CGStmt.cpp') diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp index 6f020ccab0f..adc0094e611 100644 --- a/clang/lib/CodeGen/CGStmt.cpp +++ b/clang/lib/CodeGen/CGStmt.cpp @@ -772,7 +772,9 @@ void CodeGenFunction::EmitReturnStmt(const ReturnStmt &S) { } else if (RV->getType()->isAnyComplexType()) { EmitComplexExprIntoAddr(RV, ReturnValue, false); } else { - EmitAggExpr(RV, AggValueSlot::forAddr(ReturnValue, Qualifiers(), + unsigned Alignment = + getContext().getTypeAlignInChars(RV->getType()).getQuantity(); + EmitAggExpr(RV, AggValueSlot::forAddr(ReturnValue, Alignment, Qualifiers(), AggValueSlot::IsDestructed, AggValueSlot::DoesNotNeedGCBarriers, AggValueSlot::IsNotAliased)); -- cgit v1.2.3