Don't attribute in file headers anymore. See llvmdev for the
[oota-llvm.git] / include / llvm / Analysis / ProfileInfoLoader.h
index b6694014227172080a51752fcfaab408b2a07db9..8a5141ab23525f4f6f150bb95b7d1bfb17fb87c1 100644 (file)
@@ -1,10 +1,10 @@
 //===- ProfileInfoLoader.h - Load & convert profile information -*- C++ -*-===//
-// 
+//
 //                      The LLVM Compiler Infrastructure
 //
-// This file was developed by the LLVM research group and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
 //===----------------------------------------------------------------------===//
 //
 // The ProfileInfoLoader class is used to load and represent profiling
@@ -31,6 +31,8 @@ class ProfileInfoLoader {
   std::vector<std::string> CommandLines;
   std::vector<unsigned>    FunctionCounts;
   std::vector<unsigned>    BlockCounts;
+  std::vector<unsigned>    EdgeCounts;
+  std::vector<unsigned>    BBTrace;
 public:
   // ProfileInfoLoader ctor - Read the specified profiling data file, exiting
   // the program if the file is invalid or broken.
@@ -50,7 +52,14 @@ public:
   // frequency information from whatever we have.
   //
   bool hasAccurateBlockCounts() const {
-    return !BlockCounts.empty();
+    return !BlockCounts.empty() || !EdgeCounts.empty();
+  }
+
+  // hasAccurateEdgeCounts - Return true if we can synthesize accurate edge
+  // frequency information from whatever we have.
+  //
+  bool hasAccurateEdgeCounts() const {
+    return !EdgeCounts.empty();
   }
 
   // getBlockCounts - This method is used by consumers of block counting
@@ -58,6 +67,21 @@ public:
   // compute it from other, more refined, types of profile information.
   //
   void getBlockCounts(std::vector<std::pair<BasicBlock*, unsigned> > &Counts);
+
+  // getEdgeCounts - This method is used by consumers of edge counting
+  // information.  If we do not directly have edge count information, we compute
+  // it from other, more refined, types of profile information.
+  //
+  // Edges are represented as a pair, where the first element is the basic block
+  // and the second element is the successor number.
+  //
+  typedef std::pair<BasicBlock*, unsigned> Edge;
+  void getEdgeCounts(std::vector<std::pair<Edge, unsigned> > &Counts);
+
+  // getBBTrace - This method is used by consumers of basic-block trace
+  // information.
+  //
+  void getBBTrace(std::vector<BasicBlock *> &Trace);
 };
 
 } // End llvm namespace