diff options
Diffstat (limited to 'lib/Analysis')
-rw-r--r-- | lib/Analysis/ProfileInfo.cpp | 2 | ||||
-rw-r--r-- | lib/Analysis/ProfileInfoLoader.cpp | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/Analysis/ProfileInfo.cpp b/lib/Analysis/ProfileInfo.cpp index 719eeada15..6eead0fd6e 100644 --- a/lib/Analysis/ProfileInfo.cpp +++ b/lib/Analysis/ProfileInfo.cpp @@ -33,7 +33,7 @@ unsigned ProfileInfo::getExecutionCount(BasicBlock *BB) const { // Are there zero predecessors of this block? if (PI == PE) { // If this is the entry block, look for the Null -> Entry edge. - if (BB == &BB->getParent()->front()) + if (BB == &BB->getParent()->getEntryBlock()) return getEdgeWeight(0, BB); else return 0; // Otherwise, this is a dead block. diff --git a/lib/Analysis/ProfileInfoLoader.cpp b/lib/Analysis/ProfileInfoLoader.cpp index 23ceb52d8e..dec29a40b1 100644 --- a/lib/Analysis/ProfileInfoLoader.cpp +++ b/lib/Analysis/ProfileInfoLoader.cpp @@ -152,7 +152,8 @@ void ProfileInfoLoader::getFunctionCounts(std::vector<std::pair<Function*, getBlockCounts(BlockCounts); for (unsigned i = 0, e = BlockCounts.size(); i != e; ++i) - if (&BlockCounts[i].first->getParent()->front() == BlockCounts[i].first) + if (&BlockCounts[i].first->getParent()->getEntryBlock() == + BlockCounts[i].first) Counts.push_back(std::make_pair(BlockCounts[i].first->getParent(), BlockCounts[i].second)); } else { |