aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2012-04-16 03:54:45 +0000
committerEli Friedman <eli.friedman@gmail.com>2012-04-16 03:54:45 +0000
commit377ecc7996dce6803f7b7b6208cab5e197c9c5b8 (patch)
treed45ab5d2d40e6b10f93435df1386dd89451f414d /lib/CodeGen/CodeGenFunction.cpp
parentc5086f08be3c610fd97b541b9d61c1cdfb1f9637 (diff)
Propagate alignment on lvalues through EmitLValueForField. PR12395.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154789 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--lib/CodeGen/CodeGenFunction.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp
index 06e90b6648..9cbba06654 100644
--- a/lib/CodeGen/CodeGenFunction.cpp
+++ b/lib/CodeGen/CodeGenFunction.cpp
@@ -362,8 +362,12 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy,
LambdaThisCaptureField);
if (LambdaThisCaptureField) {
// If this lambda captures this, load it.
- LValue ThisLValue = EmitLValueForField(CXXABIThisValue,
- LambdaThisCaptureField, 0);
+ QualType LambdaTagType =
+ getContext().getTagDeclType(LambdaThisCaptureField->getParent());
+ LValue LambdaLV = MakeNaturalAlignAddrLValue(CXXABIThisValue,
+ LambdaTagType);
+ LValue ThisLValue = EmitLValueForField(LambdaLV,
+ LambdaThisCaptureField);
CXXThisValue = EmitLoadOfLValue(ThisLValue).getScalarVal();
}
} else {