summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprScalar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/CGExprScalar.cpp')
-rw-r--r--clang/lib/CodeGen/CGExprScalar.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp
index a6ba79803d4..d3cbf00c85c 100644
--- a/clang/lib/CodeGen/CGExprScalar.cpp
+++ b/clang/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) {
OpenPOWER on IntegriCloud