diff options
author | David Majnemer <david.majnemer@gmail.com> | 2015-02-16 09:37:35 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2015-02-16 09:37:35 +0000 |
commit | 8b576a579a94501a9fb8ec3869d383999b8031f9 (patch) | |
tree | 60e4bc6b20e03c4844d796970f5b6cff335e9eb1 /llvm/lib/IR/Instructions.cpp | |
parent | 7ccc34dbc163f93fb36c59c961b355c97f4455ea (diff) | |
download | bcm5719-llvm-8b576a579a94501a9fb8ec3869d383999b8031f9.tar.gz bcm5719-llvm-8b576a579a94501a9fb8ec3869d383999b8031f9.zip |
IR: SrcTy == DstTy doesn't imply that a cast is valid
Cast validity depends on the cast's kind, not just its types.
llvm-svn: 229366
Diffstat (limited to 'llvm/lib/IR/Instructions.cpp')
-rw-r--r-- | llvm/lib/IR/Instructions.cpp | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp index 8c4eeafdf84..7136923ecb4 100644 --- a/llvm/lib/IR/Instructions.cpp +++ b/llvm/lib/IR/Instructions.cpp @@ -2864,10 +2864,6 @@ CastInst::castIsValid(Instruction::CastOps op, Value *S, Type *DstTy) { // Check for type sanity on the arguments Type *SrcTy = S->getType(); - // If this is a cast to the same type then it's trivially true. - if (SrcTy == DstTy) - return true; - if (!SrcTy->isFirstClassType() || !DstTy->isFirstClassType() || SrcTy->isAggregateType() || DstTy->isAggregateType()) return false; |