summaryrefslogtreecommitdiffstats
path: root/clang/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
commit7f1ff60021c534cef6372c693b42498fd34bde3c (patch)
treea7c4ffe90f62922e36db0031f5138574d362234a /clang/lib/CodeGen/CodeGenFunction.cpp
parent1ac08679fd6b34b06e26c6fbac1fcbe8cc404a1a (diff)
downloadbcm5719-llvm-7f1ff60021c534cef6372c693b42498fd34bde3c.tar.gz
bcm5719-llvm-7f1ff60021c534cef6372c693b42498fd34bde3c.zip
Propagate alignment on lvalues through EmitLValueForField. PR12395.
llvm-svn: 154789
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 06e90b66485..9cbba066547 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/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 {
OpenPOWER on IntegriCloud