Update test case to reflect Dale's change.
[oota-llvm.git] / lib / Analysis / ProfileInfo.cpp
index 719eeada15aac0b99de951f2d4c76a092c5a5472..c8dad662f19330f435d5f950cbaf7a56be40f89e 100644 (file)
@@ -24,6 +24,7 @@ using namespace llvm;
 namespace {
   RegisterAnalysisGroup<ProfileInfo> Z("Profile Information");
 }
+char ProfileInfo::ID = 0;
 
 ProfileInfo::~ProfileInfo() {}
 
@@ -33,7 +34,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.
@@ -84,8 +85,12 @@ unsigned ProfileInfo::getExecutionCount(BasicBlock *BB) const {
 
 namespace {
   struct VISIBILITY_HIDDEN NoProfileInfo 
-    : public ImmutablePass, public ProfileInfo {};
+    : public ImmutablePass, public ProfileInfo {
+    static char ID; // Class identification, replacement for typeinfo
+    NoProfileInfo() : ImmutablePass((intptr_t)&ID) {}
+  };
 
+  char NoProfileInfo::ID = 0;
   // Register this pass...
   RegisterPass<NoProfileInfo>
   X("no-profile", "No Profile Information");