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 | 113bee05361d648adb51edd0e2ec281432d2009f (patch) | |
tree | d5af8b7b0a95c04343a9f2e8f7fe40e8c769b656 /clang/lib/CodeGen/CGExprAgg.cpp | |
parent | 97f6f03c42f32a5edf59a27b56940f68c89d146b (diff) | |
download | llvm-113bee05361d648adb51edd0e2ec281432d2009f.zip llvm-113bee05361d648adb51edd0e2ec281432d2009f.tar.gz llvm-113bee05361d648adb51edd0e2ec281432d2009f.tar.bz2 |
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
Diffstat (limited to 'clang/lib/CodeGen/CGExprAgg.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGExprAgg.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/clang/lib/CodeGen/CGExprAgg.cpp b/clang/lib/CodeGen/CGExprAgg.cpp index f7c640a..3e8ae06 100644 --- a/clang/lib/CodeGen/CGExprAgg.cpp +++ b/clang/lib/CodeGen/CGExprAgg.cpp @@ -109,26 +109,22 @@ public: } // l-values. - void emitDeclRef(ValueDecl *VD, Expr *refExpr) { + void VisitDeclRefExpr(DeclRefExpr *E) { // For aggregates, we should always be able to emit the variable // as an l-value unless it's a reference. This is due to the fact // that we can't actually ever see a normal l2r conversion on an // aggregate in C++, and in C there's no language standard // actively preventing us from listing variables in the captures // list of a block. - if (VD->getType()->isReferenceType()) { + if (E->getDecl()->getType()->isReferenceType()) { if (CodeGenFunction::ConstantEmission result - = CGF.tryEmitAsConstant(VD, refExpr)) { - EmitFinalDestCopy(refExpr, result.getReferenceLValue(CGF, refExpr)); + = CGF.tryEmitAsConstant(E)) { + EmitFinalDestCopy(E, result.getReferenceLValue(CGF, E)); return; } } - EmitAggLoadOfLValue(refExpr); - } - void VisitDeclRefExpr(DeclRefExpr *E) { emitDeclRef(E->getDecl(), E); } - void VisitBlockDeclRefExpr(BlockDeclRefExpr *E) { - emitDeclRef(E->getDecl(), E); + EmitAggLoadOfLValue(E); } void VisitMemberExpr(MemberExpr *ME) { EmitAggLoadOfLValue(ME); } |