aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-08-08 18:59:03 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-08-08 18:59:03 +0000
commitc43782cf7163805fb6d727382b5f807ea035b2b0 (patch)
tree6d66db6a874af9d7c48d4357655665c547c1ffd0 /lib/Analysis
parent55e354ac0e294bde258420f80a2cc11ea19db482 (diff)
downloadexternal_llvm-c43782cf7163805fb6d727382b5f807ea035b2b0.zip
external_llvm-c43782cf7163805fb6d727382b5f807ea035b2b0.tar.gz
external_llvm-c43782cf7163805fb6d727382b5f807ea035b2b0.tar.bz2
Some ProfileInfo cleanups.
- Part of optimal static profiling patch sequence by Andreas Neustifter. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78485 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/ProfileInfo.cpp1
-rw-r--r--lib/Analysis/ProfileInfoLoaderPass.cpp2
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/Analysis/ProfileInfo.cpp b/lib/Analysis/ProfileInfo.cpp
index 670d4e7..2ed466b 100644
--- a/lib/Analysis/ProfileInfo.cpp
+++ b/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<const Function*, double>::iterator J =
FunctionInformation.find(F);
if (J != FunctionInformation.end())
diff --git a/lib/Analysis/ProfileInfoLoaderPass.cpp b/lib/Analysis/ProfileInfoLoaderPass.cpp
index c1dc9f2..3e75f02 100644
--- a/lib/Analysis/ProfileInfoLoaderPass.cpp
+++ b/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