From 7864435ef2bce200224120bd1df3aed98ea5b99a Mon Sep 17 00:00:00 2001 From: John McCall Date: Mon, 7 Nov 2011 05:09:54 +0000 Subject: [PATCH] Rip out CK_GetObjCProperty. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143910 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/OperationKinds.h | 7 ------- lib/AST/Expr.cpp | 3 --- lib/AST/ExprConstant.cpp | 2 -- lib/CodeGen/CGExpr.cpp | 2 -- lib/CodeGen/CGExprAgg.cpp | 2 -- lib/CodeGen/CGExprComplex.cpp | 1 - lib/CodeGen/CGExprConstant.cpp | 1 - lib/CodeGen/CGExprScalar.cpp | 1 - lib/CodeGen/CGObjC.cpp | 16 ---------------- lib/Sema/SemaChecking.cpp | 16 ---------------- lib/Sema/SemaExprCXX.cpp | 5 ----- lib/Sema/SemaExprObjC.cpp | 1 - lib/StaticAnalyzer/Core/ExprEngineC.cpp | 5 +---- 13 files changed, 1 insertion(+), 61 deletions(-) diff --git a/include/clang/AST/OperationKinds.h b/include/clang/AST/OperationKinds.h index 469da99a8c..87ba113b39 100644 --- a/include/clang/AST/OperationKinds.h +++ b/include/clang/AST/OperationKinds.h @@ -52,13 +52,6 @@ enum CastKind { /// 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 diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index 6eb6116b01..848e079744 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -1084,7 +1084,6 @@ void CastExpr::CheckCastConsistency() const { case CK_Dependent: case CK_LValueToRValue: - case CK_GetObjCProperty: case CK_NoOp: case CK_PointerToBoolean: case CK_IntegralToBoolean: @@ -1110,8 +1109,6 @@ const char *CastExpr::getCastKindName() const { return "LValueBitCast"; case CK_LValueToRValue: return "LValueToRValue"; - case CK_GetObjCProperty: - return "GetObjCProperty"; case CK_NoOp: return "NoOp"; case CK_BaseToDerived: diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp index 8ec16217a7..a9408f6384 100644 --- a/lib/AST/ExprConstant.cpp +++ b/lib/AST/ExprConstant.cpp @@ -2526,7 +2526,6 @@ bool IntExprEvaluator::VisitCastExpr(const CastExpr *E) { case CK_BitCast: case CK_Dependent: - case CK_GetObjCProperty: case CK_LValueBitCast: case CK_UserDefinedConversion: case CK_ARCProduceObject: @@ -2987,7 +2986,6 @@ bool ComplexExprEvaluator::VisitCastExpr(const CastExpr *E) { return ExprEvaluatorBaseTy::VisitCastExpr(E); case CK_Dependent: - case CK_GetObjCProperty: case CK_LValueBitCast: case CK_UserDefinedConversion: return false; diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index deea60cae0..d7e3168a3a 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -2010,8 +2010,6 @@ LValue CodeGenFunction::EmitCastLValue(const CastExpr *E) { 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() diff --git a/lib/CodeGen/CGExprAgg.cpp b/lib/CodeGen/CGExprAgg.cpp index cbb5dfee0d..0fda665963 100644 --- a/lib/CodeGen/CGExprAgg.cpp +++ b/lib/CodeGen/CGExprAgg.cpp @@ -333,8 +333,6 @@ void AggExprEmitter::VisitCastExpr(CastExpr *E) { "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: diff --git a/lib/CodeGen/CGExprComplex.cpp b/lib/CodeGen/CGExprComplex.cpp index 5cc30fe3c1..e62f9a620e 100644 --- a/lib/CodeGen/CGExprComplex.cpp +++ b/lib/CodeGen/CGExprComplex.cpp @@ -355,7 +355,6 @@ ComplexPairTy ComplexExprEmitter::EmitCast(CastExpr::CastKind CK, Expr *Op, 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: diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp index 889cdd8f09..7a1cbdeb1e 100644 --- a/lib/CodeGen/CGExprConstant.cpp +++ b/lib/CodeGen/CGExprConstant.cpp @@ -581,7 +581,6 @@ public: // These will never be supported. case CK_ObjCObjectLValueCast: - case CK_GetObjCProperty: case CK_ToVoid: case CK_Dynamic: case CK_ARCProduceObject: diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp index b888138dda..dfdf7b8640 100644 --- a/lib/CodeGen/CGExprScalar.cpp +++ b/lib/CodeGen/CGExprScalar.cpp @@ -1046,7 +1046,6 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) { // 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: { diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp index 6b40b40cad..88d19a3b6c 100644 --- a/lib/CodeGen/CGObjC.cpp +++ b/lib/CodeGen/CGObjC.cpp @@ -1087,22 +1087,6 @@ QualType CodeGenFunction::TypeOfSelfObject() { return PTy->getPointeeType(); } -static RValue GenerateMessageSendSuper(CodeGenFunction &CGF, - ReturnValueSlot Return, - QualType ResultType, - Selector S, - llvm::Value *Receiver, - const CallArgList &CallArgs) { - const ObjCMethodDecl *OMD = cast(CGF.CurFuncDecl); - bool isClassMessage = OMD->isClassMethod(); - bool isCategoryImpl = isa(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(); diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index 8a3324230d..50bc5755dd 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -4158,22 +4158,6 @@ static bool findRetainCycleOwner(Expr *e, RetainCycleOwner &owner) { 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(pre->getBase()); - continue; - } - default: return false; } diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp index f1cb5ea040..7249400965 100644 --- a/lib/Sema/SemaExprCXX.cpp +++ b/lib/Sema/SemaExprCXX.cpp @@ -4080,11 +4080,6 @@ ExprResult Sema::MaybeBindToTemporary(Expr *E) { ObjCMethodDecl *D = 0; if (ObjCMessageExpr *Send = dyn_cast(E)) { D = Send->getMethodDecl(); - } else { - CastExpr *CE = cast(E); - assert(CE->getCastKind() == CK_GetObjCProperty); - const ObjCPropertyRefExpr *PRE = CE->getSubExpr()->getObjCProperty(); - D = (PRE->isImplicitProperty() ? PRE->getImplicitPropertyGetter() : 0); } ReturnsRetained = (D && D->hasAttr()); diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp index a9179dcf7f..54a3af52ec 100644 --- a/lib/Sema/SemaExprObjC.cpp +++ b/lib/Sema/SemaExprObjC.cpp @@ -1696,7 +1696,6 @@ namespace { case CK_NoOp: case CK_LValueToRValue: case CK_BitCast: - case CK_GetObjCProperty: case CK_CPointerToObjCPointerCast: case CK_BlockPointerToObjCPointerCast: case CK_AnyPointerToBlockPointerCast: diff --git a/lib/StaticAnalyzer/Core/ExprEngineC.cpp b/lib/StaticAnalyzer/Core/ExprEngineC.cpp index 86570cb5d7..b82dfea58d 100644 --- a/lib/StaticAnalyzer/Core/ExprEngineC.cpp +++ b/lib/StaticAnalyzer/Core/ExprEngineC.cpp @@ -179,8 +179,7 @@ void ExprEngine::VisitCast(const CastExpr *CastE, const Expr *Ex, 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; @@ -206,8 +205,6 @@ void ExprEngine::VisitCast(const CastExpr *CastE, const Expr *Ex, 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, -- 2.40.0