From f4b88a45902af1802a1cb42ba48b1c474474f228 Mon Sep 17 00:00:00 2001 From: John McCall Date: Sat, 10 Mar 2012 09:33:50 +0000 Subject: 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 --- lib/ARCMigrate/TransAutoreleasePool.cpp | 4 ---- lib/ARCMigrate/TransBlockObjCVariable.cpp | 6 +++--- lib/ARCMigrate/Transforms.cpp | 7 ------- 3 files changed, 3 insertions(+), 14 deletions(-) (limited to 'lib/ARCMigrate') 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(castE->getSubExpr())) { + if (DeclRefExpr * + ref = dyn_cast(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 { 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 { @@ -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 { -- cgit v1.2.3