forked from OSchip/llvm-project
parent
ed98a50358
commit
a9fecf3f9e
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue