summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/ScopeInfo.cpp
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2012-10-01 20:34:04 +0000
committerAnna Zaks <ganna@apple.com>2012-10-01 20:34:04 +0000
commit97c7ce33680253d0344d41c073d6a1b8ca360283 (patch)
tree3398a4b743a1e3260fadd9fbf24fd976a89babae /clang/lib/Sema/ScopeInfo.cpp
parentbfacf17b8b99f2c6d51bf570a11d6e6a5d3a2a39 (diff)
downloadbcm5719-llvm-97c7ce33680253d0344d41c073d6a1b8ca360283.tar.gz
bcm5719-llvm-97c7ce33680253d0344d41c073d6a1b8ca360283.zip
Move isObjCSelf into Expr.
llvm-svn: 164966
Diffstat (limited to 'clang/lib/Sema/ScopeInfo.cpp')
-rw-r--r--clang/lib/Sema/ScopeInfo.cpp22
1 files changed, 2 insertions, 20 deletions
diff --git a/clang/lib/Sema/ScopeInfo.cpp b/clang/lib/Sema/ScopeInfo.cpp
index bb9420d1e7e..7a9d917a025 100644
--- a/clang/lib/Sema/ScopeInfo.cpp
+++ b/clang/lib/Sema/ScopeInfo.cpp
@@ -41,24 +41,6 @@ static const NamedDecl *getBestPropertyDecl(const ObjCPropertyRefExpr *PropE) {
return PropE->getImplicitPropertyGetter();
}
-static bool isSelfExpr(const Expr *E) {
- E = E->IgnoreParenImpCasts();
-
- const DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(E);
- if (!DRE)
- return false;
-
- const ImplicitParamDecl *Param = dyn_cast<ImplicitParamDecl>(DRE->getDecl());
- if (!Param)
- return false;
-
- const ObjCMethodDecl *M = dyn_cast<ObjCMethodDecl>(Param->getDeclContext());
- if (!M)
- return false;
-
- return M->getSelfDecl() == Param;
-}
-
FunctionScopeInfo::WeakObjectProfileTy::BaseInfoTy
FunctionScopeInfo::WeakObjectProfileTy::getBaseInfo(const Expr *E) {
E = E->IgnoreParenCasts();
@@ -80,7 +62,7 @@ FunctionScopeInfo::WeakObjectProfileTy::getBaseInfo(const Expr *E) {
case Stmt::ObjCIvarRefExprClass: {
const ObjCIvarRefExpr *IE = cast<ObjCIvarRefExpr>(E);
D = IE->getDecl();
- IsExact = isSelfExpr(IE->getBase());
+ IsExact = IE->getBase()->isObjCSelfExpr();
break;
}
case Stmt::PseudoObjectExprClass: {
@@ -94,7 +76,7 @@ FunctionScopeInfo::WeakObjectProfileTy::getBaseInfo(const Expr *E) {
if (const OpaqueValueExpr *OVE = dyn_cast<OpaqueValueExpr>(DoubleBase))
DoubleBase = OVE->getSourceExpr();
- IsExact = isSelfExpr(DoubleBase);
+ IsExact = DoubleBase->isObjCSelfExpr();
}
break;
}
OpenPOWER on IntegriCloud