X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FAnalysis%2FProfileInfo.cpp;h=173de2c027915ec5325fea750515d05325c30f58;hb=4032eaf98c63b0fb1f2418a1cdc56b72bc76c329;hp=fc7f28662c017b1670d5a42895730da815832389;hpb=90c579de5a383cee278acc3f7e7b9d0a656e6a35;p=oota-llvm.git diff --git a/lib/Analysis/ProfileInfo.cpp b/lib/Analysis/ProfileInfo.cpp index fc7f28662c0..173de2c0279 100644 --- a/lib/Analysis/ProfileInfo.cpp +++ b/lib/Analysis/ProfileInfo.cpp @@ -24,8 +24,12 @@ #include using namespace llvm; +namespace llvm { + template<> char ProfileInfoT::ID = 0; +} + // Register the ProfileInfo interface, providing a nice name to refer to. -static RegisterAnalysisGroup Z("Profile Information"); +INITIALIZE_ANALYSIS_GROUP(ProfileInfo, "Profile Information", NoProfileInfo) namespace llvm { @@ -43,9 +47,6 @@ ProfileInfoT::~ProfileInfoT() { if (MachineProfile) delete MachineProfile; } -template<> -char ProfileInfoT::ID = 0; - template<> char ProfileInfoT::ID = 0; @@ -308,9 +309,9 @@ void ProfileInfoT:: removeEdge(oldedge); } -/// Replaces all occurences of RmBB in the ProfilingInfo with DestBB. +/// Replaces all occurrences of RmBB in the ProfilingInfo with DestBB. /// This checks all edges of the function the blocks reside in and replaces the -/// occurences of RmBB with DestBB. +/// occurrences of RmBB with DestBB. template<> void ProfileInfoT:: replaceAllUses(const BasicBlock *RmBB, const BasicBlock *DestBB) { @@ -811,7 +812,7 @@ void ProfileInfoT::repair(const Function *F) { } if (iw < 0) continue; - // Check the recieving end of the path if it can handle the flow. + // Check the receiving end of the path if it can handle the flow. double ow = getExecutionCount(Dest); Processed.clear(); for (succ_const_iterator NBB = succ_begin(BB), End = succ_end(BB); @@ -888,7 +889,7 @@ void ProfileInfoT::repair(const Function *F) { FI = Unvisited.begin(), FE = Unvisited.end(); while(FI != FE && !FoundPath) { const BasicBlock *BB = *FI; ++FI; - const BasicBlock *Dest; + const BasicBlock *Dest = 0; Path P; bool BackEdgeFound = false; for (const_pred_iterator NBB = pred_begin(BB), End = pred_end(BB); @@ -1076,7 +1077,9 @@ raw_ostream& operator<<(raw_ostream &O, std::pair