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
This commit is contained in:
John McCall
2012-03-10 09:33:50 +00:00
parent 97f6f03c42
commit 113bee0536
49 changed files with 280 additions and 565 deletions

View File

@@ -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);