From 2f140834cf7bbdc859389bb749920bc65451817d Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Sat, 8 Aug 2009 18:59:03 +0000 Subject: Some ProfileInfo cleanups. - Part of optimal static profiling patch sequence by Andreas Neustifter. llvm-svn: 78485 --- llvm/lib/Analysis/ProfileInfo.cpp | 1 + llvm/lib/Analysis/ProfileInfoLoaderPass.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'llvm/lib/Analysis') diff --git a/llvm/lib/Analysis/ProfileInfo.cpp b/llvm/lib/Analysis/ProfileInfo.cpp index 670d4e73797..2ed466bf323 100644 --- a/llvm/lib/Analysis/ProfileInfo.cpp +++ b/llvm/lib/Analysis/ProfileInfo.cpp @@ -64,6 +64,7 @@ double ProfileInfo::getExecutionCount(const BasicBlock *BB) { } double ProfileInfo::getExecutionCount(const Function *F) { + if (F->isDeclaration()) return MissingValue; std::map::iterator J = FunctionInformation.find(F); if (J != FunctionInformation.end()) diff --git a/llvm/lib/Analysis/ProfileInfoLoaderPass.cpp b/llvm/lib/Analysis/ProfileInfoLoaderPass.cpp index c1dc9f2e472..3e75f0274b2 100644 --- a/llvm/lib/Analysis/ProfileInfoLoaderPass.cpp +++ b/llvm/lib/Analysis/ProfileInfoLoaderPass.cpp @@ -77,7 +77,7 @@ bool LoaderPass::runOnModule(Module &M) { for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F) { if (F->isDeclaration()) continue; if (ei < ECs.size()) - EdgeInformation[F][ProfileInfo::getEdge(0,&F->getEntryBlock())] += + EdgeInformation[F][ProfileInfo::getEdge(0, &F->getEntryBlock())] += ECs[ei++]; for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB) { // Okay, we have to add a counter of each outgoing edge. If the -- cgit v1.2.3