Add a convenince member function for appending strings to a module's
[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     static char ID; // Pass identification, replacement for typeinfo
27     RSProfilers() : ModulePass((intptr_t)&ID) {}
28
29     /// isProfiling - This method returns true if the value passed it was 
30     /// inserted by the profiler.
31     virtual bool isProfiling(Value* v) = 0;
32   };
33 }