Add support for reading block frequencies.  Fix bug in attribution of counts
to functions


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9559 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/llvm-prof/ProfileInfo.h b/tools/llvm-prof/ProfileInfo.h
index 360d5fa..eab9bc9 100644
--- a/tools/llvm-prof/ProfileInfo.h
+++ b/tools/llvm-prof/ProfileInfo.h
@@ -20,6 +20,7 @@
 #include <utility>
 class Module;
 class Function;
+class BasicBlock;
 
 class ProfileInfo {
   Module &M;
@@ -37,6 +38,18 @@
   //
   void getFunctionCounts(std::vector<std::pair<Function*, unsigned> > &Counts);
 
+  // hasAccurateBlockCounts - Return true if we can synthesize accurate block
+  // frequency information from whatever we have.
+  //
+  bool hasAccurateBlockCounts() const {
+    return !BlockCounts.empty();
+  }
+
+  // getBlockCounts - This method is used by consumers of block counting
+  // information.  If we do not directly have block count information, we
+  // compute it from other, more refined, types of profile information.
+  //
+  void getBlockCounts(std::vector<std::pair<BasicBlock*, unsigned> > &Counts);
 };
 
 #endif