local array of objects are non-gc'able.

llvm-svn: 65251
This commit is contained in:
Fariborz Jahanian 2009-02-21 23:37:19 +00:00
parent ed98a50358
commit a9fecf3f9e
1 changed files with 6 additions and 2 deletions

View File

@ -776,10 +776,14 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const ArraySubscriptExpr *E) {
QualType T = E->getBase()->getType(); QualType T = E->getBase()->getType();
QualType ExprTy = getContext().getCanonicalType(T); QualType ExprTy = getContext().getCanonicalType(T);
T = T->getAsPointerType()->getPointeeType(); T = T->getAsPointerType()->getPointeeType();
LValue LV =
return LValue::MakeAddr(Builder.CreateGEP(Base, Idx, "arrayidx"), LValue::MakeAddr(Builder.CreateGEP(Base, Idx, "arrayidx"),
ExprTy->getAsPointerType()->getPointeeType().getCVRQualifiers(), ExprTy->getAsPointerType()->getPointeeType().getCVRQualifiers(),
getContext().getObjCGCAttrKind(T)); getContext().getObjCGCAttrKind(T));
if (getContext().getLangOptions().ObjC1 &&
getContext().getLangOptions().getGCMode() != LangOptions::NonGC)
LValue::SetObjCNonGC(LV, !E->hasGlobalStorage());
return LV;
} }
static static