summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-02-21 23:37:19 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-02-21 23:37:19 +0000
commita9fecf3f9eff108b719280d04c99151f90367b71 (patch)
treee04e75f426ffdb8da60571a6df5c202f1ab6b641 /clang/lib/CodeGen/CGExpr.cpp
parented98a50358ac99a3464608e4e03cd51b4f297f0d (diff)
downloadbcm5719-llvm-a9fecf3f9eff108b719280d04c99151f90367b71.tar.gz
bcm5719-llvm-a9fecf3f9eff108b719280d04c99151f90367b71.zip
local array of objects are non-gc'able.
llvm-svn: 65251
Diffstat (limited to 'clang/lib/CodeGen/CGExpr.cpp')
-rw-r--r--clang/lib/CodeGen/CGExpr.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index a9db6db0d9b..2348a11f7b0 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/lib/CodeGen/CGExpr.cpp
@@ -776,10 +776,14 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const ArraySubscriptExpr *E) {
QualType T = E->getBase()->getType();
QualType ExprTy = getContext().getCanonicalType(T);
T = T->getAsPointerType()->getPointeeType();
-
- return LValue::MakeAddr(Builder.CreateGEP(Base, Idx, "arrayidx"),
+ LValue LV =
+ LValue::MakeAddr(Builder.CreateGEP(Base, Idx, "arrayidx"),
ExprTy->getAsPointerType()->getPointeeType().getCVRQualifiers(),
getContext().getObjCGCAttrKind(T));
+ if (getContext().getLangOptions().ObjC1 &&
+ getContext().getLangOptions().getGCMode() != LangOptions::NonGC)
+ LValue::SetObjCNonGC(LV, !E->hasGlobalStorage());
+ return LV;
}
static
OpenPOWER on IntegriCloud