mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-01 09:41:08 +00:00
Renamed ClassProp data member of ObjCImplctSetterGetterRefExpr
to InterfaceDecl, as it is unrelated to any property and holds the InterfaceDecl needed for accessing class getter/setter methods using the dot-syntax. llvm-svn: 79371
This commit is contained in:
parent
ee81dca8c7
commit
19380c4b88
@ -279,7 +279,7 @@ class ObjCImplctSetterGetterRefExpr : public Expr {
|
|||||||
SourceLocation Loc;
|
SourceLocation Loc;
|
||||||
// FIXME: Swizzle these into a single pointer.
|
// FIXME: Swizzle these into a single pointer.
|
||||||
Stmt *Base;
|
Stmt *Base;
|
||||||
ObjCInterfaceDecl *ClassProp;
|
ObjCInterfaceDecl *InterfaceDecl;
|
||||||
SourceLocation ClassLoc;
|
SourceLocation ClassLoc;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -288,7 +288,7 @@ public:
|
|||||||
ObjCMethodDecl *setter,
|
ObjCMethodDecl *setter,
|
||||||
SourceLocation l, Expr *base)
|
SourceLocation l, Expr *base)
|
||||||
: Expr(ObjCImplctSetterGetterRefExprClass, t), Setter(setter),
|
: Expr(ObjCImplctSetterGetterRefExprClass, t), Setter(setter),
|
||||||
Getter(getter), Loc(l), Base(base), ClassProp(0),
|
Getter(getter), Loc(l), Base(base), InterfaceDecl(0),
|
||||||
ClassLoc(SourceLocation()) {
|
ClassLoc(SourceLocation()) {
|
||||||
}
|
}
|
||||||
ObjCImplctSetterGetterRefExpr(ObjCMethodDecl *getter,
|
ObjCImplctSetterGetterRefExpr(ObjCMethodDecl *getter,
|
||||||
@ -296,17 +296,17 @@ public:
|
|||||||
ObjCMethodDecl *setter,
|
ObjCMethodDecl *setter,
|
||||||
SourceLocation l, ObjCInterfaceDecl *C, SourceLocation CL)
|
SourceLocation l, ObjCInterfaceDecl *C, SourceLocation CL)
|
||||||
: Expr(ObjCImplctSetterGetterRefExprClass, t), Setter(setter),
|
: Expr(ObjCImplctSetterGetterRefExprClass, t), Setter(setter),
|
||||||
Getter(getter), Loc(l), Base(0), ClassProp(C), ClassLoc(CL) {
|
Getter(getter), Loc(l), Base(0), InterfaceDecl(C), ClassLoc(CL) {
|
||||||
}
|
}
|
||||||
explicit ObjCImplctSetterGetterRefExpr(EmptyShell Empty)
|
explicit ObjCImplctSetterGetterRefExpr(EmptyShell Empty)
|
||||||
: Expr(ObjCImplctSetterGetterRefExprClass, Empty){}
|
: Expr(ObjCImplctSetterGetterRefExprClass, Empty){}
|
||||||
|
|
||||||
ObjCMethodDecl *getGetterMethod() const { return Getter; }
|
ObjCMethodDecl *getGetterMethod() const { return Getter; }
|
||||||
ObjCMethodDecl *getSetterMethod() const { return Setter; }
|
ObjCMethodDecl *getSetterMethod() const { return Setter; }
|
||||||
ObjCInterfaceDecl *getClassProp() const { return ClassProp; }
|
ObjCInterfaceDecl *getInterfaceDecl() const { return InterfaceDecl; }
|
||||||
void setGetterMethod(ObjCMethodDecl *D) { Getter = D; }
|
void setGetterMethod(ObjCMethodDecl *D) { Getter = D; }
|
||||||
void setSetterMethod(ObjCMethodDecl *D) { Setter = D; }
|
void setSetterMethod(ObjCMethodDecl *D) { Setter = D; }
|
||||||
void setClassProp(ObjCInterfaceDecl *D) { ClassProp = D; }
|
void setInterfaceDecl(ObjCInterfaceDecl *D) { InterfaceDecl = D; }
|
||||||
|
|
||||||
virtual SourceRange getSourceRange() const {
|
virtual SourceRange getSourceRange() const {
|
||||||
if (Base)
|
if (Base)
|
||||||
|
@ -588,7 +588,7 @@ void StmtProfiler::VisitObjCImplctSetterGetterRefExpr(
|
|||||||
VisitExpr(S);
|
VisitExpr(S);
|
||||||
VisitDecl(S->getGetterMethod());
|
VisitDecl(S->getGetterMethod());
|
||||||
VisitDecl(S->getSetterMethod());
|
VisitDecl(S->getSetterMethod());
|
||||||
VisitDecl(S->getClassProp());
|
VisitDecl(S->getInterfaceDecl());
|
||||||
}
|
}
|
||||||
|
|
||||||
void StmtProfiler::VisitObjCMessageExpr(ObjCMessageExpr *S) {
|
void StmtProfiler::VisitObjCMessageExpr(ObjCMessageExpr *S) {
|
||||||
|
@ -341,8 +341,8 @@ RValue CodeGenFunction::EmitObjCPropertyGet(const Expr *Exp) {
|
|||||||
cast<ObjCImplctSetterGetterRefExpr>(Exp);
|
cast<ObjCImplctSetterGetterRefExpr>(Exp);
|
||||||
Selector S = KE->getGetterMethod()->getSelector();
|
Selector S = KE->getGetterMethod()->getSelector();
|
||||||
llvm::Value *Receiver;
|
llvm::Value *Receiver;
|
||||||
if (KE->getClassProp()) {
|
if (KE->getInterfaceDecl()) {
|
||||||
const ObjCInterfaceDecl *OID = KE->getClassProp();
|
const ObjCInterfaceDecl *OID = KE->getInterfaceDecl();
|
||||||
Receiver = CGM.getObjCRuntime().GetClass(Builder, OID);
|
Receiver = CGM.getObjCRuntime().GetClass(Builder, OID);
|
||||||
} else if (isa<ObjCSuperExpr>(KE->getBase()))
|
} else if (isa<ObjCSuperExpr>(KE->getBase()))
|
||||||
return EmitObjCSuperPropertyGet(KE, S);
|
return EmitObjCSuperPropertyGet(KE, S);
|
||||||
@ -351,7 +351,7 @@ RValue CodeGenFunction::EmitObjCPropertyGet(const Expr *Exp) {
|
|||||||
return CGM.getObjCRuntime().
|
return CGM.getObjCRuntime().
|
||||||
GenerateMessageSend(*this, Exp->getType(), S,
|
GenerateMessageSend(*this, Exp->getType(), S,
|
||||||
Receiver,
|
Receiver,
|
||||||
KE->getClassProp() != 0, CallArgList());
|
KE->getInterfaceDecl() != 0, CallArgList());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -394,8 +394,8 @@ void CodeGenFunction::EmitObjCPropertySet(const Expr *Exp,
|
|||||||
Selector S = E->getSetterMethod()->getSelector();
|
Selector S = E->getSetterMethod()->getSelector();
|
||||||
CallArgList Args;
|
CallArgList Args;
|
||||||
llvm::Value *Receiver;
|
llvm::Value *Receiver;
|
||||||
if (E->getClassProp()) {
|
if (E->getInterfaceDecl()) {
|
||||||
const ObjCInterfaceDecl *OID = E->getClassProp();
|
const ObjCInterfaceDecl *OID = E->getInterfaceDecl();
|
||||||
Receiver = CGM.getObjCRuntime().GetClass(Builder, OID);
|
Receiver = CGM.getObjCRuntime().GetClass(Builder, OID);
|
||||||
} else if (isa<ObjCSuperExpr>(E->getBase())) {
|
} else if (isa<ObjCSuperExpr>(E->getBase())) {
|
||||||
EmitObjCSuperPropertySet(E, S, Src);
|
EmitObjCSuperPropertySet(E, S, Src);
|
||||||
@ -405,7 +405,7 @@ void CodeGenFunction::EmitObjCPropertySet(const Expr *Exp,
|
|||||||
Args.push_back(std::make_pair(Src, E->getType()));
|
Args.push_back(std::make_pair(Src, E->getType()));
|
||||||
CGM.getObjCRuntime().GenerateMessageSend(*this, getContext().VoidTy, S,
|
CGM.getObjCRuntime().GenerateMessageSend(*this, getContext().VoidTy, S,
|
||||||
Receiver,
|
Receiver,
|
||||||
E->getClassProp() != 0, Args);
|
E->getInterfaceDecl() != 0, Args);
|
||||||
} else
|
} else
|
||||||
assert (0 && "bad expression node in EmitObjCPropertySet");
|
assert (0 && "bad expression node in EmitObjCPropertySet");
|
||||||
}
|
}
|
||||||
|
@ -749,7 +749,7 @@ unsigned PCHStmtReader::VisitObjCImplctSetterGetterRefExpr(
|
|||||||
cast_or_null<ObjCMethodDecl>(Reader.GetDecl(Record[Idx++])));
|
cast_or_null<ObjCMethodDecl>(Reader.GetDecl(Record[Idx++])));
|
||||||
E->setSetterMethod(
|
E->setSetterMethod(
|
||||||
cast_or_null<ObjCMethodDecl>(Reader.GetDecl(Record[Idx++])));
|
cast_or_null<ObjCMethodDecl>(Reader.GetDecl(Record[Idx++])));
|
||||||
E->setClassProp(
|
E->setInterfaceDecl(
|
||||||
cast_or_null<ObjCInterfaceDecl>(Reader.GetDecl(Record[Idx++])));
|
cast_or_null<ObjCInterfaceDecl>(Reader.GetDecl(Record[Idx++])));
|
||||||
E->setBase(cast_or_null<Expr>(StmtStack.back()));
|
E->setBase(cast_or_null<Expr>(StmtStack.back()));
|
||||||
E->setLocation(SourceLocation::getFromRawEncoding(Record[Idx++]));
|
E->setLocation(SourceLocation::getFromRawEncoding(Record[Idx++]));
|
||||||
|
@ -679,8 +679,8 @@ void PCHStmtWriter::VisitObjCImplctSetterGetterRefExpr(
|
|||||||
Writer.AddDeclRef(E->getGetterMethod(), Record);
|
Writer.AddDeclRef(E->getGetterMethod(), Record);
|
||||||
Writer.AddDeclRef(E->getSetterMethod(), Record);
|
Writer.AddDeclRef(E->getSetterMethod(), Record);
|
||||||
|
|
||||||
// NOTE: ClassProp and Base are mutually exclusive.
|
// NOTE: InterfaceDecl and Base are mutually exclusive.
|
||||||
Writer.AddDeclRef(E->getClassProp(), Record);
|
Writer.AddDeclRef(E->getInterfaceDecl(), Record);
|
||||||
Writer.WriteSubStmt(E->getBase());
|
Writer.WriteSubStmt(E->getBase());
|
||||||
Writer.AddSourceLocation(E->getLocation(), Record);
|
Writer.AddSourceLocation(E->getLocation(), Record);
|
||||||
Writer.AddSourceLocation(E->getClassLoc(), Record);
|
Writer.AddSourceLocation(E->getClassLoc(), Record);
|
||||||
|
Loading…
Reference in New Issue
Block a user