aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprAgg.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2012-03-10 09:33:50 +0000
committerJohn McCall <rjmccall@apple.com>2012-03-10 09:33:50 +0000
commitf4b88a45902af1802a1cb42ba48b1c474474f228 (patch)
tree7f613834b56ecad44c6a1a99d69d2230a034e7b6 /lib/CodeGen/CGExprAgg.cpp
parent1659c3758b4b2dbd618aed9ff8d1863f11b1bd9b (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/CodeGen/CGExprAgg.cpp')
-rw-r--r--lib/CodeGen/CGExprAgg.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/CodeGen/CGExprAgg.cpp b/lib/CodeGen/CGExprAgg.cpp
index f7c640adac..3e8ae06f16 100644
--- a/lib/CodeGen/CGExprAgg.cpp
+++ b/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); }