diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-04-05 20:52:58 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-04-05 20:52:58 +0000 |
commit | e78fac5126cfab4c9bf35d3a478239b38825b17b (patch) | |
tree | 38f6360237fd9031ed0bbdae18629979e7774f5a /clang/lib/CodeGen/CGBlocks.cpp | |
parent | c233ae8004dfa6aa2c420fe16d15bc3f28ed4ac1 (diff) | |
download | bcm5719-llvm-e78fac5126cfab4c9bf35d3a478239b38825b17b.tar.gz bcm5719-llvm-e78fac5126cfab4c9bf35d3a478239b38825b17b.zip |
PR36992: do not store beyond the dsize of a class object unless we know
the tail padding is not reused.
We track on the AggValueSlot (and through a couple of other
initialization actions) whether we're dealing with an object that might
share its tail padding with some other object, so that we can avoid
emitting stores into the tail padding if that's the case. We still
widen stores into tail padding when we can do so.
Differential Revision: https://reviews.llvm.org/D45306
llvm-svn: 329342
Diffstat (limited to 'clang/lib/CodeGen/CGBlocks.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGBlocks.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGBlocks.cpp b/clang/lib/CodeGen/CGBlocks.cpp index 1a6904976fb..4e57e6cd954 100644 --- a/clang/lib/CodeGen/CGBlocks.cpp +++ b/clang/lib/CodeGen/CGBlocks.cpp @@ -929,7 +929,8 @@ llvm::Value *CodeGenFunction::EmitBlockLiteral(const CGBlockInfo &blockInfo) { AggValueSlot::forAddr(blockField, Qualifiers(), AggValueSlot::IsDestructed, AggValueSlot::DoesNotNeedGCBarriers, - AggValueSlot::IsNotAliased); + AggValueSlot::IsNotAliased, + AggValueSlot::DoesNotOverlap); EmitAggExpr(copyExpr, Slot); } else { EmitSynthesizedCXXCopyCtor(blockField, src, copyExpr); |