From 113bee05361d648adb51edd0e2ec281432d2009f Mon Sep 17 00:00:00 2001 From: John McCall Date: Sat, 10 Mar 2012 09:33:50 +0000 Subject: 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 --- clang/lib/CodeGen/CGExprComplex.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'clang/lib/CodeGen/CGExprComplex.cpp') diff --git a/clang/lib/CodeGen/CGExprComplex.cpp b/clang/lib/CodeGen/CGExprComplex.cpp index 7be88440ff0..c5b705f329c 100644 --- a/clang/lib/CodeGen/CGExprComplex.cpp +++ b/clang/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(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); -- cgit v1.2.3