diff options
author | John McCall <rjmccall@apple.com> | 2012-07-02 23:58:38 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2012-07-02 23:58:38 +0000 |
commit | e0c1168ec7910a1a7ed08df4d4f0c58c2fa2ecd1 (patch) | |
tree | aed58809e392029eb37c5a12f21da3e0b6156685 /lib/CodeGen/CodeGenFunction.h | |
parent | 109e6de8db5614fa327754a279ca4f0be04dea3f (diff) |
Significantly simplify CGExprAgg's logic about ignored results:
if we want to ignore a result, the Dest will be null. Otherwise,
we must copy into it. This means we need to ensure a slot when
loading from a volatile l-value.
With all that in place, fix a bug with chained assignments into
__block variables of aggregate type where we were losing insight into
the actual source of the value during the second assignment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159630 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.h')
-rw-r--r-- | lib/CodeGen/CodeGenFunction.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h index ab02431636..a3d1acf591 100644 --- a/lib/CodeGen/CodeGenFunction.h +++ b/lib/CodeGen/CodeGenFunction.h @@ -1566,6 +1566,7 @@ public: return LValue::MakeAddr(V, T, Alignment, getContext(), CGM.getTBAAInfo(T)); } + LValue MakeNaturalAlignAddrLValue(llvm::Value *V, QualType T) { CharUnits Alignment; if (!T->isIncompleteType()) @@ -1622,8 +1623,8 @@ public: /// /// \param IgnoreResult - True if the resulting value isn't used. RValue EmitAnyExpr(const Expr *E, - AggValueSlot AggSlot = AggValueSlot::ignored(), - bool IgnoreResult = false); + AggValueSlot aggSlot = AggValueSlot::ignored(), + bool ignoreResult = false); // EmitVAListRef - Emit a "reference" to a va_list; this is either the address // or the value of the expression, depending on how va_list is defined. @@ -1649,7 +1650,7 @@ public: /// volatile. void EmitAggregateCopy(llvm::Value *DestPtr, llvm::Value *SrcPtr, QualType EltTy, bool isVolatile=false, - unsigned Alignment = 0); + CharUnits Alignment = CharUnits::Zero()); /// StartBlock - Start new block named N. If insert block is a dummy block /// then reuse it. @@ -2363,7 +2364,7 @@ public: /// EmitAggExpr - Emit the computation of the specified expression /// of aggregate type. The result is computed into the given slot, /// which may be null to indicate that the value is not needed. - void EmitAggExpr(const Expr *E, AggValueSlot AS, bool IgnoreResult = false); + void EmitAggExpr(const Expr *E, AggValueSlot AS); /// EmitAggExprToLValue - Emit the computation of the specified expression of /// aggregate type into a temporary LValue. |