Added documented rsprofiler interface. Also remove new profiler passes, the
[oota-llvm.git] / include / llvm / Transforms / RSProfiling.h
1 //===- RSProfiling.cpp - Various profiling using random sampling ----------===//
2 //
3 //                      The LLVM Compiler Infrastructure
4 //
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file defines the abstract interface that a profiler must implement to
11 // support the random profiling transform.
12 //
13 //===----------------------------------------------------------------------===//
14
15 namespace llvm {
16   //===--------------------------------------------------------------------===//
17   /// RSProfilers - The basic Random Sampling Profiler Interface  Any profiler 
18   /// that implements this interface can be transformed by the random sampling
19   /// pass to be sample based rather than always on.
20   ///
21   /// The only exposed function can be queried to find out if an instruction
22   /// was original or if it was inserted by the profiler.  Implementations of
23   /// this interface are expected to chain to other implementations, such that
24   /// multiple profilers can be support simultaniously.
25   struct RSProfilers : public ModulePass {
26     /// isProfiling - This method returns true if the value passed it was 
27     /// inserted by the profiler.
28     virtual bool isProfiling(Value* v) = 0;
29   };
30 };