[llvm-commits] CVS: llvm/lib/Transforms/ExprTypeConvert.cpp

Christopher Lattner lattner at cs.uiuc.edu
Mon Sep 9 15:26:01 PDT 2002


Changes in directory llvm/lib/Transforms:

ExprTypeConvert.cpp updated: 1.51 -> 1.52

---
Log message:

Disallow creation of pointer typed shift instructions


---
Diffs of the changes:

Index: llvm/lib/Transforms/ExprTypeConvert.cpp
diff -u llvm/lib/Transforms/ExprTypeConvert.cpp:1.51 llvm/lib/Transforms/ExprTypeConvert.cpp:1.52
--- llvm/lib/Transforms/ExprTypeConvert.cpp:1.51	Fri Aug 30 17:53:07 2002
+++ llvm/lib/Transforms/ExprTypeConvert.cpp	Mon Sep  9 15:25:21 2002
@@ -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 @@
       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 @@
     // FALL THROUGH
   case Instruction::Shl:
     assert(I->getOperand(0) == V);
+    if (!Ty->isInteger()) return false;
     return ValueConvertableToType(I, Ty, CTMap);
 
   case Instruction::Free:





More information about the llvm-commits mailing list