diff options
author | John McCall <rjmccall@apple.com> | 2012-03-10 09:33:50 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2012-03-10 09:33:50 +0000 |
commit | f4b88a45902af1802a1cb42ba48b1c474474f228 (patch) | |
tree | 7f613834b56ecad44c6a1a99d69d2230a034e7b6 /lib/Sema/SemaInit.cpp | |
parent | 1659c3758b4b2dbd618aed9ff8d1863f11b1bd9b (diff) |
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
Diffstat (limited to 'lib/Sema/SemaInit.cpp')
-rw-r--r-- | lib/Sema/SemaInit.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp index 7c1de21385..5de785207f 100644 --- a/lib/Sema/SemaInit.cpp +++ b/lib/Sema/SemaInit.cpp @@ -3872,16 +3872,11 @@ static InvalidICRKind isInvalidICRSource(ASTContext &C, Expr *e, } // If we have a declaration reference, it had better be a local variable. - } else if (isa<DeclRefExpr>(e) || isa<BlockDeclRefExpr>(e)) { + } else if (isa<DeclRefExpr>(e)) { if (!isAddressOf) return IIK_nonlocal; - VarDecl *var; - if (isa<DeclRefExpr>(e)) { - var = dyn_cast<VarDecl>(cast<DeclRefExpr>(e)->getDecl()); - if (!var) return IIK_nonlocal; - } else { - var = cast<BlockDeclRefExpr>(e)->getDecl(); - } + VarDecl *var = dyn_cast<VarDecl>(cast<DeclRefExpr>(e)->getDecl()); + if (!var) return IIK_nonlocal; return (var->hasLocalStorage() ? IIK_okay : IIK_nonlocal); |