LLVM API Documentation

RSProfiling.h

Go to the documentation of this file.
00001 //===- RSProfiling.cpp - Various profiling using random sampling ----------===//
00002 //
00003 //                      The LLVM Compiler Infrastructure
00004 //
00005 // This file was developed by the LLVM research group and is distributed under
00006 // the University of Illinois Open Source License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file defines the abstract interface that a profiler must implement to
00011 // support the random profiling transform.
00012 //
00013 //===----------------------------------------------------------------------===//
00014 
00015 namespace llvm {
00016   //===--------------------------------------------------------------------===//
00017   /// RSProfilers - The basic Random Sampling Profiler Interface  Any profiler 
00018   /// that implements this interface can be transformed by the random sampling
00019   /// pass to be sample based rather than always on.
00020   ///
00021   /// The only exposed function can be queried to find out if an instruction
00022   /// was original or if it was inserted by the profiler.  Implementations of
00023   /// this interface are expected to chain to other implementations, such that
00024   /// multiple profilers can be support simultaniously.
00025   struct RSProfilers : public ModulePass {
00026     /// isProfiling - This method returns true if the value passed it was 
00027     /// inserted by the profiler.
00028     virtual bool isProfiling(Value* v) = 0;
00029   };
00030 }