aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprScalar.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/CGExprScalar.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/CGExprScalar.cpp')
-rw-r--r--lib/CodeGen/CGExprScalar.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp
index a6ba79803d..d3cbf00c85 100644
--- a/lib/CodeGen/CGExprScalar.cpp
+++ b/lib/CodeGen/CGExprScalar.cpp
@@ -213,20 +213,13 @@ public:
}
// l-values.
- Value *emitDeclRef(ValueDecl *VD, Expr *refExpr) {
- if (CodeGenFunction::ConstantEmission result
- = CGF.tryEmitAsConstant(VD, refExpr)) {
+ Value *VisitDeclRefExpr(DeclRefExpr *E) {
+ if (CodeGenFunction::ConstantEmission result = CGF.tryEmitAsConstant(E)) {
if (result.isReference())
- return EmitLoadOfLValue(result.getReferenceLValue(CGF, refExpr));
+ return EmitLoadOfLValue(result.getReferenceLValue(CGF, E));
return result.getValue();
}
- return EmitLoadOfLValue(refExpr);
- }
- Value *VisitDeclRefExpr(DeclRefExpr *E) {
- return emitDeclRef(E->getDecl(), E);
- }
- Value *VisitBlockDeclRefExpr(BlockDeclRefExpr *E) {
- return emitDeclRef(E->getDecl(), E);
+ return EmitLoadOfLValue(E);
}
Value *VisitObjCSelectorExpr(ObjCSelectorExpr *E) {