diff options
author | Anders Carlsson <andersca@mac.com> | 2009-09-01 20:52:42 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-09-01 20:52:42 +0000 |
commit | cb3c308ef0e63b2902911b985517309c26f975dc (patch) | |
tree | 506b7185ffd4212a8ba8a4310015e3e0f9a30e70 /lib/CodeGen | |
parent | b633c4ee622df81d4572ef57dac54ebed69bb9bf (diff) |
Use the correct cast kinds for bit casts and function to pointer decay. Fixes PR4827.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80720 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/CGExprScalar.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp index f3a841dbb2..4496c538d3 100644 --- a/lib/CodeGen/CGExprScalar.cpp +++ b/lib/CodeGen/CGExprScalar.cpp @@ -627,6 +627,10 @@ Value *ScalarExprEmitter::EmitCastExpr(const Expr *E, QualType DestTy, switch (Kind) { default: break; + case CastExpr::CK_BitCast: { + Value *Src = Visit(const_cast<Expr*>(E)); + return Builder.CreateBitCast(Src, ConvertType(DestTy)); + } case CastExpr::CK_ArrayToPointerDecay: { assert(E->getType()->isArrayType() && "Array to pointer decay must have array source type!"); |