diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2008-11-22 18:39:36 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2008-11-22 18:39:36 +0000 |
commit | 5daf570d0ce027e18ed5f9d66e6b2a14a40b720d (patch) | |
tree | e554d26d58de550daf74b397b4e2e894927080df /lib/AST/StmtSerialization.cpp | |
parent | e4c452c4c7b9124fe94a96f559ff077d59cdf996 (diff) |
New AST node to access "implicit" setter/getter using property dor syntax.
Issuing diagnostics when assigning to read-only properties.
This is work in progress.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59874 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/StmtSerialization.cpp')
-rw-r--r-- | lib/AST/StmtSerialization.cpp | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/lib/AST/StmtSerialization.cpp b/lib/AST/StmtSerialization.cpp index 8faef8bb66..2d6f3c7e8a 100644 --- a/lib/AST/StmtSerialization.cpp +++ b/lib/AST/StmtSerialization.cpp @@ -1150,14 +1150,14 @@ ObjCIvarRefExpr* ObjCIvarRefExpr::CreateImpl(Deserializer& D, ASTContext& C) { void ObjCPropertyRefExpr::EmitImpl(Serializer& S) const { S.Emit(Loc); S.Emit(getType()); - unsigned Kind = getKind(); - S.Emit(Kind); - if (Kind == PropertyRef) { - S.EmitPtr(getProperty()); - } else { - S.EmitPtr(getGetterMethod()); - S.EmitPtr(getSetterMethod()); - } + S.EmitPtr(getProperty()); +} + +void ObjCKVCRefExpr::EmitImpl(Serializer& S) const { + S.Emit(Loc); + S.Emit(getType()); + S.EmitPtr(getGetterMethod()); + S.EmitPtr(getSetterMethod()); } ObjCPropertyRefExpr* ObjCPropertyRefExpr::CreateImpl(Deserializer& D, @@ -1165,13 +1165,17 @@ ObjCPropertyRefExpr* ObjCPropertyRefExpr::CreateImpl(Deserializer& D, SourceLocation Loc = SourceLocation::ReadVal(D); QualType T = QualType::ReadVal(D); ObjCPropertyRefExpr* dr = new ObjCPropertyRefExpr(NULL,T,Loc,0); - unsigned Kind = D.ReadInt(); - if (Kind == PropertyRef) { - D.ReadPtr(dr->Referent.AsProperty,false); - } else { - D.ReadPtr(dr->Referent.AsMethod.Setter,false); - D.ReadPtr(dr->Referent.AsMethod.Getter,false); - } + D.ReadPtr(dr->AsProperty,false); + return dr; +} + +ObjCKVCRefExpr* ObjCKVCRefExpr::CreateImpl(Deserializer& D, + ASTContext& C) { + SourceLocation Loc = SourceLocation::ReadVal(D); + QualType T = QualType::ReadVal(D); + ObjCKVCRefExpr* dr = new ObjCKVCRefExpr(NULL,T,Loc,0); + D.ReadPtr(dr->Setter,false); + D.ReadPtr(dr->Getter,false); return dr; } |