summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2008-11-19 18:38:10 +0000
committerFariborz Jahanian <fjahanian@apple.com>2008-11-19 18:38:10 +0000
commit0c43f2681b13e32171f883b6e874da1a6ae340e9 (patch)
tree8ceef9a8c1c971a002f4a783a599247e471c96d0 /lib/CodeGen/CGExpr.cpp
parent051c13a4a99c651e404b4a3160e1173b427eee17 (diff)
downloadclang-0c43f2681b13e32171f883b6e874da1a6ae340e9.tar.gz
clang-0c43f2681b13e32171f883b6e874da1a6ae340e9.tar.bz2
clang-0c43f2681b13e32171f883b6e874da1a6ae340e9.tar.xz
More of objective-c's gc code-gen. Treat objective-c
objects as __strong when attribute unspecified. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59654 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
-rw-r--r--lib/CodeGen/CGExpr.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp
index 3c283605e1..9e4d66a947 100644
--- a/lib/CodeGen/CGExpr.cpp
+++ b/lib/CodeGen/CGExpr.cpp
@@ -542,6 +542,12 @@ LValue CodeGenFunction::EmitDeclRefLValue(const DeclRefExpr *E) {
ObjCGCAttr::GCAttrTypes attrType = A->getType();
LValue::SetObjCType(attrType == ObjCGCAttr::Weak, attrType == ObjCGCAttr::Strong, LV);
}
+ else if (CGM.getLangOptions().ObjC1 &&
+ CGM.getLangOptions().getGCMode() != LangOptions::NonGC) {
+ QualType ExprTy = E->getType();
+ if (getContext().isObjCObjectPointerType(ExprTy))
+ LValue::SetObjCType(false, true, LV);
+ }
return LV;
} else if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(E->getDecl())) {
return LValue::MakeAddr(CGM.GetAddrOfFunction(FD),