diff options
author | Anders Carlsson <andersca@mac.com> | 2009-11-07 22:43:34 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-11-07 22:43:34 +0000 |
commit | a59869b277f9fb8d6e062cab97b6bafe7c199900 (patch) | |
tree | 08e565dda6f08c155d2600f84a434cfcbcf62d60 | |
parent | 909fbf70223ea04a5ec8d449789f3683a89701ff (diff) |
We only need to call SetObjCNonGC for local variables. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86410 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/CGExpr.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 62e16e8ba2..fbb593983d 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -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; } |