[SystemZ] Add test missing from r186148
[oota-llvm.git] / include / llvm / Analysis / ProfileDataLoader.h
index 8c108b6e07409d6137327f42c14e5a9a7e3b08ca..90097f79951d3b0bdee56acccdb36293938aeb7d 100644 (file)
@@ -16,6 +16,7 @@
 #ifndef LLVM_ANALYSIS_PROFILEDATALOADER_H
 #define LLVM_ANALYSIS_PROFILEDATALOADER_H
 
+#include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/Support/Debug.h"
@@ -28,11 +29,9 @@ class ModulePass;
 class Function;
 class BasicBlock;
 
-// Helpers for dumping edges to dbgs().
+// Helper for dumping edges to dbgs().
 raw_ostream& operator<<(raw_ostream &O, std::pair<const BasicBlock *,
                                                   const BasicBlock *> E);
-raw_ostream& operator<<(raw_ostream &O, const BasicBlock *BB);
-raw_ostream& operator<<(raw_ostream &O, const Function *F);
 
 /// \brief The ProfileDataT<FType, BType> class is used to store the mapping of
 /// profiling data to control flow edges.
@@ -40,12 +39,12 @@ raw_ostream& operator<<(raw_ostream &O, const Function *F);
 /// An edge is defined by its source and sink basic blocks.
 template<class FType, class BType>
 class ProfileDataT {
-  public:
+public:
   // The profiling information defines an Edge by its source and sink basic
   // blocks.
   typedef std::pair<const BType*, const BType*> Edge;
 
-  private:
+private:
   typedef DenseMap<Edge, unsigned> EdgeWeights;
 
   /// \brief Count the number of times a transition between two blocks is
@@ -55,11 +54,7 @@ class ProfileDataT {
   /// entry block to indicate how many times the function was entered.
   DenseMap<const FType*, EdgeWeights> EdgeInformation;
 
-  public:
-  static char ID; // Class identification, replacement for typeinfo
-  ProfileDataT() {};
-  ~ProfileDataT() {};
-
+public:
   /// getFunction() - Returns the Function for an Edge.
   static const FType *getFunction(Edge e) {
     // e.first may be NULL
@@ -90,7 +85,7 @@ class ProfileDataT {
   /// addEdgeWeight - Add 'weight' to the already stored execution count for
   /// this edge.
   void addEdgeWeight(Edge e, unsigned weight) {
-      EdgeInformation[getFunction(e)][e] += weight;
+    EdgeInformation[getFunction(e)][e] += weight;
   }
 };
 
@@ -121,9 +116,6 @@ public:
   /// been counted yet.
   static const unsigned Uncounted;
 
-  /// The maximum value that can be stored in a profiling counter.
-  static const unsigned MaxCount;
-
   /// getNumExecutions - Return the number of times the target program was run
   /// to generate this profiling data.
   unsigned getNumExecutions() const { return CommandLines.size(); }
@@ -136,7 +128,7 @@ public:
 
   /// getRawEdgeCounts - Return the raw profiling data, this is just a list of
   /// numbers with no mappings to edges.
-  const SmallVector<unsigned, 32> &getRawEdgeCounts() const { return EdgeCounts; }
+  ArrayRef<unsigned> getRawEdgeCounts() const { return EdgeCounts; }
 };
 
 /// createProfileMetadataLoaderPass - This function returns a Pass that loads