diff options
author | John McCall <rjmccall@apple.com> | 2012-03-10 09:33:50 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2012-03-10 09:33:50 +0000 |
commit | f4b88a45902af1802a1cb42ba48b1c474474f228 (patch) | |
tree | 7f613834b56ecad44c6a1a99d69d2230a034e7b6 /lib/ARCMigrate | |
parent | 1659c3758b4b2dbd618aed9ff8d1863f11b1bd9b (diff) |
Remove BlockDeclRefExpr and introduce a bit on DeclRefExpr to
track whether the referenced declaration comes from an enclosing
local context. I'm amenable to suggestions about the exact meaning
of this bit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152491 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ARCMigrate')
-rw-r--r-- | lib/ARCMigrate/TransAutoreleasePool.cpp | 4 | ||||
-rw-r--r-- | lib/ARCMigrate/TransBlockObjCVariable.cpp | 6 | ||||
-rw-r--r-- | lib/ARCMigrate/Transforms.cpp | 7 |
3 files changed, 3 insertions, 14 deletions
diff --git a/lib/ARCMigrate/TransAutoreleasePool.cpp b/lib/ARCMigrate/TransAutoreleasePool.cpp index 08561f97f9..87877242a1 100644 --- a/lib/ARCMigrate/TransAutoreleasePool.cpp +++ b/lib/ARCMigrate/TransAutoreleasePool.cpp @@ -263,10 +263,6 @@ private: return checkRef(E->getLocation(), E->getDecl()->getLocation()); } - bool VisitBlockDeclRefExpr(BlockDeclRefExpr *E) { - return checkRef(E->getLocation(), E->getDecl()->getLocation()); - } - bool VisitTypedefTypeLoc(TypedefTypeLoc TL) { return checkRef(TL.getBeginLoc(), TL.getTypedefNameDecl()->getLocation()); } diff --git a/lib/ARCMigrate/TransBlockObjCVariable.cpp b/lib/ARCMigrate/TransBlockObjCVariable.cpp index 5f9592739d..845da159a1 100644 --- a/lib/ARCMigrate/TransBlockObjCVariable.cpp +++ b/lib/ARCMigrate/TransBlockObjCVariable.cpp @@ -48,8 +48,8 @@ class RootBlockObjCVarRewriter : BlockVarChecker(VarDecl *var) : Var(var) { } bool TraverseImplicitCastExpr(ImplicitCastExpr *castE) { - if (BlockDeclRefExpr * - ref = dyn_cast<BlockDeclRefExpr>(castE->getSubExpr())) { + if (DeclRefExpr * + ref = dyn_cast<DeclRefExpr>(castE->getSubExpr())) { if (ref->getDecl() == Var) { if (castE->getCastKind() == CK_LValueToRValue) return true; // Using the value of the variable. @@ -62,7 +62,7 @@ class RootBlockObjCVarRewriter : return base::TraverseImplicitCastExpr(castE); } - bool VisitBlockDeclRefExpr(BlockDeclRefExpr *E) { + bool VisitDeclRefExpr(DeclRefExpr *E) { if (E->getDecl() == Var) return false; // The reference of the variable, and not just its value, // is needed. diff --git a/lib/ARCMigrate/Transforms.cpp b/lib/ARCMigrate/Transforms.cpp index 6d08d1e7d2..45a8c989ef 100644 --- a/lib/ARCMigrate/Transforms.cpp +++ b/lib/ARCMigrate/Transforms.cpp @@ -194,7 +194,6 @@ class ReferenceClear : public RecursiveASTVisitor<ReferenceClear> { public: ReferenceClear(ExprSet &refs) : Refs(refs) { } bool VisitDeclRefExpr(DeclRefExpr *E) { Refs.erase(E); return true; } - bool VisitBlockDeclRefExpr(BlockDeclRefExpr *E) { Refs.erase(E); return true; } }; class ReferenceCollector : public RecursiveASTVisitor<ReferenceCollector> { @@ -210,12 +209,6 @@ public: Refs.insert(E); return true; } - - bool VisitBlockDeclRefExpr(BlockDeclRefExpr *E) { - if (E->getDecl() == Dcl) - Refs.insert(E); - return true; - } }; class RemovablesCollector : public RecursiveASTVisitor<RemovablesCollector> { |