aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprComplex.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/CGExprComplex.cpp')
-rw-r--r--lib/CodeGen/CGExprComplex.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/lib/CodeGen/CGExprComplex.cpp b/lib/CodeGen/CGExprComplex.cpp
index 7be88440ff..c5b705f329 100644
--- a/lib/CodeGen/CGExprComplex.cpp
+++ b/lib/CodeGen/CGExprComplex.cpp
@@ -111,23 +111,16 @@ public:
}
// l-values.
- ComplexPairTy emitDeclRef(ValueDecl *VD, Expr *refExpr) {
- if (CodeGenFunction::ConstantEmission result
- = CGF.tryEmitAsConstant(VD, refExpr)) {
+ ComplexPairTy 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));
llvm::ConstantStruct *pair =
cast<llvm::ConstantStruct>(result.getValue());
return ComplexPairTy(pair->getOperand(0), pair->getOperand(1));
}
- return EmitLoadOfLValue(refExpr);
- }
- ComplexPairTy VisitDeclRefExpr(DeclRefExpr *E) {
- return emitDeclRef(E->getDecl(), E);
- }
- ComplexPairTy VisitBlockDeclRefExpr(BlockDeclRefExpr *E) {
- return emitDeclRef(E->getDecl(), E);
+ return EmitLoadOfLValue(E);
}
ComplexPairTy VisitObjCIvarRefExpr(ObjCIvarRefExpr *E) {
return EmitLoadOfLValue(E);