summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-09-09 20:25:21 +0000
committerChris Lattner <sabre@nondot.org>2002-09-09 20:25:21 +0000
commitff16f0701788e3077bd8ce24746ef1ea6bb15cd4 (patch)
tree9127149b1d7da5b4f748bb6fb30bb6bb24b7b388 /llvm/lib/Transforms
parent7e03b6ee33d3093492b6e32454428ee50cbe32ed (diff)
downloadbcm5719-llvm-ff16f0701788e3077bd8ce24746ef1ea6bb15cd4.tar.gz
bcm5719-llvm-ff16f0701788e3077bd8ce24746ef1ea6bb15cd4.zip
Disallow creation of pointer typed shift instructions
llvm-svn: 3637
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/ExprTypeConvert.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/ExprTypeConvert.cpp b/llvm/lib/Transforms/ExprTypeConvert.cpp
index 01c8d6f354b..0a42f218017 100644
--- a/llvm/lib/Transforms/ExprTypeConvert.cpp
+++ b/llvm/lib/Transforms/ExprTypeConvert.cpp
@@ -1,4 +1,4 @@
-//===- ExprTypeConvert.cpp - Code to change an LLVM Expr Type ---------------=//
+//===- ExprTypeConvert.cpp - Code to change an LLVM Expr Type -------------===//
//
// This file implements the part of level raising that checks to see if it is
// possible to coerce an entire expression tree into a different type. If
@@ -193,9 +193,11 @@ bool ExpressionConvertableToType(Value *V, const Type *Ty,
return false;
break;
case Instruction::Shr:
+ if (!Ty->isInteger()) return false;
if (Ty->isSigned() != V->getType()->isSigned()) return false;
// FALL THROUGH
case Instruction::Shl:
+ if (!Ty->isInteger()) return false;
if (!ExpressionConvertableToType(I->getOperand(0), Ty, CTMap))
return false;
break;
@@ -633,6 +635,7 @@ static bool OperandConvertableToType(User *U, Value *V, const Type *Ty,
// FALL THROUGH
case Instruction::Shl:
assert(I->getOperand(0) == V);
+ if (!Ty->isInteger()) return false;
return ValueConvertableToType(I, Ty, CTMap);
case Instruction::Free:
OpenPOWER on IntegriCloud