[cfe-commits] r129265 - in /cfe/trunk: include/clang/AST/Expr.h include/clang/AST/OperationKinds.h lib/AST/Expr.cpp lib/AST/ExprConstant.cpp lib/CodeGen/CGExpr.cpp lib/CodeGen/CGExprAgg.cpp lib/CodeGen/CGExprConstant.cpp lib/CodeGen/CGExprScalar.cpp lib/Sema/SemaCXXCast.cpp lib/StaticAnalyzer/Core/ExprEngine.cpp
Anders Carlsson
andersca at mac.com
Sun Apr 10 19:03:26 PDT 2011
Author: andersca
Date: Sun Apr 10 21:03:26 2011
New Revision: 129265
URL: http://llvm.org/viewvc/llvm-project?rev=129265&view=rev
Log:
Remove CK_DynamicToNull.
Modified:
cfe/trunk/include/clang/AST/Expr.h
cfe/trunk/include/clang/AST/OperationKinds.h
cfe/trunk/lib/AST/Expr.cpp
cfe/trunk/lib/AST/ExprConstant.cpp
cfe/trunk/lib/CodeGen/CGExpr.cpp
cfe/trunk/lib/CodeGen/CGExprAgg.cpp
cfe/trunk/lib/CodeGen/CGExprConstant.cpp
cfe/trunk/lib/CodeGen/CGExprScalar.cpp
cfe/trunk/lib/Sema/SemaCXXCast.cpp
cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp
Modified: cfe/trunk/include/clang/AST/Expr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Expr.h?rev=129265&r1=129264&r2=129265&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Expr.h (original)
+++ cfe/trunk/include/clang/AST/Expr.h Sun Apr 10 21:03:26 2011
@@ -2183,7 +2183,6 @@
// 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:
Modified: cfe/trunk/include/clang/AST/OperationKinds.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/OperationKinds.h?rev=129265&r1=129264&r2=129265&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/OperationKinds.h (original)
+++ cfe/trunk/include/clang/AST/OperationKinds.h Sun Apr 10 21:03:26 2011
@@ -82,10 +82,6 @@
/// 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; }
Modified: cfe/trunk/lib/AST/Expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Expr.cpp?rev=129265&r1=129264&r2=129265&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Expr.cpp (original)
+++ cfe/trunk/lib/AST/Expr.cpp Sun Apr 10 21:03:26 2011
@@ -987,8 +987,6 @@
return "UncheckedDerivedToBase";
case CK_Dynamic:
return "Dynamic";
- case CK_DynamicToNull:
- return "DynamicToNull";
case CK_ToUnion:
return "ToUnion";
case CK_ArrayToPointerDecay:
Modified: cfe/trunk/lib/AST/ExprConstant.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ExprConstant.cpp?rev=129265&r1=129264&r2=129265&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ExprConstant.cpp (original)
+++ cfe/trunk/lib/AST/ExprConstant.cpp Sun Apr 10 21:03:26 2011
@@ -1768,7 +1768,6 @@
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 @@
case CK_DerivedToBase:
case CK_UncheckedDerivedToBase:
case CK_Dynamic:
- case CK_DynamicToNull:
case CK_ToUnion:
case CK_ArrayToPointerDecay:
case CK_FunctionToPointerDecay:
Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=129265&r1=129264&r2=129265&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Sun Apr 10 21:03:26 2011
@@ -1867,8 +1867,7 @@
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);
Modified: cfe/trunk/lib/CodeGen/CGExprAgg.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprAgg.cpp?rev=129265&r1=129264&r2=129265&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprAgg.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprAgg.cpp Sun Apr 10 21:03:26 2011
@@ -255,10 +255,7 @@
}
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?
Modified: cfe/trunk/lib/CodeGen/CGExprConstant.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprConstant.cpp?rev=129265&r1=129264&r2=129265&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprConstant.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprConstant.cpp Sun Apr 10 21:03:26 2011
@@ -552,7 +552,6 @@
case CK_GetObjCProperty:
case CK_ToVoid:
case CK_Dynamic:
- case CK_DynamicToNull:
case CK_ResolveUnknownAnyType:
return 0;
Modified: cfe/trunk/lib/CodeGen/CGExprScalar.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprScalar.cpp?rev=129265&r1=129264&r2=129265&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprScalar.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprScalar.cpp Sun Apr 10 21:03:26 2011
@@ -1053,8 +1053,7 @@
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);
Modified: cfe/trunk/lib/Sema/SemaCXXCast.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaCXXCast.cpp?rev=129265&r1=129264&r2=129265&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaCXXCast.cpp (original)
+++ cfe/trunk/lib/Sema/SemaCXXCast.cpp Sun Apr 10 21:03:26 2011
@@ -522,14 +522,6 @@
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)) {
Modified: cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp?rev=129265&r1=129264&r2=129265&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp Sun Apr 10 21:03:26 2011
@@ -2178,7 +2178,6 @@
// 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:
More information about the cfe-commits
mailing list