#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Utils/Local.h"
#include "TransformInternals.h"
-#include "llvm/iOther.h"
-#include "llvm/iMemory.h"
+#include "llvm/Instructions.h"
#include "llvm/Pass.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
-#include "Support/CommandLine.h"
-#include "Support/Debug.h"
-#include "Support/Statistic.h"
-#include "Support/STLExtras.h"
+#include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Debug.h"
+#include "llvm/ADT/Statistic.h"
+#include "llvm/ADT/STLExtras.h"
#include <algorithm>
using namespace llvm;
// Make sure the source doesn't change type
ConvertedTypes[Src] = Src->getType();
if (ValueConvertibleToType(CI, Src->getType(), ConvertedTypes, TD)) {
- PRINT_PEEPHOLE3("CAST-DEST-EXPR-CONV:in ", *Src, *CI, *BB->getParent());
+ //PRINT_PEEPHOLE3("CAST-DEST-EXPR-CONV:in ", *Src, *CI,
+ // *BB->getParent());
DEBUG(std::cerr << "\nCONVERTING EXPR TYPE:\n");
{ // ValueMap must be destroyed before function verified!
Constant *ConstantCallSrc = 0;
if (Constant *CS = dyn_cast<Constant>(CI->getCalledValue()))
ConstantCallSrc = CS;
- else if (GlobalValue *GV = dyn_cast<GlobalValue>(CI->getCalledValue()))
- ConstantCallSrc = ConstantPointerRef::get(GV);
if (ConstantCallSrc)
NewCast = ConstantExpr::getCast(ConstantCallSrc, NewPFunTy);
NewCast = new CastInst(CI->getCalledValue(), NewPFunTy,
CI->getCalledValue()->getName()+"_c",CI);
- // Strip off unneeded CPR's.
- if (ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(NewCast))
- NewCast = CPR->getValue();
-
// Create a new call instruction...
CallInst *NewCall = new CallInst(NewCast,
std::vector<Value*>(CI->op_begin()+1, CI->op_end()));