forked from OSchip/llvm-project
Fix for PR2001. I'm not really fond of it, but it is correct (unless
someone tries to make a bitfield volatile?). Not sure how to write a test; any suggestions? llvm-svn: 51558
This commit is contained in:
parent
0e56c82e4a
commit
292e98cc18
|
@ -768,6 +768,11 @@ Value *ScalarExprEmitter::EmitCompoundAssign(const CompoundAssignOperator *E,
|
|||
// Store the result value into the LHS lvalue.
|
||||
CGF.EmitStoreThroughLValue(RValue::get(Result), LHSLV, E->getType());
|
||||
|
||||
// For bitfields, we need the value in the bitfield
|
||||
// FIXME: This adds an extra bitfield load
|
||||
if (LHSLV.isBitfield())
|
||||
Result = EmitLoadOfLValue(LHSLV, LHSTy);
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
||||
|
@ -963,7 +968,11 @@ Value *ScalarExprEmitter::VisitBinAssign(const BinaryOperator *E) {
|
|||
// Store the value into the LHS.
|
||||
// FIXME: Volatility!
|
||||
CGF.EmitStoreThroughLValue(RValue::get(RHS), LHS, E->getType());
|
||||
|
||||
|
||||
// For bitfields, we need the value in the bitfield
|
||||
// FIXME: This adds an extra bitfield load
|
||||
if (LHS.isBitfield())
|
||||
return EmitLoadOfLValue(LHS, E->getLHS()->getType());
|
||||
// Return the RHS.
|
||||
return RHS;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue