Add a clear() method to PriorityQueue.
[oota-llvm.git] / lib / Transforms / Instrumentation / RSProfiling.h
index 3ab125493b948a39e47decf3c9e6bc729a742b3d..8bbe7c7b28fe53d99a130588e47db4fa7f32a9de 100644 (file)
@@ -1,28 +1,31 @@
-//===- RSProfiling.cpp - Various profiling using random sampling ----------===//
+//===- RSProfiling.h - Various profiling using random sampling ----------===//
 //
 //                      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.
 //
 //===----------------------------------------------------------------------===//
 //
 // See notes in RSProfiling.cpp
 //
 //===----------------------------------------------------------------------===//
+#include "llvm/Transforms/RSProfiling.h"
+#include <set>
 
 namespace llvm {
-  // By default, we provide some convienence stuff to clients, so they 
-  // can just store the instructions they create to do profiling.
-  // also, handle all chaining issues.
-  // a client is free to overwrite these, as long as it implements the
-  // chaining itself.
-  struct RSProfilers : public ModulePass {
+  /// RSProfilers_std - a simple support class for profilers that handles most
+  /// of the work of chaining and tracking inserted code.
+  struct RSProfilers_std : public RSProfilers {
+    static char ID;
     std::set<Value*> profcode;
+    // Lookup up values in profcode
     virtual bool isProfiling(Value* v);
-    virtual ~RSProfilers() {}
+    // handles required chaining
     virtual void getAnalysisUsage(AnalysisUsage &AU) const;
+    // places counter updates in basic blocks and recordes added instructions in
+    // profcode
     void IncrementCounterInBlock(BasicBlock *BB, unsigned CounterNum,
                                  GlobalValue *CounterArray);
   };
-};
+}