Remove dead code
[oota-llvm.git] / lib / Transforms / TransformInternals.h
index 7bc3df4fc37654b523bcae9b32fd0eaf3dfe9774..f57ed3ea6ecfab099e7b83e92a0e523a0f9ce4fa 100644 (file)
@@ -12,7 +12,7 @@
 #include "llvm/Instruction.h"
 #include "llvm/Target/TargetData.h"
 #include "llvm/DerivedTypes.h"
-#include "llvm/ConstantVals.h"
+#include "llvm/Constants.h"
 #include <map>
 #include <set>
 
@@ -26,8 +26,8 @@ extern const TargetData TD;
 
 static inline int getConstantValue(const ConstantInt *CPI) {
   if (const ConstantSInt *CSI = dyn_cast<ConstantSInt>(CPI))
-    return CSI->getValue();
-  return cast<ConstantUInt>(CPI)->getValue();
+    return (int)CSI->getValue();
+  return (int)cast<ConstantUInt>(CPI)->getValue();
 }
 
 
@@ -55,6 +55,13 @@ void ReplaceInstWithInst(BasicBlock::InstListType &BIL,
 
 void ReplaceInstWithInst(Instruction *From, Instruction *To);
 
+// InsertInstBeforeInst - Insert 'NewInst' into the basic block that 'Existing'
+// is already in, and put it right before 'Existing'.  This instruction should
+// only be used when there is no iterator to Existing already around.  The 
+// returned iterator points to the new instruction.
+//
+BasicBlock::iterator InsertInstBeforeInst(Instruction *NewInst,
+                                          Instruction *Existing);
 
 // ConvertableToGEP - This function returns true if the specified value V is
 // a valid index into a pointer of type Ty.  If it is valid, Idx is filled in