diff options
Diffstat (limited to 'lib/CodeGen/CGValue.h')
-rw-r--r-- | lib/CodeGen/CGValue.h | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/lib/CodeGen/CGValue.h b/lib/CodeGen/CGValue.h index fa77471..91fb714 100644 --- a/lib/CodeGen/CGValue.h +++ b/lib/CodeGen/CGValue.h @@ -27,6 +27,7 @@ namespace clang { class ObjCImplicitSetterGetterRefExpr; namespace CodeGen { + class CGBitFieldInfo; /// RValue - This trivial value class is used to represent the result of an /// expression that is evaluated. It can be one of three things: either a @@ -128,14 +129,11 @@ class LValue { llvm::Constant *VectorElts; // BitField start bit and size - struct { - unsigned short StartBit; - unsigned short Size; - bool IsSigned; - } BitfieldData; + const CGBitFieldInfo *BitFieldInfo; // Obj-C property reference expression const ObjCPropertyRefExpr *PropertyRefExpr; + // ObjC 'implicit' property reference expression const ObjCImplicitSetterGetterRefExpr *KVCRefExpr; }; @@ -170,7 +168,7 @@ private: public: bool isSimple() const { return LVType == Simple; } bool isVectorElt() const { return LVType == VectorElt; } - bool isBitfield() const { return LVType == BitField; } + bool isBitField() const { return LVType == BitField; } bool isExtVectorElt() const { return LVType == ExtVectorElt; } bool isPropertyRef() const { return LVType == PropertyRef; } bool isKVCRef() const { return LVType == KVCRef; } @@ -209,29 +207,28 @@ public: // simple lvalue llvm::Value *getAddress() const { assert(isSimple()); return V; } + // vector elt lvalue llvm::Value *getVectorAddr() const { assert(isVectorElt()); return V; } llvm::Value *getVectorIdx() const { assert(isVectorElt()); return VectorIdx; } + // extended vector elements. llvm::Value *getExtVectorAddr() const { assert(isExtVectorElt()); return V; } llvm::Constant *getExtVectorElts() const { assert(isExtVectorElt()); return VectorElts; } + // bitfield lvalue - llvm::Value *getBitfieldAddr() const { assert(isBitfield()); return V; } - unsigned short getBitfieldStartBit() const { - assert(isBitfield()); - return BitfieldData.StartBit; - } - unsigned short getBitfieldSize() const { - assert(isBitfield()); - return BitfieldData.Size; + llvm::Value *getBitFieldAddr() const { + assert(isBitField()); + return V; } - bool isBitfieldSigned() const { - assert(isBitfield()); - return BitfieldData.IsSigned; + const CGBitFieldInfo &getBitFieldInfo() const { + assert(isBitField()); + return *BitFieldInfo; } + // property ref lvalue const ObjCPropertyRefExpr *getPropertyRefExpr() const { assert(isPropertyRef()); @@ -272,15 +269,12 @@ public: return R; } - static LValue MakeBitfield(llvm::Value *V, unsigned short StartBit, - unsigned short Size, bool IsSigned, + static LValue MakeBitfield(llvm::Value *V, const CGBitFieldInfo &Info, unsigned CVR) { LValue R; R.LVType = BitField; R.V = V; - R.BitfieldData.StartBit = StartBit; - R.BitfieldData.Size = Size; - R.BitfieldData.IsSigned = IsSigned; + R.BitFieldInfo = &Info; R.SetQualifiers(Qualifiers::fromCVRMask(CVR)); return R; } |