Get rid of mostly-unused, buggy method.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80432 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp
index 2844ab4..7d28149 100644
--- a/lib/AST/ExprConstant.cpp
+++ b/lib/AST/ExprConstant.cpp
@@ -187,14 +187,14 @@
 
 APValue LValueExprEvaluator::VisitDeclRefExpr(DeclRefExpr *E)
 {
-  if (!E->hasGlobalStorage())
-    return APValue();
-
   if (isa<FunctionDecl>(E->getDecl())) {
     return APValue(E, 0);
   } else if (VarDecl* VD = dyn_cast<VarDecl>(E->getDecl())) {
+    if (!VD->hasGlobalStorage())
+      return APValue();
     if (!VD->getType()->isReferenceType())
       return APValue(E, 0);
+    // FIXME: Check whether VD might be overridden!
     if (VD->getInit())
       return Visit(VD->getInit());
   }