ObjCGCAttr::GCAttrTypes attrType = A->getType();
LValue::SetObjCType(attrType == ObjCGCAttr::Weak, attrType == ObjCGCAttr::Strong, LV);
}
+ else if (CGM.getLangOptions().ObjC1 &&
+ CGM.getLangOptions().getGCMode() != LangOptions::NonGC) {
+ QualType ExprTy = E->getType();
+ if (getContext().isObjCObjectPointerType(ExprTy))
+ LValue::SetObjCType(false, true, LV);
+ }
return LV;
} else if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(E->getDecl())) {
return LValue::MakeAddr(CGM.GetAddrOfFunction(FD),
bool isObjCWeak() const { return ObjCType == Weak; }
bool isObjCStrong() const { return ObjCType == Strong; }
- static void SetObjCType(unsigned WeakVal, unsigned StrongVal, LValue& R) {
- if (WeakVal)
+ static void SetObjCType(bool isWeak, bool isStrong, LValue& R) {
+ assert(!(isWeak == true && isStrong == true));
+ if (isWeak)
R.ObjCType = Weak;
- else if (StrongVal)
+ else if (isStrong)
R.ObjCType = Strong;
}