[cfe-commits] r65251 - /cfe/trunk/lib/CodeGen/CGExpr.cpp
Fariborz Jahanian
fjahanian at apple.com
Sat Feb 21 15:37:19 PST 2009
Author: fjahanian
Date: Sat Feb 21 17:37:19 2009
New Revision: 65251
URL: http://llvm.org/viewvc/llvm-project?rev=65251&view=rev
Log:
local array of objects are non-gc'able.
Modified:
cfe/trunk/lib/CodeGen/CGExpr.cpp
Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=65251&r1=65250&r2=65251&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Sat Feb 21 17:37:19 2009
@@ -776,10 +776,14 @@
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
More information about the cfe-commits
mailing list