From 113bee05361d648adb51edd0e2ec281432d2009f 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. llvm-svn: 152491 --- clang/lib/Analysis/PseudoConstantAnalysis.cpp | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'clang/lib/Analysis/PseudoConstantAnalysis.cpp') diff --git a/clang/lib/Analysis/PseudoConstantAnalysis.cpp b/clang/lib/Analysis/PseudoConstantAnalysis.cpp index 8f24c432b15..c8b491a2168 100644 --- a/clang/lib/Analysis/PseudoConstantAnalysis.cpp +++ b/clang/lib/Analysis/PseudoConstantAnalysis.cpp @@ -68,8 +68,6 @@ bool PseudoConstantAnalysis::wasReferenced(const VarDecl *VD) { const Decl *PseudoConstantAnalysis::getDecl(const Expr *E) { if (const DeclRefExpr *DR = dyn_cast(E)) return DR->getDecl(); - else if (const BlockDeclRefExpr *BDR = dyn_cast(E)) - return BDR->getDecl(); else return 0; } @@ -198,18 +196,7 @@ void PseudoConstantAnalysis::RunAnalysis() { break; } - // Case 4: Block variable references - case Stmt::BlockDeclRefExprClass: { - const BlockDeclRefExpr *BDR = cast(Head); - if (const VarDecl *VD = dyn_cast(BDR->getDecl())) { - // Add the Decl to the used list - UsedVars->insert(VD); - continue; - } - break; - } - - // Case 5: Variable references + // Case 4: Variable references case Stmt::DeclRefExprClass: { const DeclRefExpr *DR = cast(Head); if (const VarDecl *VD = dyn_cast(DR->getDecl())) { @@ -220,7 +207,7 @@ void PseudoConstantAnalysis::RunAnalysis() { break; } - // Case 6: Block expressions + // Case 5: Block expressions case Stmt::BlockExprClass: { const BlockExpr *B = cast(Head); // Add the body of the block to the list -- cgit v1.2.3