summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-02-20 01:14:43 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-02-20 01:14:43 +0000
commitc86fb5ecb4e7327ca0dcd8570d0d93d08cf5d622 (patch)
treeefc7307e4da3829d696e9507a98ec4db8e4b5cba /clang/lib
parent29578f3f4127d444b84aac5a15a30e7cf3e80b9f (diff)
downloadbcm5719-llvm-c86fb5ecb4e7327ca0dcd8570d0d93d08cf5d622.tar.gz
bcm5719-llvm-c86fb5ecb4e7327ca0dcd8570d0d93d08cf5d622.zip
More objc gc's ir-gen fixes.
llvm-svn: 65097
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/CGExpr.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index aa1585b2dbe..5da0de9cbb6 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/lib/CodeGen/CGExpr.cpp
@@ -626,8 +626,12 @@ LValue CodeGenFunction::EmitDeclRefLValue(const DeclRefExpr *E) {
else {
llvm::Value *V = LocalDeclMap[VD];
assert(V && "BlockVarDecl not entered in LocalDeclMap?");
- LV = LValue::MakeAddr(V, E->getType().getCVRQualifiers(),
- getContext().getObjCGCAttrKind(E->getType()));
+ // local variables do not get their gc attribute set.
+ QualType::GCAttrTypes attr = QualType::GCNone;
+ // local static?
+ if (VD->getStorageClass() == VarDecl::Static)
+ attr = getContext().getObjCGCAttrKind(E->getType());
+ LV = LValue::MakeAddr(V, E->getType().getCVRQualifiers(), attr);
}
return LV;
} else if (VD && VD->isFileVarDecl()) {
@@ -665,7 +669,8 @@ LValue CodeGenFunction::EmitUnaryOpLValue(const UnaryOperator *E) {
{
QualType T = E->getSubExpr()->getType()->getAsPointerType()->getPointeeType();
return LValue::MakeAddr(EmitScalarExpr(E->getSubExpr()),
- ExprTy->getAsPointerType()->getPointeeType().getCVRQualifiers(),
+ ExprTy->getAsPointerType()->getPointeeType()
+ .getCVRQualifiers(),
getContext().getObjCGCAttrKind(T));
}
case UnaryOperator::Real:
OpenPOWER on IntegriCloud