#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/Debug.h"
#include <algorithm>
-#include <iostream>
using namespace llvm;
static bool OperandConvertibleToType(User *U, Value *V, const Type *Ty,
return VMCI->second;
}
- DEBUG(std::cerr << "CETT: " << (void*)V << " " << *V);
+ DOUT << "CETT: " << (void*)V << " " << *V;
Instruction *I = dyn_cast<Instruction>(V);
if (I == 0) {
if (NumUses == OldSize) ++It;
}
- DEBUG(std::cerr << "ExpIn: " << (void*)I << " " << *I
- << "ExpOut: " << (void*)Res << " " << *Res);
+ DOUT << "ExpIn: " << (void*)I << " " << *I
+ << "ExpOut: " << (void*)Res << " " << *Res;
return Res;
}
I->setName("");
Instruction *Res; // Result of conversion
- //std::cerr << endl << endl << "Type:\t" << Ty << "\nInst: " << I
+ //llvm_cerr << endl << endl << "Type:\t" << Ty << "\nInst: " << I
// << "BB Before: " << BB << endl;
// Prevent I from being removed...
assert(It != BB->end() && "Instruction not in own basic block??");
BB->getInstList().insert(It, Res); // Keep It pointing to old instruction
- DEBUG(std::cerr << "COT CREATED: " << (void*)Res << " " << *Res
- << "In: " << (void*)I << " " << *I << "Out: " << (void*)Res
- << " " << *Res);
+ DOUT << "COT CREATED: " << (void*)Res << " " << *Res
+ << "In: " << (void*)I << " " << *I << "Out: " << (void*)Res
+ << " " << *Res;
// Add the instruction to the expression map
VMC.ExprMap[I] = Res;
ValueHandle::ValueHandle(ValueMapCache &VMC, Value *V)
: Instruction(Type::VoidTy, UserOp1, &Op, 1, ""), Op(V, this), Cache(VMC) {
- //DEBUG(std::cerr << "VH AQUIRING: " << (void*)V << " " << V);
+ //DOUT << "VH AQUIRING: " << (void*)V << " " << V;
}
ValueHandle::ValueHandle(const ValueHandle &VH)
: Instruction(Type::VoidTy, UserOp1, &Op, 1, ""),
Op(VH.Op, this), Cache(VH.Cache) {
- //DEBUG(std::cerr << "VH AQUIRING: " << (void*)V << " " << V);
+ //DOUT << "VH AQUIRING: " << (void*)V << " " << V;
}
static void RecursiveDelete(ValueMapCache &Cache, Instruction *I) {
assert(I->getParent() && "Inst not in basic block!");
- //DEBUG(std::cerr << "VH DELETING: " << (void*)I << " " << I);
+ //DOUT << "VH DELETING: " << (void*)I << " " << I;
for (User::op_iterator OI = I->op_begin(), OE = I->op_end();
OI != OE; ++OI)
//
RecursiveDelete(Cache, dyn_cast<Instruction>(V));
} else {
- //DEBUG(std::cerr << "VH RELEASING: " << (void*)Operands[0].get() << " "
- // << Operands[0]->getNumUses() << " " << Operands[0]);
+ //DOUT << "VH RELEASING: " << (void*)Operands[0].get() << " "
+ // << Operands[0]->getNumUses() << " " << Operands[0];
}
}
-