X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FAnalysis%2FProfileVerifierPass.cpp;h=a01751849c519d16eeeba7064b79e1a2fc052b61;hb=4dbe200b2d3da0dfd1c788c9650b8b8075c241aa;hp=a2ddc8e1f33f4cecdcad17c833fb041feb1f1a8c;hpb=3b519f62fcf1d38ef9c6478c1d5fce19bcb36282;p=oota-llvm.git diff --git a/lib/Analysis/ProfileVerifierPass.cpp b/lib/Analysis/ProfileVerifierPass.cpp index a2ddc8e1f33..a01751849c5 100644 --- a/lib/Analysis/ProfileVerifierPass.cpp +++ b/lib/Analysis/ProfileVerifierPass.cpp @@ -59,11 +59,13 @@ namespace llvm { public: static char ID; // Class identification, replacement for typeinfo - explicit ProfileVerifierPassT () : FunctionPass(&ID) { + explicit ProfileVerifierPassT () : FunctionPass(ID) { + initializeProfileVerifierPassPass(*PassRegistry::getPassRegistry()); DisableAssertions = ProfileVerifierDisableAssertions; } - explicit ProfileVerifierPassT (bool da) : FunctionPass(&ID), + explicit ProfileVerifierPassT (bool da) : FunctionPass(ID), DisableAssertions(da) { + initializeProfileVerifierPassPass(*PassRegistry::getPassRegistry()); } void getAnalysisUsage(AnalysisUsage &AU) const { @@ -96,8 +98,8 @@ namespace llvm { double inWeight = 0; int inCount = 0; std::set ProcessedPreds; - for ( pred_const_iterator bbi = pred_begin(BB), bbe = pred_end(BB); - bbi != bbe; ++bbi ) { + for (const_pred_iterator bbi = pred_begin(BB), bbe = pred_end(BB); + bbi != bbe; ++bbi ) { if (ProcessedPreds.insert(*bbi).second) { typename ProfileInfoT::Edge E = PI->getEdge(*bbi,BB); double EdgeWeight = PI->getEdgeWeight(E); @@ -242,7 +244,7 @@ namespace llvm { // Read predecessors. std::set ProcessedPreds; - pred_const_iterator bpi = pred_begin(BB), bpe = pred_end(BB); + const_pred_iterator bpi = pred_begin(BB), bpe = pred_end(BB); // If there are none, check for (0,BB) edge. if (bpi == bpe) { DI.inWeight += ReadOrAssert(PI->getEdge(0,BB)); @@ -287,7 +289,7 @@ namespace llvm { i != ie; ++i) { if (const CallInst *CI = dyn_cast(&*i)) { FType *F = CI->getCalledFunction(); - if (F && (F->getNameStr() == "_setjmp")) { + if (F && (F->getName() == "_setjmp")) { isSetJmpTarget = true; break; } } @@ -366,8 +368,11 @@ namespace llvm { char ProfileVerifierPassT::ID = 0; } -static RegisterPass -X("profile-verifier", "Verify profiling information", false, true); +INITIALIZE_PASS_BEGIN(ProfileVerifierPass, "profile-verifier", + "Verify profiling information", false, true) +INITIALIZE_AG_DEPENDENCY(ProfileInfo) +INITIALIZE_PASS_END(ProfileVerifierPass, "profile-verifier", + "Verify profiling information", false, true) namespace llvm { FunctionPass *createProfileVerifierPass() {