From a94c1b2ee202d72c80fc1103f46467ea538ceb48 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Thu, 13 Aug 2009 01:55:43 +0000 Subject: [PATCH] Update llvm-prof for ProfileInfo API changes. - Patch by Erick Tryzelaar llvm-svn: 78880 --- tools/llvm-prof/llvm-prof.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/llvm-prof/llvm-prof.cpp b/tools/llvm-prof/llvm-prof.cpp index c370e6bee7e..f9f109df50a 100644 --- a/tools/llvm-prof/llvm-prof.cpp +++ b/tools/llvm-prof/llvm-prof.cpp @@ -58,10 +58,10 @@ namespace { // PairSecondSort - A sorting predicate to sort by the second element of a pair. template struct PairSecondSortReverse - : public std::binary_function, - std::pair, bool> { - bool operator()(const std::pair &LHS, - const std::pair &RHS) const { + : public std::binary_function, + std::pair, bool> { + bool operator()(const std::pair &LHS, + const std::pair &RHS) const { return LHS.second > RHS.second; } }; @@ -98,7 +98,7 @@ namespace { virtual void emitBasicBlockEndAnnot(const BasicBlock *BB, raw_ostream &OS) { // Figure out how many times each successor executed. - std::vector > SuccCounts; + std::vector > SuccCounts; const TerminatorInst *TI = BB->getTerminator(); for (unsigned s = 0, e = TI->getNumSuccessors(); s != e; ++s) { @@ -151,8 +151,8 @@ bool ProfileInfoPrinterPass::runOnModule(Module &M) { // the command line, for now, just keep things simple. // Emit the most frequent function table... - std::vector > FunctionCounts; - std::vector > Counts; + std::vector > FunctionCounts; + std::vector > Counts; for (Module::iterator FI = M.begin(), FE = M.end(); FI != FE; ++FI) { if (FI->isDeclaration()) continue; double w = ignoreMissing(PI.getExecutionCount(FI)); @@ -168,7 +168,7 @@ bool ProfileInfoPrinterPass::runOnModule(Module &M) { sort(FunctionCounts.begin(), FunctionCounts.end(), PairSecondSortReverse()); - uint64_t TotalExecutions = 0; + double TotalExecutions = 0; for (unsigned i = 0, e = FunctionCounts.size(); i != e; ++i) TotalExecutions += FunctionCounts[i].second;