/// conversion is always unqualified.
CK_LValueToRValue,
- /// CK_GetObjCProperty - A conversion which calls an Objective-C
- /// property getter. The operand is an OK_ObjCProperty l-value; the
- /// result will generally be an r-value, but could be an ordinary
- /// gl-value if the property reference is to an implicit property
- /// for a method that returns a reference type.
- CK_GetObjCProperty,
-
/// CK_NoOp - A conversion which does not affect the type other than
/// (possibly) adding qualifiers.
/// int -> int
case CK_Dependent:
case CK_LValueToRValue:
- case CK_GetObjCProperty:
case CK_NoOp:
case CK_PointerToBoolean:
case CK_IntegralToBoolean:
return "LValueBitCast";
case CK_LValueToRValue:
return "LValueToRValue";
- case CK_GetObjCProperty:
- return "GetObjCProperty";
case CK_NoOp:
return "NoOp";
case CK_BaseToDerived:
case CK_BitCast:
case CK_Dependent:
- case CK_GetObjCProperty:
case CK_LValueBitCast:
case CK_UserDefinedConversion:
case CK_ARCProduceObject:
return ExprEvaluatorBaseTy::VisitCastExpr(E);
case CK_Dependent:
- case CK_GetObjCProperty:
case CK_LValueBitCast:
case CK_UserDefinedConversion:
return false;
case CK_Dependent:
llvm_unreachable("dependent cast kind in IR gen!");
- case CK_GetObjCProperty: llvm_unreachable("GetObjCProperty");
-
case CK_NoOp:
case CK_LValueToRValue:
if (!E->getSubExpr()->Classify(getContext()).isPRValue()
"should have been unpacked before we got here");
}
- case CK_GetObjCProperty: llvm_unreachable("GetObjCProperty!");
-
case CK_LValueToRValue: // hope for downstream optimization
case CK_NoOp:
case CK_UserDefinedConversion:
QualType DestTy) {
switch (CK) {
case CK_Dependent: llvm_unreachable("dependent cast kind in IR gen!");
- case CK_GetObjCProperty: llvm_unreachable("GetObjCProperty!");
case CK_NoOp:
case CK_LValueToRValue:
// These will never be supported.
case CK_ObjCObjectLValueCast:
- case CK_GetObjCProperty:
case CK_ToVoid:
case CK_Dynamic:
case CK_ARCProduceObject:
// are in the same order as in the CastKind enum.
switch (Kind) {
case CK_Dependent: llvm_unreachable("dependent cast kind in IR gen!");
- case CK_GetObjCProperty: llvm_unreachable("GetObjCProperty!");
case CK_LValueBitCast:
case CK_ObjCObjectLValueCast: {
return PTy->getPointeeType();
}
-static RValue GenerateMessageSendSuper(CodeGenFunction &CGF,
- ReturnValueSlot Return,
- QualType ResultType,
- Selector S,
- llvm::Value *Receiver,
- const CallArgList &CallArgs) {
- const ObjCMethodDecl *OMD = cast<ObjCMethodDecl>(CGF.CurFuncDecl);
- bool isClassMessage = OMD->isClassMethod();
- bool isCategoryImpl = isa<ObjCCategoryImplDecl>(OMD->getDeclContext());
- return CGF.CGM.getObjCRuntime()
- .GenerateMessageSendSuper(CGF, Return, ResultType,
- S, OMD->getClassInterface(),
- isCategoryImpl, Receiver,
- isClassMessage, CallArgs);
-}
-
void CodeGenFunction::EmitObjCForCollectionStmt(const ObjCForCollectionStmt &S){
llvm::Constant *EnumerationMutationFn =
CGM.getObjCRuntime().EnumerationMutationFunction();
e = cast->getSubExpr();
continue;
- case CK_GetObjCProperty: {
- // Bail out if this isn't a strong explicit property.
- const ObjCPropertyRefExpr *pre = cast->getSubExpr()->getObjCProperty();
- if (pre->isImplicitProperty()) return false;
- ObjCPropertyDecl *property = pre->getExplicitProperty();
- if (!property->isRetaining() &&
- !(property->getPropertyIvarDecl() &&
- property->getPropertyIvarDecl()->getType()
- .getObjCLifetime() == Qualifiers::OCL_Strong))
- return false;
-
- owner.Indirect = true;
- e = const_cast<Expr*>(pre->getBase());
- continue;
- }
-
default:
return false;
}
ObjCMethodDecl *D = 0;
if (ObjCMessageExpr *Send = dyn_cast<ObjCMessageExpr>(E)) {
D = Send->getMethodDecl();
- } else {
- CastExpr *CE = cast<CastExpr>(E);
- assert(CE->getCastKind() == CK_GetObjCProperty);
- const ObjCPropertyRefExpr *PRE = CE->getSubExpr()->getObjCProperty();
- D = (PRE->isImplicitProperty() ? PRE->getImplicitPropertyGetter() : 0);
}
ReturnsRetained = (D && D->hasAttr<NSReturnsRetainedAttr>());
case CK_NoOp:
case CK_LValueToRValue:
case CK_BitCast:
- case CK_GetObjCProperty:
case CK_CPointerToObjCPointerCast:
case CK_BlockPointerToObjCPointerCast:
case CK_AnyPointerToBlockPointerCast:
ExplodedNodeSet dstPreStmt;
getCheckerManager().runCheckersForPreStmt(dstPreStmt, Pred, CastE, *this);
- if (CastE->getCastKind() == CK_LValueToRValue ||
- CastE->getCastKind() == CK_GetObjCProperty) {
+ if (CastE->getCastKind() == CK_LValueToRValue) {
for (ExplodedNodeSet::iterator I = dstPreStmt.begin(), E = dstPreStmt.end();
I!=E; ++I) {
ExplodedNode *subExprNode = *I;
switch (CastE->getCastKind()) {
case CK_LValueToRValue:
llvm_unreachable("LValueToRValue casts handled earlier.");
- case CK_GetObjCProperty:
- llvm_unreachable("GetObjCProperty casts handled earlier.");
case CK_ToVoid:
continue;
// The analyzer doesn't do anything special with these casts,