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 | f1ae6d45dd8061db06d55e5b074fbc9852271ec4 (patch) | |
tree | 827adcf3630624cc74cbb0e66c7c491e07e6a51e /clang/lib/CodeGen/CGExprScalar.cpp | |
parent | 6904f644e77d85ed43813005a5c82a05315be6b3 (diff) | |
download | bcm5719-llvm-f1ae6d45dd8061db06d55e5b074fbc9852271ec4.tar.gz bcm5719-llvm-f1ae6d45dd8061db06d55e5b074fbc9852271ec4.zip |
Use the correct cast kinds for bit casts and function to pointer decay. Fixes PR4827.
llvm-svn: 80720
Diffstat (limited to 'clang/lib/CodeGen/CGExprScalar.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGExprScalar.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp index f3a841dbb2f..4496c538d3c 100644 --- a/clang/lib/CodeGen/CGExprScalar.cpp +++ b/clang/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!"); |