[llvm-commits] [llvm] r80084 - /llvm/trunk/lib/Analysis/ProfileInfo.cpp
Andreas Neustifter
astifter at gmx.at
Wed Aug 26 06:33:09 PDT 2009
Author: astifter
Date: Wed Aug 26 08:33:09 2009
New Revision: 80084
URL: http://llvm.org/viewvc/llvm-project?rev=80084&view=rev
Log:
Moved isDeclaration() check further down to allow for function counts for
declarations if necessary.
Modified:
llvm/trunk/lib/Analysis/ProfileInfo.cpp
Modified: llvm/trunk/lib/Analysis/ProfileInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ProfileInfo.cpp?rev=80084&r1=80083&r2=80084&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ProfileInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/ProfileInfo.cpp Wed Aug 26 08:33:09 2009
@@ -67,12 +67,15 @@
}
double ProfileInfo::getExecutionCount(const Function *F) {
- if (F->isDeclaration()) return MissingValue;
std::map<const Function*, double>::iterator J =
FunctionInformation.find(F);
if (J != FunctionInformation.end())
return J->second;
+ // isDeclaration() is checked here and not at start of function to allow
+ // functions without a body still to have a execution count.
+ if (F->isDeclaration()) return MissingValue;
+
double Count = getExecutionCount(&F->getEntryBlock());
if (Count != MissingValue) FunctionInformation[F] = Count;
return Count;
More information about the llvm-commits
mailing list