aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprAgg.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2011-04-10 20:33:22 +0000
committerAnders Carlsson <andersca@mac.com>2011-04-10 20:33:22 +0000
commit7d99bc37e77157523e3bfbc6c077842b74e6690f (patch)
treef7abc6739dafe6154c2cf073e8dc3fd39306bf24 /lib/CodeGen/CGExprAgg.cpp
parentfb8721ce4c6fef3739b1cbd1e38e3f1949462033 (diff)
As a first step towards fixing PR9641, add a CK_DynamicToNull cast kind which
represents a dynamic cast where we know that the result is always null. For example: struct A { virtual ~A(); }; struct B final : A { }; struct C { }; bool f(B* b) { return dynamic_cast<C*>(b); } git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129256 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprAgg.cpp')
-rw-r--r--lib/CodeGen/CGExprAgg.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/CodeGen/CGExprAgg.cpp b/lib/CodeGen/CGExprAgg.cpp
index 75e3a7879d..5e1ac3cbac 100644
--- a/lib/CodeGen/CGExprAgg.cpp
+++ b/lib/CodeGen/CGExprAgg.cpp
@@ -255,7 +255,10 @@ void AggExprEmitter::VisitCastExpr(CastExpr *E) {
}
switch (E->getCastKind()) {
- case CK_Dynamic: {
+ case CK_Dynamic:
+ case CK_DynamicToNull: {
+
+ // FIXME: Actually handle DynamicToNull here.
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?