diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-02-21 23:37:19 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-02-21 23:37:19 +0000 |
commit | 643887ab8de731c7096f48816f19a18017d05924 (patch) | |
tree | 66b322cb373793846883e097ca40568bcf588ffb /lib/CodeGen/CGExpr.cpp | |
parent | f7f52e7bf5a4dc36d45b98531e0b21e343fc19de (diff) |
local array of objects are non-gc'able.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65251 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
-rw-r--r-- | lib/CodeGen/CGExpr.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index a9db6db0d9..2348a11f7b 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/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 |