We only need to call SetObjCNonGC for local variables. No functionality change.

llvm-svn: 86410
This commit is contained in:
Anders Carlsson 2009-11-07 22:43:34 +00:00
parent 4e9f379554
commit 03f83e58f7
1 changed files with 3 additions and 3 deletions

View File

@ -819,14 +819,14 @@ LValue CodeGenFunction::EmitDeclRefLValue(const DeclRefExpr *E) {
if (VD && (VD->isBlockVarDecl() || isa<ParmVarDecl>(VD) ||
isa<ImplicitParamDecl>(VD))) {
LValue LV;
bool NonGCable = VD->hasLocalStorage() &&
!VD->hasAttr<BlocksAttr>();
if (VD->hasExternalStorage()) {
llvm::Value *V = CGM.GetAddrOfGlobalVar(VD);
if (VD->getType()->isReferenceType())
V = Builder.CreateLoad(V, "tmp");
LV = LValue::MakeAddr(V, MakeQualifiers(E->getType()));
} else {
bool NonGCable = VD->hasLocalStorage() && !VD->hasAttr<BlocksAttr>();
llvm::Value *V = LocalDeclMap[VD];
assert(V && "DeclRefExpr not entered in LocalDeclMap?");
@ -844,8 +844,8 @@ LValue CodeGenFunction::EmitDeclRefLValue(const DeclRefExpr *E) {
if (VD->getType()->isReferenceType())
V = Builder.CreateLoad(V, "tmp");
LV = LValue::MakeAddr(V, Quals);
LValue::SetObjCNonGC(LV, NonGCable);
}
LValue::SetObjCNonGC(LV, NonGCable);
setObjCGCLValueClass(getContext(), E, LV);
return LV;
}