aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenFunction.h
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2012-03-28 23:30:44 +0000
committerJohn McCall <rjmccall@apple.com>2012-03-28 23:30:44 +0000
commit57cd1b89cd91433ce1991a5bff36fe776a263796 (patch)
tree9d65d25e15649b8487c5a4e9fda2910c1a7dce74 /lib/CodeGen/CodeGenFunction.h
parentb684a42154a555206a33ac47a52ad2a306cfa2b4 (diff)
When we can't prove that the target of an aggregate copy is
a complete object, the memcpy needs to use the data size of the structure instead of its sizeof() value. Fixes PR12204. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153613 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.h')
-rw-r--r--lib/CodeGen/CodeGenFunction.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h
index 85cbd143d8..9acfc5e93c 100644
--- a/lib/CodeGen/CodeGenFunction.h
+++ b/lib/CodeGen/CodeGenFunction.h
@@ -1596,7 +1596,9 @@ public:
T.getQualifiers(),
AggValueSlot::IsNotDestructed,
AggValueSlot::DoesNotNeedGCBarriers,
- AggValueSlot::IsNotAliased);
+ AggValueSlot::IsNotAliased,
+ AggValueSlot::IsCompleteObject,
+ AggValueSlot::IsNotZeroed);
}
/// Emit a cast to void* in the appropriate address space.
@@ -1628,9 +1630,10 @@ public:
RValue EmitAnyExprToTemp(const Expr *E);
/// EmitAnyExprToMem - Emits the code necessary to evaluate an
- /// arbitrary expression into the given memory location.
+ /// arbitrary expression as an initialization of the given memory
+ /// location.
void EmitAnyExprToMem(const Expr *E, llvm::Value *Location,
- Qualifiers Quals, bool IsInitializer);
+ Qualifiers Quals);
/// EmitExprAsInit - Emits the code necessary to initialize a
/// location in memory with the given initializer.
@@ -1641,9 +1644,12 @@ public:
///
/// \param isVolatile - True iff either the source or the destination is
/// volatile.
+ /// \param destIsCompleteObject - True if the destination is known to be
+ /// a complete object.
void EmitAggregateCopy(llvm::Value *DestPtr, llvm::Value *SrcPtr,
QualType EltTy, bool isVolatile=false,
- unsigned Alignment = 0);
+ unsigned alignment = 0,
+ bool destIsCompleteObject = false);
/// StartBlock - Start new block named N. If insert block is a dummy block
/// then reuse it.