diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2008-11-22 22:30:21 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2008-11-22 22:30:21 +0000 |
commit | 43f447098d5e6162fbfb97ed38365284207a7fbe (patch) | |
tree | d47eaf5853b61178aa80a6ae24d317553ca1f6ba /lib/CodeGen/CGExpr.cpp | |
parent | 6816856fb1feaf3a8add3d5cd99ec19339849c4e (diff) |
Implemented ir-gen for 'implicit' properties using the new AST nodes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59886 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
-rw-r--r-- | lib/CodeGen/CGExpr.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 4f2bd4871b..4ad698ad11 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -132,6 +132,8 @@ LValue CodeGenFunction::EmitLValue(const Expr *E) { return EmitObjCIvarRefLValue(cast<ObjCIvarRefExpr>(E)); case Expr::ObjCPropertyRefExprClass: return EmitObjCPropertyRefLValue(cast<ObjCPropertyRefExpr>(E)); + case Expr::ObjCKVCRefExprClass: + return EmitObjCKVCRefLValue(cast<ObjCKVCRefExpr>(E)); case Expr::ObjCSuperExprClass: return EmitObjCSuperExpr(cast<ObjCSuperExpr>(E)); @@ -199,6 +201,9 @@ RValue CodeGenFunction::EmitLoadOfLValue(LValue LV, QualType ExprType) { if (LV.isPropertyRef()) return EmitLoadOfPropertyRefLValue(LV, ExprType); + if (LV.isKVCRef()) + return EmitLoadOfKVCRefLValue(LV, ExprType); + assert(0 && "Unknown LValue type!"); //an invalid RValue, but the assert will //ensure that this point is never reached @@ -274,6 +279,11 @@ RValue CodeGenFunction::EmitLoadOfPropertyRefLValue(LValue LV, return EmitObjCPropertyGet(LV.getPropertyRefExpr()); } +RValue CodeGenFunction::EmitLoadOfKVCRefLValue(LValue LV, + QualType ExprType) { + return EmitObjCPropertyGet(LV.getKVCRefExpr()); +} + // If this is a reference to a subset of the elements of a vector, either // shuffle the input or extract/insert them as appropriate. RValue CodeGenFunction::EmitLoadOfExtVectorElementLValue(LValue LV, @@ -357,6 +367,9 @@ void CodeGenFunction::EmitStoreThroughLValue(RValue Src, LValue Dst, if (Dst.isPropertyRef()) return EmitStoreThroughPropertyRefLValue(Src, Dst, Ty); + if (Dst.isKVCRef()) + return EmitStoreThroughKVCRefLValue(Src, Dst, Ty); + assert(0 && "Unknown LValue type"); } @@ -491,6 +504,12 @@ void CodeGenFunction::EmitStoreThroughPropertyRefLValue(RValue Src, EmitObjCPropertySet(Dst.getPropertyRefExpr(), Src); } +void CodeGenFunction::EmitStoreThroughKVCRefLValue(RValue Src, + LValue Dst, + QualType Ty) { + EmitObjCPropertySet(Dst.getKVCRefExpr(), Src); +} + void CodeGenFunction::EmitStoreThroughExtVectorComponentLValue(RValue Src, LValue Dst, QualType Ty) { @@ -973,6 +992,13 @@ CodeGenFunction::EmitObjCPropertyRefLValue(const ObjCPropertyRefExpr *E) { return LValue::MakePropertyRef(E, E->getType().getCVRQualifiers()); } +LValue +CodeGenFunction::EmitObjCKVCRefLValue(const ObjCKVCRefExpr *E) { + // This is a special l-value that just issues sends when we load or + // store through it. + return LValue::MakeKVCRef(E, E->getType().getCVRQualifiers()); +} + LValue CodeGenFunction::EmitObjCSuperExpr(const ObjCSuperExpr *E) { return EmitUnsupportedLValue(E, "use of super"); |