aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ExprConstant.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-08-29 19:09:59 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-08-29 19:09:59 +0000
commitd933a0198f3ccce9c73bf2951625315b911d37bf (patch)
tree7e6e54dde72671478417b0ffb388b610cf23b9bb /lib/AST/ExprConstant.cpp
parentd01a0bc444fd34f351b1ff8afe488f2c20345b60 (diff)
Get rid of mostly-unused, buggy method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80432 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ExprConstant.cpp')
-rw-r--r--lib/AST/ExprConstant.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp
index 2844ab4f36..7d281494d6 100644
--- a/lib/AST/ExprConstant.cpp
+++ b/lib/AST/ExprConstant.cpp
@@ -187,14 +187,14 @@ static bool EvaluateLValue(const Expr* E, APValue& Result, EvalInfo &Info) {
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());
}