[ConstantFold] Fix bitcast to gep constant folding transform.
authorDavid Majnemer <david.majnemer@gmail.com>
Mon, 14 Dec 2015 19:30:32 +0000 (19:30 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Mon, 14 Dec 2015 19:30:32 +0000 (19:30 +0000)
commit1d7a67937c4624967442dae997a6cd0c0a9c0b72
tree9eabae153557736973ebb7a66317209a8fa73609
parent040ff9fa3ea79016a8e95c013adc52ce4cc7eee2
[ConstantFold] Fix bitcast to gep constant folding transform.

Make sure to check that the destination type is sized.
A check was present but was incorrectly checking the source type
instead.

Patch by Amaury SECHET!

Differential Revision: http://reviews.llvm.org/D15264

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255536 91177308-0d34-0410-b5e6-96231b3b80d8
lib/IR/ConstantFold.cpp
test/Assembler/ConstantExprFoldCast.ll
unittests/IR/ConstantsTest.cpp