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
diff --git a/lib/Analysis/PseudoConstantAnalysis.cpp b/lib/Analysis/PseudoConstantAnalysis.cpp
index 8f24c43..c8b491a 100644
--- a/lib/Analysis/PseudoConstantAnalysis.cpp
+++ b/lib/Analysis/PseudoConstantAnalysis.cpp
@@ -68,8 +68,6 @@
 const Decl *PseudoConstantAnalysis::getDecl(const Expr *E) {
   if (const DeclRefExpr *DR = dyn_cast<DeclRefExpr>(E))
     return DR->getDecl();
-  else if (const BlockDeclRefExpr *BDR = dyn_cast<BlockDeclRefExpr>(E))
-    return BDR->getDecl();
   else
     return 0;
 }
@@ -198,18 +196,7 @@
       break;
     }
 
-    // Case 4: Block variable references
-    case Stmt::BlockDeclRefExprClass: {
-      const BlockDeclRefExpr *BDR = cast<BlockDeclRefExpr>(Head);
-      if (const VarDecl *VD = dyn_cast<VarDecl>(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<DeclRefExpr>(Head);
       if (const VarDecl *VD = dyn_cast<VarDecl>(DR->getDecl())) {
@@ -220,7 +207,7 @@
       break;
     }
 
-    // Case 6: Block expressions
+    // Case 5: Block expressions
     case Stmt::BlockExprClass: {
       const BlockExpr *B = cast<BlockExpr>(Head);
       // Add the body of the block to the list