diff options
author | Daniel Dunbar <daniel@zuster.org> | 2008-08-29 08:11:39 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2008-08-29 08:11:39 +0000 |
commit | 85c59edda02df48fae8dc85049743319bc6e7e89 (patch) | |
tree | b27f7f79c96e1ccc0793e561e4ea6cfc4dc9218d /lib/CodeGen/CGValue.h | |
parent | d70900be3c0b56e961d5890cca2baf2fc76f0274 (diff) |
Add special "property reference" CodeGen::LValue type for emitting
Objective-C property references.
- This handles property references "more correctly" but setters still
don't work.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55534 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGValue.h')
-rw-r--r-- | lib/CodeGen/CGValue.h | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/lib/CodeGen/CGValue.h b/lib/CodeGen/CGValue.h index ba4ea0e6c8..bc9a15fe9f 100644 --- a/lib/CodeGen/CGValue.h +++ b/lib/CodeGen/CGValue.h @@ -18,6 +18,8 @@ #include "clang/AST/Type.h" namespace clang { + class ObjCPropertyRefExpr; + namespace CodeGen { /// RValue - This trivial value class is used to represent the result of an @@ -95,7 +97,9 @@ class LValue { Simple, // This is a normal l-value, use getAddress(). VectorElt, // This is a vector element l-value (V[i]), use getVector* BitField, // This is a bitfield l-value, use getBitfield*. - ExtVectorElt // This is an extended vector subset, use getExtVectorComp + ExtVectorElt, // This is an extended vector subset, use getExtVectorComp + PropertyRef // This is an Objective-C property reference, use + // getPropertyRefExpr } LVType; llvm::Value *V; @@ -113,6 +117,9 @@ class LValue { unsigned short Size; bool IsSigned; } BitfieldData; + + // Obj-C property reference expression + const ObjCPropertyRefExpr *PropertyRefExpr; }; bool Volatile:1; @@ -130,7 +137,8 @@ public: bool isVectorElt() const { return LVType == VectorElt; } bool isBitfield() const { return LVType == BitField; } bool isExtVectorElt() const { return LVType == ExtVectorElt; } - + bool isPropertyRef() const { return LVType == PropertyRef; } + bool isVolatileQualified() const { return Volatile; } bool isRestrictQualified() const { return Restrict; } @@ -159,6 +167,11 @@ public: assert(isBitfield()); return BitfieldData.IsSigned; } + // property ref lvalue + const ObjCPropertyRefExpr *getPropertyRefExpr() const { + assert(isPropertyRef()); + return PropertyRefExpr; + } static LValue MakeAddr(llvm::Value *V, unsigned Qualifiers) { LValue R; @@ -200,6 +213,15 @@ public: SetQualifiers(Qualifiers,R); return R; } + + static LValue MakePropertyRef(const ObjCPropertyRefExpr *E, + unsigned Qualifiers) { + LValue R; + R.LVType = PropertyRef; + R.PropertyRefExpr = E; + SetQualifiers(Qualifiers,R); + return R; + } }; } // end namespace CodeGen |