diff options
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/include/clang/AST/Expr.h | 1 | ||||
| -rw-r--r-- | clang/include/clang/AST/OperationKinds.h | 4 | ||||
| -rw-r--r-- | clang/lib/AST/Expr.cpp | 2 | ||||
| -rw-r--r-- | clang/lib/AST/ExprConstant.cpp | 2 | ||||
| -rw-r--r-- | clang/lib/CodeGen/CGExpr.cpp | 3 | ||||
| -rw-r--r-- | clang/lib/CodeGen/CGExprAgg.cpp | 5 | ||||
| -rw-r--r-- | clang/lib/CodeGen/CGExprConstant.cpp | 1 | ||||
| -rw-r--r-- | clang/lib/CodeGen/CGExprScalar.cpp | 3 | ||||
| -rw-r--r-- | clang/lib/Sema/SemaCXXCast.cpp | 8 | ||||
| -rw-r--r-- | clang/lib/StaticAnalyzer/Core/ExprEngine.cpp | 1 | 
10 files changed, 3 insertions, 27 deletions
| diff --git a/clang/include/clang/AST/Expr.h b/clang/include/clang/AST/Expr.h index 4ef29642d1c..110c4a73235 100644 --- a/clang/include/clang/AST/Expr.h +++ b/clang/include/clang/AST/Expr.h @@ -2183,7 +2183,6 @@ private:      // These should not have an inheritance path.      case CK_BitCast:      case CK_Dynamic: -    case CK_DynamicToNull:      case CK_ToUnion:      case CK_ArrayToPointerDecay:      case CK_FunctionToPointerDecay: diff --git a/clang/include/clang/AST/OperationKinds.h b/clang/include/clang/AST/OperationKinds.h index 6e16d2196a3..ab9d97dbb79 100644 --- a/clang/include/clang/AST/OperationKinds.h +++ b/clang/include/clang/AST/OperationKinds.h @@ -82,10 +82,6 @@ enum CastKind {    /// CK_Dynamic - A C++ dynamic_cast.    CK_Dynamic, -  /// CK_DynamicToNull - A C++ dynamic_cast that can be proven to -  /// always yield a null result. -  CK_DynamicToNull, -    /// CK_ToUnion - The GCC cast-to-union extension.    ///   int   -> union { int x; float y; }    ///   float -> union { int x; float y; } diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp index 227d6569ddc..28f42124f98 100644 --- a/clang/lib/AST/Expr.cpp +++ b/clang/lib/AST/Expr.cpp @@ -987,8 +987,6 @@ const char *CastExpr::getCastKindName() const {      return "UncheckedDerivedToBase";    case CK_Dynamic:      return "Dynamic"; -  case CK_DynamicToNull: -    return "DynamicToNull";    case CK_ToUnion:      return "ToUnion";    case CK_ArrayToPointerDecay: diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index aa8d91a6d6d..e0f99582982 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -1768,7 +1768,6 @@ bool IntExprEvaluator::VisitCastExpr(CastExpr *E) {    case CK_DerivedToBase:    case CK_UncheckedDerivedToBase:    case CK_Dynamic: -  case CK_DynamicToNull:    case CK_ToUnion:    case CK_ArrayToPointerDecay:    case CK_FunctionToPointerDecay: @@ -2316,7 +2315,6 @@ bool ComplexExprEvaluator::VisitCastExpr(CastExpr *E) {    case CK_DerivedToBase:    case CK_UncheckedDerivedToBase:    case CK_Dynamic: -  case CK_DynamicToNull:    case CK_ToUnion:    case CK_ArrayToPointerDecay:    case CK_FunctionToPointerDecay: diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp index ad51316a1f5..a35f81ca206 100644 --- a/clang/lib/CodeGen/CGExpr.cpp +++ b/clang/lib/CodeGen/CGExpr.cpp @@ -1867,8 +1867,7 @@ LValue CodeGenFunction::EmitCastLValue(const CastExpr *E) {      return MakeAddrLValue(V, E->getType());    } -  case CK_Dynamic: -  case CK_DynamicToNull: { +  case CK_Dynamic: {      LValue LV = EmitLValue(E->getSubExpr());      llvm::Value *V = LV.getAddress();      const CXXDynamicCastExpr *DCE = cast<CXXDynamicCastExpr>(E); diff --git a/clang/lib/CodeGen/CGExprAgg.cpp b/clang/lib/CodeGen/CGExprAgg.cpp index 5e1ac3cbacb..75e3a7879d4 100644 --- a/clang/lib/CodeGen/CGExprAgg.cpp +++ b/clang/lib/CodeGen/CGExprAgg.cpp @@ -255,10 +255,7 @@ void AggExprEmitter::VisitCastExpr(CastExpr *E) {    }    switch (E->getCastKind()) { -  case CK_Dynamic: -  case CK_DynamicToNull: { - -    // FIXME: Actually handle DynamicToNull here. +  case CK_Dynamic: {      assert(isa<CXXDynamicCastExpr>(E) && "CK_Dynamic without a dynamic_cast?");      LValue LV = CGF.EmitCheckedLValue(E->getSubExpr());      // FIXME: Do we also need to handle property references here? diff --git a/clang/lib/CodeGen/CGExprConstant.cpp b/clang/lib/CodeGen/CGExprConstant.cpp index 578a37f0fcf..822a999b963 100644 --- a/clang/lib/CodeGen/CGExprConstant.cpp +++ b/clang/lib/CodeGen/CGExprConstant.cpp @@ -552,7 +552,6 @@ public:      case CK_GetObjCProperty:      case CK_ToVoid:      case CK_Dynamic: -    case CK_DynamicToNull:      case CK_ResolveUnknownAnyType:        return 0; diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp index 322b6e0c498..65aa46fff06 100644 --- a/clang/lib/CodeGen/CGExprScalar.cpp +++ b/clang/lib/CodeGen/CGExprScalar.cpp @@ -1053,8 +1053,7 @@ Value *ScalarExprEmitter::EmitCastExpr(CastExpr *CE) {                                       CE->path_begin(), CE->path_end(),                                       ShouldNullCheckClassCastValue(CE));    } -  case CK_Dynamic: -  case CK_DynamicToNull: { +  case CK_Dynamic: {      Value *V = Visit(const_cast<Expr*>(E));      const CXXDynamicCastExpr *DCE = cast<CXXDynamicCastExpr>(CE);      return CGF.EmitDynamicCast(V, DCE); diff --git a/clang/lib/Sema/SemaCXXCast.cpp b/clang/lib/Sema/SemaCXXCast.cpp index 52a13ef5b29..31a772a5d8e 100644 --- a/clang/lib/Sema/SemaCXXCast.cpp +++ b/clang/lib/Sema/SemaCXXCast.cpp @@ -522,14 +522,6 @@ CheckDynamicCast(Sema &Self, ExprResult &SrcExpr, QualType DestType,      return;    } -  // If the source class is marked 'final', and the destination class does not -  // derive from the source class, then we know that the result is always null. -  if (SrcRecord->getDecl()->hasAttr<FinalAttr>() && -      !Self.IsDerivedFrom(DestPointee, SrcPointee)) { -    Kind = CK_DynamicToNull; -    return; -  } -    // C++ 5.2.7p5    // Upcasts are resolved statically.    if (DestRecord && Self.IsDerivedFrom(SrcPointee, DestPointee)) { diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp index 6a7637097b0..0a7f1e93af1 100644 --- a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp +++ b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp @@ -2178,7 +2178,6 @@ void ExprEngine::VisitCast(const CastExpr *CastE, const Expr *Ex,        // Various C++ casts that are not handled yet.        case CK_ResolveUnknownAnyType:        case CK_Dynamic: -      case CK_DynamicToNull:        case CK_ToUnion:        case CK_BaseToDerived:        case CK_NullToMemberPointer: | 

