for (Value::use_iterator begin = (*I)->use_begin(),
end = (*I)->use_end(); begin != end; ++begin) {
// Test if the Use of the Value is in a comparator
- if (CmpInst *CI = dyn_cast<CmpInst>(begin)) {
+ if (CmpInst *CI = dyn_cast<CmpInst>(*begin)) {
// Iterates through all uses of CmpInst
for (Value::use_iterator begin_ci = CI->use_begin(),
end_ci = CI->use_end(); begin_ci != end_ci; ++begin_ci) {
// Test if any use of CmpInst is in a Terminator
- if (TerminatorInst *TI = dyn_cast<TerminatorInst>(begin_ci)) {
+ if (TerminatorInst *TI = dyn_cast<TerminatorInst>(*begin_ci)) {
insertSigma(TI, *I);
}
}
FunctionPass *llvm::createSSIPass() { return new SSI(); }
char SSI::ID = 0;
-static RegisterPass<SSI> X("ssi", "Static Single Information Construction");
+INITIALIZE_PASS(SSI, "ssi",
+ "Static Single Information Construction", false, false);
/// SSIEverything - A pass that runs createSSI on every non-void variable,
/// intended for debugging.
namespace {
struct SSIEverything : public FunctionPass {
static char ID; // Pass identification, replacement for typeid
- SSIEverything() : FunctionPass(&ID) {}
+ SSIEverything() : FunctionPass(ID) {}
bool runOnFunction(Function &F);
for (Function::iterator B = F.begin(), BE = F.end(); B != BE; ++B)
for (BasicBlock::iterator I = B->begin(), E = B->end(); I != E; ++I)
- if (I->getType() != Type::getVoidTy(F.getContext()))
+ if (!I->getType()->isVoidTy())
Insts.push_back(I);
ssi.createSSI(Insts);
FunctionPass *llvm::createSSIEverythingPass() { return new SSIEverything(); }
char SSIEverything::ID = 0;
-static RegisterPass<SSIEverything>
-Y("ssi-everything", "Static Single Information Construction");
+INITIALIZE_PASS(SSIEverything, "ssi-everything",
+ "Static Single Information Construction", false, false);