diff options
author | Anders Carlsson <andersca@mac.com> | 2009-08-24 18:26:39 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-08-24 18:26:39 +0000 |
commit | e9776247577715ad3a19461769a3488a445a8cbd (patch) | |
tree | 99df917699cb1433115a4c12c04f7d417d76b038 /lib/CodeGen/CGExprScalar.cpp | |
parent | 4e382f3130834ac9862047a1f40402f261424774 (diff) |
Handle CK_NullToMemberPointer in ScalarExprEmitter::EmitCast
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79929 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprScalar.cpp')
-rw-r--r-- | lib/CodeGen/CGExprScalar.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp index d94ee5bed2..0524b44718 100644 --- a/lib/CodeGen/CGExprScalar.cpp +++ b/lib/CodeGen/CGExprScalar.cpp @@ -656,7 +656,14 @@ Value *ScalarExprEmitter::EmitCastExpr(const Expr *E, QualType DestTy, CastExpr::CastKind Kind) { if (!DestTy->isVoidType()) TestAndClearIgnoreResultAssign(); - + + switch (Kind) { + default: + break; + case CastExpr::CK_NullToMemberPointer: + return CGF.CGM.EmitNullConstant(DestTy); + } + // Handle cases where the source is an non-complex type. if (!CGF.hasAggregateLLVMType(E->getType())) { |