Fix redundant load of bit-fields on assignment (to get the updated
value).
- Use extra argument to EmitStoreThroughLValue to provide place to
write update bit-field value if caller requires it.
- This fixes several FIXMEs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59615 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h
index 5d99dba..05b2793 100644
--- a/lib/CodeGen/CodeGenFunction.h
+++ b/lib/CodeGen/CodeGenFunction.h
@@ -32,6 +32,7 @@
class BasicBlock;
class Module;
class SwitchInst;
+ class Value;
}
namespace clang {
@@ -446,8 +447,16 @@
void EmitStoreThroughLValue(RValue Src, LValue Dst, QualType Ty);
void EmitStoreThroughExtVectorComponentLValue(RValue Src, LValue Dst,
QualType Ty);
- void EmitStoreThroughBitfieldLValue(RValue Src, LValue Dst, QualType Ty);
void EmitStoreThroughPropertyRefLValue(RValue Src, LValue Dst, QualType Ty);
+
+ /// EmitStoreThroughLValue - Store Src into Dst with same
+ /// constraints as EmitStoreThroughLValue.
+ ///
+ /// \param Result [out] - If non-null, this will be set to a Value*
+ /// for the bit-field contents after the store, appropriate for use
+ /// as the result of an assignment to the bit-field.
+ void EmitStoreThroughBitfieldLValue(RValue Src, LValue Dst, QualType Ty,
+ llvm::Value **Result=0);
// Note: only availabe for agg return types
LValue EmitBinaryOperatorLValue(const BinaryOperator *E);