From 9b1335eca844fb364e78f5de1f5efa968900a120 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Wed, 19 Nov 2008 09:36:46 +0000 Subject: 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. llvm-svn: 59615 --- clang/lib/CodeGen/CodeGenFunction.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'clang/lib/CodeGen/CodeGenFunction.h') diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index 5d99dba69a8..05b2793456b 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/lib/CodeGen/CodeGenFunction.h @@ -32,6 +32,7 @@ namespace llvm { class BasicBlock; class Module; class SwitchInst; + class Value; } namespace clang { @@ -446,8 +447,16 @@ public: 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); -- cgit v1.2.3